Duplicating English language fails

Mehr
4 Jahre 4 Monate her - 4 Jahre 4 Monate her #97722 von jonsen
jonsen erstellte das Thema Duplicating English language fails
Hi everyone!

I currently work on a survey where there are seven versions of the questionnaire. Three of them are in English and four more in other languages. To have all versions separate, I wanted to copy the English language file twice, thus getting two more English versions of the questionnaire.

What I did:

1. Copy English .mo-file:
cp /srv/lime.example.com/locale/en/LC_MESSAGES/en.mo /srv/lime.example.com/locale/en_x/LC_MESSAGES/en_x.mo
cp /srv/lime.example.com/locale/en/LC_MESSAGES/en.mo /srv/lime.example.com/locale/en_y/LC_MESSAGES/en_y.mo

2. Add new languages to surveytranslator_helper.php
	// English (this was there before)
        $supportedLanguages['en']['description'] = $clang->gT('English');
        $supportedLanguages['en']['nativedescription'] = 'English';
        $supportedLanguages['en']['rtl'] = false;
        $supportedLanguages['en']['dateformat'] = 9;
        $supportedLanguages['en']['radixpoint'] = 0;
 
        // English_X
        $supportedLanguages['en_x']['description'] = $clang->gT('English X');
        $supportedLanguages['en_x']['nativedescription'] = 'English X';
        $supportedLanguages['en_x']['rtl'] = false;
        $supportedLanguages['en_x']['dateformat'] = 9;
        $supportedLanguages['en_x']['radixpoint'] = 0;
 
        // English_Y
        $supportedLanguages['en_y']['description'] = $clang->gT('English Y');
        $supportedLanguages['en_y']['nativedescription'] = 'English Y';
        $supportedLanguages['en_y']['rtl'] = false;
        $supportedLanguages['en_y']['dateformat'] = 9;
        $supportedLanguages['en_y']['radixpoint'] = 0;

Now, whenever I want to edit a question in the survey with the new languages, I get an "Internal Server Error - The active record cannot be inserted to database because it is not new." Fortunately, surveys without the new languages are not affected.

Can anybody tell me why I get the 500 error?

Best,
jonsen
Letzte Änderung: 4 Jahre 4 Monate her von jonsen.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 3 Monate her #98371 von jonsen
jonsen antwortete auf das Thema: Duplicating English language fails
Hello everyone,

I don't know how to approach this issue. All changes have to be run by the admin of the server. So I can't just play around until it works.

1) Could it be that I cannot use the underscore "_" within the abbreviation?

2) Do I maybe need to change something within the .po-files? (I copied the .mo-files in step 1 above.)

It would be really great if someone with some basic knowledge of the translation system could help. It would be a shame to use conditions within all the texts for this while LS is so flexible on the translations...

Thanks to this great project and its community!

Best
jonsen

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 3 Monate her #98375 von DenisChenu
DenisChenu antwortete auf das Thema: Duplicating English language fails
Hello,

All changes have to be run by the admin of the server.

You can not access to PHP file ? Very difficult to trace then .... For dev : i use allways a lot of trace/log/ (and sometimes die ...).

Try to put debug=>2 in your application/config/config.php file

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 3 Monate her #98380 von Ben_V
Ben_V antwortete auf das Thema: Duplicating English language fails
If no already intented, you should try to upload (again) original .po &.mo files

I remember such 500 error in my installation just after editing those (french) files. All french version surveys crashed but it was ok for other languages.

It was totally repared after re-uploading the original files, included in the package with the old LS versions.

For recent LS versions, .po &.mo files are available here ...

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 3 Monate her #98397 von jonsen
jonsen antwortete auf das Thema: Duplicating English language fails
Thanks for your anwers guys... I will probably set up a test installation to not interfere with the productive system. That might come in handy at other points too.

Thanks for now!

Best
jonsen

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 3 Monate her - 4 Jahre 3 Monate her #98510 von jonsen
jonsen antwortete auf das Thema: SOLVED: Duplicating English language fails
SOLUTION: First thing I tried on the development installation was to replace the subscores "_" in the language codes with dashes "-" in both the surveytranslator_helper.php and the names of the folders and files within ./locale/. So instead of "en_x", I use "en-x" now. It works totally fine!

Thanks for you efforts!

Best
jonsen
Letzte Änderung: 4 Jahre 3 Monate her von jonsen. Begründung: removed typo
Folgende Benutzer bedankten sich: Ben_V

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha