Welcome, Guest
Username: Password: Remember me

TOPIC: Duplicating English language fails

Duplicating English language fails 9 months 1 week ago #97722

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 61
  • Thank you received: 2
  • Karma: 0
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
Last Edit: 9 months 1 week ago by jonsen.
The administrator has disabled public write access.

Duplicating English language fails 8 months 3 weeks ago #98371

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 61
  • Thank you received: 2
  • Karma: 0
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
The administrator has disabled public write access.

Duplicating English language fails 8 months 3 weeks ago #98375

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5830
  • Thank you received: 711
  • Karma: 220
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
The administrator has disabled public write access.

Duplicating English language fails 8 months 3 weeks ago #98380

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 933
  • Thank you received: 193
  • Karma: 62
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.

Duplicating English language fails 8 months 3 weeks ago #98397

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 61
  • Thank you received: 2
  • Karma: 0
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
The administrator has disabled public write access.

SOLVED: Duplicating English language fails 8 months 3 weeks ago #98510

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 61
  • Thank you received: 2
  • Karma: 0
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
Last Edit: 8 months 3 weeks ago by jonsen. Reason: removed typo
The administrator has disabled public write access.
The following user(s) said Thank You: Ben_V
Moderators: ITEd
Time to create page: 0.231 seconds
Donation Image