Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • _R 13 posts 143 karma points
    Jul 25, 2023 @ 08:28
    _R
    0

    GetAllCultures Failes with 'Culture is not supported.'

    Currently we struggle with the following API call which is performed by Umbraco: umbraco/backoffice/umbracoapi/language/GetAllCultures

    The response of the call is:

    {
        "ExceptionMessage": "Culture is not supported. (Parameter 'name')\r\naa is an invalid culture identifier.",
        "ExceptionType": null,
        "StackTrace": null
    }
    

    This call should return all available cultures like:

    {
        "aa": "Afar",
        "aa-DJ": "Afar (Djibouti)",
        "aa-ER": "Afar (Eritrea)",
        "aa-ET": "Afar (Ethiopia)",
        "af": "Afrikaans",
        "af-NA": "Afrikaans (Namibia)",
        "af-ZA": "Afrikaans (South Africa)",
        "agq": "Aghem",
        "agq-CM": "Aghem (Cameroon)",
        "ak": "Akan",
        "ak-GH": "Akan (Ghana)",
        Etc.....
    }
    

    As far as I can see in the controller this code should be executed and nothing more right?:

    [HttpGet]
    public IDictionary<string, string> GetAllCultures()
        => CultureInfo.GetCultures(CultureTypes.AllCultures).DistinctBy(x => x.Name).OrderBy(x => x.EnglishName).ToDictionary(x => x.Name, x => x.EnglishName);
    

    How can this controller endpoint ever fail?

    Because it cannot retrieve any culture, we also cannot add any new ones via Umbraco. Currently we have one culture configured in the DB and it looks like this:

    "id","languageISOCode","languageCultureName","isDefaultVariantLang","mandatory","fallbackLanguageId"
    1,en-US,English (United States),0,0,
    
  • Huw Reddick 1737 posts 6098 karma points MVP c-trib
    Jul 28, 2023 @ 15:57
    Huw Reddick
    0

    We just got the exact same issue on a site we are upgrading, what version of Umbraco are you working with?

  • _R 13 posts 143 karma points
    Jul 31, 2023 @ 14:20
    _R
    0

    Currently we are at version Umbraco version 10.5.0 in which we encountered this issue.

  • Huw Reddick 1737 posts 6098 karma points MVP c-trib
    Jul 31, 2023 @ 14:44
    Huw Reddick
    0

    Hi _R, could you confirm what server OS you are using? so far I have only encountered the problem on Server2012

  • _R 13 posts 143 karma points
    Aug 02, 2023 @ 09:19
    _R
    0

    Hey Huw,

    True, we encountered the problem on our Windows Server 2012 R2 Datacenter.

    For now it looks like it has some trouble extracting cultures using IIS globalization:

    CultureInfo.GetCultures(CultureTypes.AllCultures).DistinctBy(x => x.Name).OrderBy(x => x.EnglishName).ToDictionary(x => x.Name, x => x.EnglishName);
    
  • TiaNewman 2 posts 71 karma points
    Aug 02, 2023 @ 09:46
    TiaNewman
    0

    Thanks for the information. MyTHDHR.com

  • Mohammed BOUTEBEL 64 posts 103 karma points
    Sep 27, 2023 @ 13:39
    Mohammed BOUTEBEL
    0

    Hi.

    We noticed the same behavior on a Umbraco 12.1.1 installed and the package uskinnedSiteBuilder installed.

  • Huw Reddick 1737 posts 6098 karma points MVP c-trib
    15 days ago
    Huw Reddick
    0

    this is/was an OS issue, do you know what OS your site is running on?

Please Sign in or register to post replies

Write your reply to:

Draft