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.

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

    Note that UK is uppercase.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • 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

  • It is not related to it.

  • Hi,

    This error usually occurs when sometimes language preference is associated with the logged-in user, If you will try to log in with some other account, this issue will not occur. So for resolving this, there is a "preferred_language" column in the users' table, Set it to Null for work it for your current user as well.

    Kind Regards,

    Rolustech Support

    Email: support@rolustech.com
    Website: www.rolustech.com

  • Yes, it worked, Thanks!

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