Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : Duplicating English language fails

Duplicating English language fails il y a 1 an 1 mois #97722

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 6
  • Karma: 1
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
Dernière édition: il y a 1 an 1 mois par jonsen.
L'administrateur a désactivé l'accès en écriture pour le public.

Duplicating English language fails il y a 1 an 1 mois #98371

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 6
  • Karma: 1
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
L'administrateur a désactivé l'accès en écriture pour le public.

Duplicating English language fails il y a 1 an 1 mois #98375

  • DenisChenu
  • Portrait de DenisChenu
  • Hors ligne
  • Moderator Lime
  • Messages : 6277
  • Remerciements reçus 802
  • Karma: 241
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
L'administrateur a désactivé l'accès en écriture pour le public.

Duplicating English language fails il y a 1 an 1 mois #98380

  • Ben_V
  • Portrait de Ben_V
  • Hors ligne
  • Platinum Lime
  • Messages : 1069
  • Remerciements reçus 236
  • Karma: 74
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...
L'administrateur a désactivé l'accès en écriture pour le public.

Duplicating English language fails il y a 1 an 1 mois #98397

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 6
  • Karma: 1
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
L'administrateur a désactivé l'accès en écriture pour le public.

SOLVED: Duplicating English language fails il y a 1 an 1 mois #98510

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 6
  • Karma: 1
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
Dernière édition: il y a 1 an 1 mois par jonsen. Raison: removed typo
L'administrateur a désactivé l'accès en écriture pour le public.
Cet utilisateur a été remercié pour son message par: Ben_V
Modérateurs: ITEd
Temps de génération de la page : 0.318 secondes
Donation Image