Unable to sync with server. Violation for language value

I checked the default language of sugar by using App.lang.getLanguage(), which is 'en_us'.

Then I set it to 'en_uk' by App.lang.setLanguage('en_uk'). 

After doing this I am receiving this error "Unable to sync with server. Violation for language value".

I don't know why it is happening. I set it back to 'en_us' but still, it is happening. Please let me know how I can resolve this issue.

Parents
  • Try App.lang.setLanguage('en_UK')

    Note that UK is uppercase.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • I had a similar problem in a custom unit-php test, when I was trying to load the app strings in a setUp method.

    protected function setUp()
    {
        global $app_list_strings;

        $app_list_strings = return_app_list_strings_language('en_us', false);
    }

    All of the tests in that class were failing with 'Violation for language value'.

    I finally realized it's because my unit tests were not loading sugar_config (nor should they, they're unit not functional), so the following change fixed it:

    protected function setUp()
    {
        global $app_list_strings, $sugar_config;

        $sugar_config['languages'] = ['en_us' => 'English (US)'];
        $app_list_strings = return_app_list_strings_language('en_us', false);
    }

    This only occurs in 8.0.4 or greater in the 8.x line, as the language key validation was added in 8.0.4.  I don't know which versions of Sugar 9.x the validators were added to.

Reply
  • I had a similar problem in a custom unit-php test, when I was trying to load the app strings in a setUp method.

    protected function setUp()
    {
        global $app_list_strings;

        $app_list_strings = return_app_list_strings_language('en_us', false);
    }

    All of the tests in that class were failing with 'Violation for language value'.

    I finally realized it's because my unit tests were not loading sugar_config (nor should they, they're unit not functional), so the following change fixed it:

    protected function setUp()
    {
        global $app_list_strings, $sugar_config;

        $sugar_config['languages'] = ['en_us' => 'English (US)'];
        $app_list_strings = return_app_list_strings_language('en_us', false);
    }

    This only occurs in 8.0.4 or greater in the 8.x line, as the language key validation was added in 8.0.4.  I don't know which versions of Sugar 9.x the validators were added to.

Children
No Data