navigator.language list of all languages

前端 未结 5 1103
你的背包
你的背包 2021-02-12 04:33

Where i can see the list of languages and their codes?

I want to compare languages and auto-select required language in template.

Are they cross-browser equal?

5条回答
  •  广开言路
    2021-02-12 05:24

    Or if you need an enum of languages without locale in typescript or plaint object in javascript for copy-paste purposes

    export enum ISOLanguages {
      AF = 'af',
      SQ = 'sq',
      AR = 'ar',
      EU = 'eu',
      BG = 'bg',
      BE = 'be',
      CA = 'ca',
      ZH = 'zh',
      HR = 'hr',
      CS = 'cs',
      DA = 'da',
      NL = 'nl',
      EN = 'en',
      ET = 'et',
      FO = 'fo',
      FA = 'fa',
      FI = 'fi',
      FR = 'fr',
      GD = 'gd',
      DE = 'de',
      EL = 'el',
      HE = 'he',
      HI = 'hi',
      HU = 'hu',
      IS = 'is',
      ID = 'id',
      IT = 'it',
      JA = 'ja',
      KO = 'ko',
      LV = 'lv',
      LT = 'lt',
      MK = 'mk',
      MT = 'mt',
      NO = 'no',
      PL = 'pl',
      PT = 'pt',
      RM = 'rm',
      RO = 'ro',
      RU = 'ru',
      SZ = 'sz',
      SR = 'sr',
      SK = 'sk',
      SL = 'sl',
      SB = 'sb',
      ES = 'es',
      SX = 'sx',
      SV = 'sv',
      TH = 'th',
      TS = 'ts',
      TN = 'tn',
      TR = 'tr',
      UK = 'uk',
      UR = 'ur',
      VE = 've',
      VI = 'vi',
      XH = 'xh',
      JI = 'ji',
      ZU = 'zu',
    }
    

提交回复
热议问题