Important information for script developers concerning the language identifiers

Forum Forums antiX-development Development Important information for script developers concerning the language identifiers

  • This topic has 1 reply, 2 voices, and was last updated Aug 22-8:25 pm by BobC.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #69049
    Member
    Robin

      Hi all,

      it turned out, there are some language identifiers in our list of languages, comprising of 3 instead of 2 characters, respectively 6 instead of 5 characters for “four significant letter codes”.
      This is due to the fact, that some languages follow the regulations ISO 639-2, ISO 639-3 and ISO 639-5 instead of ISO 639-1.

      So please make sure NOT to use the character count anymore in your scripts, like:

      UI_lang_2=”$(echo $LANG | cut -c -2)”
      UI_lang_4=”$(echo $LANG | cut -c -5)”

      (which works fine for any language following ISO 639-1, like »fr«, »fr_BE« »pt«, »pt_BR« »de«, »ru«,…. )

      Better use the field separators instead, which will cut the correct language identifier irrespectiv of its actual character count:

      UI_lang_4="$(echo $LANG | cut -d. -f1)"
      UI_lang_2="$(echo $LANG | cut -d. -f1 | cut -d_ -f1)"

      The result is exactly identical for two/four character languages, so it can simply get used as a 1:1 replacement which will correctly distinguish between e.g.

      »fi« and »fil«.

      We’ll probably have to check all our scripts for this problem, since it’ll cause a bug for people coming from a country with a language identifier affected, as soon as they actively start using antiX. E.g. their language »fil« will get interpreted as »fi« if a script is not crafted to handle the three characters of their language identifier correctly.

      So long
      Robin.

      Windows is like a submarine. Open a window and serious problems will start.

      #87601
      Moderator
      BobC
        Helpful
        Up
        0
        ::

        Thanks for posting this!

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.