Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

2.06LTS Unrecognized locale (modified code)

More
8 years 11 months ago - 8 years 11 months ago #133179 by ifok
Hi,

first things first: We are modifying Limesurvey code on our webserver to add a new language after every update. Yes, we are bad bad people and should shame ourself, and we know that this is not supported in any way.

We are commercially using Limesurvey for Event Registration (and surveys) since v1.7x... to accomplish a proper wording, we edit the /locale/de.mo file, and find&replace the word "survey" with "registration" (in German), then save the file as /locale/de-anmeldung/de-anmeldung.po.

We also edit the file surveytranslator_helper.php and insert a snippet
Code:
// German Anmeldung 
        $supportedLanguages['de-anmeldung']['description'] = gT('Deutsch (Anmeldung)');
        $supportedLanguages['de-anmeldung']['nativedescription'] = 'Deutsch (Anmeldung)';
        $supportedLanguages['de-anmeldung']['rtl'] = false;
        $supportedLanguages['de-anmeldung']['dateformat'] = 1;
        $supportedLanguages['de-anmeldung']['radixpoint'] = 1;
        $supportedLanguages['de-informal']['cldr'] = 'de';

and modify the function in the same file
Code:
function translateLStoYiiLocale($sLocale)
    {
        // Strip informal string
        $sLocale=str_replace('-informal','',$sLocale);
         $sLocale=str_replace('-anmeldung','',$sLocale); // added by us  
        return $sLocale;
    }

This was working fine for us in the last few years and at least up to 2.06+ 160129

Unfortunately one of the latest few LTS Updates broke this method for us, we are now getting the error message Internal Server Error, Unrecognized locale "de-anmeldung" once we create a new survey using this language file and browse to the first question.

We don't ask you to fix this problem as this is only related to our special needs and not supported. But as there are not hints in the release notes regarding language changes, we wonder if you can point us to specific changes or git commit you made in the latest 2-3 LTS releases, regarding the language files which might cause this problem...
Last edit: 8 years 11 months ago by ifok.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
8 years 11 months ago #133182 by DenisChenu
Replied by DenisChenu on topic 2.06LTS Unrecognized locale (modified code)
Hi,,

Don't know for actual issue , but best is to have a clean API way ot do this : there are a feature request : bugs.limesurvey.org/view.php?id=9649

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: ifok
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose