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 Reply Children
  • Thanks for the response,

    I tried it with this too but nothing happened.

  • Is this a question related to mail (Lotus Notes) plugin? And, if so, what versions of Sugar, Plugin and mail client are you using? We have seen the same message in that context and were able to solve it

  • 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.