Announcement

Collapse
No announcement yet.

CultureInfo.Name not working correctly

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • CultureInfo.Name not working correctly

    https://dev.deck.net/076d90427bc3afc73a4ed42ee582ee2c

    I see
    iv
    ... in the output window instead of something like
    en-US
    ... following the logic here
    https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
    >> The culture name in the format languagecode2-country/regioncode2. languagecode2 is a lowercase two-letter code derived from ISO 639-1. country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag.

    This is on Windows 10, Google Chrome 58
    ​​​​​​​
    Is that expected?
    Last edited by DierkDroth; 2017-05-19 @ 08:00 AM.

  • #2
    Yes, it is expected. Default culture in Bridge is invariant culture, like if you have in .NET
    Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
    If you want to use different culture then you can attach required culture via bridge.json (https://github.com/bridgedotnet/Brid...ration#locales) and set the culture in C#, like
    CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");

    Comment


    • #3
      Thanks

      To clarify: the approach you suggested would not set the CultureInfo as per the current machine's settings (like in .NET), but I had to explicitly set it in code, correct?

      Comment


      • #4
        Vladimir would you mind providing clarification on my inquiry above?

        Thanks in advance

        Comment


        • #5
          Hi,

          In javascript, we have no access to such machine setting (there are settings unique for each browser but it is not part of any specification). Also, we cannot attach all locales to a page by default because the code for locales is quite big. So, you have to manually attach required locale to the page

          Comment


          • #6
            Understand Vladimir

            Thanks for clarification.

            Comment

            Working...
            X