iPhone lproj 文件夹的区域设置代码

发布于 2024-09-05 06:20:11 字数 111 浏览 3 评论 0 原文

在哪里可以找到我的项目本地化文件夹的区域设置名称缩写列表? (例如 en 表示英语,fr 表示法语)。

我希望学习德语、西班牙语和其他语言。

Where would I find a list of locale name abbreviations for my project localization folders? (Such as en for English, fr for French).

I am looking to do German, Spanish and others.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦断已成空 2024-09-12 06:20:11

您可以将它们称为 English.lprojSpanish.lproj 等。

“缩写名称”实际上是 IETF 语言标签(即 BCP 47),只不过您使用 pt_PT.lproj 而不是 pt-PT.lproj


实际的解释例程位于 https:// /github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/PlugIn.subproj/CFBundle_Locale.c,由 CFBundleGetLocalizationInfoForLocalization 函数确定。此处复制:

| lproj identifiers              | L#  | C#  | Display name               |
|:-------------------------------|:----|:----|:---------------------------|
| en_US = en = English           | 0   | 0   | English (United States)    |
| en_GB                          | 0   | 2   | English (United Kingdom)   |
| en_AU                          | 0   | 15  | English (Australia)        |
| en_CA                          | 0   | 82  | English (Canada)           |
| en_SG                          | 0   | 100 | English (Singapore)        |
| en_IE                          | 0   | 108 | English (Ireland)          |
| fr_FR = fr = French            | 1   | 1   | French (France)            |
| fr_CA                          | 1   | 11  | French (Canada)            |
| fr_CH                          | 1   | 18  | French (Switzerland)       |
| fr_BE                          | 1   | 98  | French (Belgium)           |
| de_DE = de = German            | 2   | 3   | German (Germany)           |
| de_CH                          | 2   | 19  | German (Switzerland)       |
| de_AT                          | 2   | 92  | German (Austria)           |
| it_IT = it = Italian           | 3   | 4   | Italian (Italy)            |
| it_CH                          | 3   | 36  | Italian (Switzerland)      |
| nl_NL = nl = Dutch             | 4   | 5   | Dutch (Netherlands)        |
| nl_BE                          | 34  | 6   | Dutch (Belgium)            |    
| sv_SE = sv = Swedish           | 5   | 7   | Swedish (Sweden)           |
| es_ES = es = Spanish           | 6   | 8   | Spanish (Spain)            |
| es_XL                          | 6   | 86  | Spanish (Latin America)    |
| da_DK = da = Danish            | 7   | 9   | Danish (Denmark)           |
| pt_BR = pt = Portuguese        | 8   | 71  | Portuguese (Brazil)        |
| pt_PT                          | 8   | 10  | Portuguese (Portugal)      |
| nb_NO = nb = no = Norwegian    | 9   | 12  | Norwegian Bokmål (Norway)  |
| nn_NO = nn = Nynorsk           | 151 | 101 | Norwegian Nynorsk (Norway) |
| he_IL = he = Hebrew            | 10  | 13  | Hebrew (Israel)            |
| ja_JP = ja = Japanese          | 11  | 14  | Japanese (Japan)           |
|         ar = Arabic            | 12  | 16  | Arabic                     |
| fi_FI = fi = Finnish           | 13  | 17  | Finnish (Finland)          |
| el_GR = el = Greek             | 14  | 20  | Greek (Greece)             |
| el_CY                          | 14  | 23  | Greek (Cyprus)             |
| is_IS = is = Icelandic         | 15  | 21  | Icelandic (Iceland)        |
| mt_MT = mt = Maltese           | 16  | 22  | Maltese (Malta)            |
| tr_TR = tr = Turkish           | 17  | 24  | Turkish (Turkey)           |
| hr_HR = hr = Croatian          | 18  | 68  | Croatian (Croatia)         |
| zh_TW = zh-Hant                | 19  | 53  | Chinese (Taiwan)           |
| zh_CN = zh = zh-Hans = Chinese | 33  | 52  | Chinese (China)            |
| ur_PK = ur = Urdu              | 20  | 34  | Urdu (Pakistan)            |
| ur_IN                          | 20  | 96  | Urdu (India)               |
| hi_IN = hi = Hindi             | 21  | 33  | Hindi (India)              |
| th_TH = th = Thai              | 22  | 54  | Thai (Thailand)            |
| ko_KR = ko = Korean            | 23  | 51  | Korean (South Korea)       |
| lt_LT = lt = Lithuanian        | 24  | 41  | Lithuanian (Lithuania)     |
| pl_PL = pl = Polish            | 25  | 42  | Polish (Poland)            |
| hu_HU = hu = Hungarian         | 26  | 43  | Hungarian (Hungary)        |
| et_EE = et = Estonian          | 27  | 44  | Estonian (Estonia)         |
| lv_LV = lv = Latvian           | 28  | 45  | Latvian (Latvia)           |
|         se = Sami              | 29  | 46  | Northern Sami              |
| fo_FO = fo = Faroese           | 30  | 47  | Faroese (Faroe Islands)    |
| fa_IR = fa = Farsi             | 31  | 48  | Persian (Iran)             |
| ru_RU = ru = Russian           | 32  | 49  | Russian (Russia)           |
| ga_IE = ga = Irish             | 35  | 50  | Irish (Ireland)            |
|         sq = Albanian          | 36  | -1  | Albanian                   |
| ro_RO = ro = Romanian          | 37  | 39  | Romanian (Romania)         |
| cs_CZ = cs = Czech             | 38  | 56  | Czech (Czech Republic)     |
| sk_SK = sk = Slovak            | 39  | 57  | Slovak (Slovakia)          |
| sl_SI = sl = Slovenian         | 40  | 66  | Slovenian (Slovenia)       |
|         yi = Yiddish           | 41  | -1  | Yiddish                    |
| sr_CS = sr = Serbian           | 42  | 65  | Serbian (Serbia)           |
| mk_MK = mk = Macedonian        | 43  | 67  | Macedonian (Macedonia)     |
| bg_BG = bg = Bulgarian         | 44  | 72  | Bulgarian (Bulgaria)       |
| uk_UA = uk = Ukrainian         | 45  | 62  | Ukrainian (Ukraine)        |
| be_BY = be = Byelorussian      | 46  | 61  | Belarusian (Belarus)       |
| uz_UZ = uz = Uzbek             | 47  | 99  | Uzbek (Uzbekistan)         |
|         kk = Kazakh            | 48  | -1  | Kazakh                     |
| hy_AM = hy = Armenian          | 51  | 84  | Armenian (Armenia)         |
| ka_GE = ka = Georgian          | 52  | 85  | Georgian (Georgia)         |
|         mo = Moldavian         | 53  | -1  | Moldavian                  |
|         ky = Kirghiz           | 54  | -1  | Kyrgyz                     |
|         tg = Tajiki            | 55  | -1  | Tajik                      |
|         tk = Turkmen           | 56  | -1  | Turkmen                    |
|         mn = Mongolian         | 58  | -1  | Mongolian                  |
|         ps = Pashto            | 59  | -1  | Pashto                     |
|         ku = Kurdish           | 60  | -1  | Kurdish                    |
|         ks = Kashmiri          | 61  | -1  | Kashmiri                   |
|         sd = Sindhi            | 62  | -1  | Sindhi                     |
|         bo = Tibetan           | 63  | 105 | Tibetan                    |
| ne_NP = ne = Nepali            | 64  | 106 | Nepali (Nepal)             |
|         sa = Sanskrit          | 65  | -1  | Sanskrit                   |
| mr_IN = mr = Marathi           | 66  | 104 | Marathi (India)            |
|         bn = Bengali           | 67  | 60  | Bengali                    |
|         as = Assamese          | 68  | -1  | Assamese                   |
| gu_IN = gu = Gujarati          | 69  | 94  | Gujarati (India)           |
|         pa = Punjabi           | 70  | 95  | Punjabi                    |
|         or = Oriya             | 71  | -1  | Oriya                      |
|         ml = Malayalam         | 72  | -1  | Malayalam                  |
|         kn = Kannada           | 73  | -1  | Kannada                    |
|         ta = Tamil             | 74  | -1  | Tamil                      |
|         te = Telugu            | 75  | -1  | Telugu                     |
|         si = Sinhalese         | 76  | -1  | Sinhala                    |
|         my = Burmese           | 77  | -1  | Burmese                    |
|         km = Khmer             | 78  | -1  | Khmer                      |
|         lo = Lao               | 79  | -1  | Lao                        |
| vi_VN = vi = Vietnamese        | 80  | 97  | Vietnamese (Vietnam)       |
|         id = Indonesian        | 81  | -1  | Indonesian                 |
|         tl = Tagalog           | 82  | -1  | Tagalog                    |
|         ms = Malay             | 83  | -1  | Malay                      |
|         am = Amharic           | 85  | -1  | Amharic                    |
|         ti = Tigrinya          | 86  | -1  | Tigrinya                   |
|         om = Oromo             | 87  | -1  | Oromo                      |
|         so = Somali            | 88  | -1  | Somali                     |
|         sw = Swahili           | 89  | -1  | Swahili                    |
|         rw = Kinyarwanda       | 90  | -1  | Kinyarwanda                |
|         rn = Rundi             | 91  | -1  | Rundi                      |
|              Nyanja            | 92  | -1  | Nyanja                     |
|         mg = Malagasy          | 93  | -1  | Malagasy                   |
|         eo = Esperanto         | 94  | 103 | Esperanto                  |
|         cy = Welsh             | 128 | 79  | Welsh                      |
|         eu = Basque            | 129 | -1  | Basque                     |
| ca_ES = ca = Catalan           | 130 | 73  | Catalan (Spain)            |
|         la = Latin             | 131 | -1  | Latin                      |
|         qu = Quechua           | 132 | -1  | Quechua                    |
|         gn = Guarani           | 133 | -1  | Guarani                    |
|         ay = Aymara            | 134 | -1  | Aymara                     |
|         tt = Tatar             | 135 | -1  | Tatar                      |
|         ug = Uighur            | 136 | -1  | Uyghur                     |
| dz_BT = dz = Dzongkha          | 137 | 83  | Dzongkha (Bhutan)          |
|         jv = Javanese          | 138 | -1  | Javanese                   |
|         su = Sundanese         | 139 | -1  | Sundanese                  |
|         gl = Galician          | 140 | -1  | Galician                   |
| af_ZA = af = Afrikaans         | 141 | 102 | Afrikaans (South Africa)   |
|         br = Breton            | 142 | 77  | Breton                     |
| iu_CA = iu = Inuktitut         | 143 | 78  | Inuktitut (Canada)         |
|         gd = Scottish          | 144 | 75  | Scottish Gaelic            |
|         gv = Manx              | 145 | 76  | Manx                       |
| to_TO = to = Tongan            | 147 | 88  | Tongan (Tonga)             |
|         grc                    | 148 | 40  | Ancient Greek              |
|         kl = Greenlandic       | 149 | 107 | Kalaallisut                |
|         az = Azerbaijani       | 150 | -1  | Azerbaijani                |

此处:

  • L# 是语言代码,C# 是国家/地区代码。如果两个标识符共享相同的语言和国家代码,我认为它们是相同的。
  • 我只列出了源文件中出现的字符串。它还可以通过更复杂的 CFLocale 列表识别诸如 zh_HK繁体中文(两者具有与 zh_TW 相同的代码编号)之类的内容。

从 iOS 10.3.1 开始,Apple 实际使用以下 lproj 名称列表:

  • 丹麦语、荷兰语、英语、法语、德语、意大利语、日语、波兰语、葡萄牙语、俄语、西班牙语、瑞典语
  • ar、bo、ca、cs、 da、de、el、en、es、fi、fr、he、hi、hr、hu、id、it、ja、ko、ms、nb、nl、no、pa、pl、pt、ro、ru、sk、 sv, th, tr, uk, ur, vi, chr(注:chr = 切罗基语
  • en_AU、en_CA、en_CN、en_GB、en_ID、en_IN、en_JP、en_MY、en_NZ、en_SG
  • es_419、es_AR、 es_cl,es_co,es_cr,es_gt,es_mx,es_pa,es_pe,es_us
  • ar_sa,da_dk,de_at,de_at,de_t,de_ch,fi_fi,fi_be,fr_ca,fr_ca,fr_ca,fr_ch,fr_ch,he_il,he_il,he_il,iT_CH,s_my,ms_my,nb_no,nb_no,nb_no,nl_be,nl_be,nl_be,rur,rur,rur,p.rr,p.rr,ptr,ptr,ptr,ptr,ptr,ptr,ptr,ptr,ptr,ptr,pt, , th_TH, tr_TR, yue_CN, zh_CN, zh_HK, zh_TW

You can just call them English.lproj, Spanish.lproj, etc.

The "abbreviated names" are actually IETF language tags (i.e. BCP 47), except that you use pt_PT.lproj instead of pt-PT.lproj.


The actual interpretation routine is in https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/PlugIn.subproj/CFBundle_Locale.c, determined by the CFBundleGetLocalizationInfoForLocalization function. Replicated here:

| lproj identifiers              | L#  | C#  | Display name               |
|:-------------------------------|:----|:----|:---------------------------|
| en_US = en = English           | 0   | 0   | English (United States)    |
| en_GB                          | 0   | 2   | English (United Kingdom)   |
| en_AU                          | 0   | 15  | English (Australia)        |
| en_CA                          | 0   | 82  | English (Canada)           |
| en_SG                          | 0   | 100 | English (Singapore)        |
| en_IE                          | 0   | 108 | English (Ireland)          |
| fr_FR = fr = French            | 1   | 1   | French (France)            |
| fr_CA                          | 1   | 11  | French (Canada)            |
| fr_CH                          | 1   | 18  | French (Switzerland)       |
| fr_BE                          | 1   | 98  | French (Belgium)           |
| de_DE = de = German            | 2   | 3   | German (Germany)           |
| de_CH                          | 2   | 19  | German (Switzerland)       |
| de_AT                          | 2   | 92  | German (Austria)           |
| it_IT = it = Italian           | 3   | 4   | Italian (Italy)            |
| it_CH                          | 3   | 36  | Italian (Switzerland)      |
| nl_NL = nl = Dutch             | 4   | 5   | Dutch (Netherlands)        |
| nl_BE                          | 34  | 6   | Dutch (Belgium)            |    
| sv_SE = sv = Swedish           | 5   | 7   | Swedish (Sweden)           |
| es_ES = es = Spanish           | 6   | 8   | Spanish (Spain)            |
| es_XL                          | 6   | 86  | Spanish (Latin America)    |
| da_DK = da = Danish            | 7   | 9   | Danish (Denmark)           |
| pt_BR = pt = Portuguese        | 8   | 71  | Portuguese (Brazil)        |
| pt_PT                          | 8   | 10  | Portuguese (Portugal)      |
| nb_NO = nb = no = Norwegian    | 9   | 12  | Norwegian Bokmål (Norway)  |
| nn_NO = nn = Nynorsk           | 151 | 101 | Norwegian Nynorsk (Norway) |
| he_IL = he = Hebrew            | 10  | 13  | Hebrew (Israel)            |
| ja_JP = ja = Japanese          | 11  | 14  | Japanese (Japan)           |
|         ar = Arabic            | 12  | 16  | Arabic                     |
| fi_FI = fi = Finnish           | 13  | 17  | Finnish (Finland)          |
| el_GR = el = Greek             | 14  | 20  | Greek (Greece)             |
| el_CY                          | 14  | 23  | Greek (Cyprus)             |
| is_IS = is = Icelandic         | 15  | 21  | Icelandic (Iceland)        |
| mt_MT = mt = Maltese           | 16  | 22  | Maltese (Malta)            |
| tr_TR = tr = Turkish           | 17  | 24  | Turkish (Turkey)           |
| hr_HR = hr = Croatian          | 18  | 68  | Croatian (Croatia)         |
| zh_TW = zh-Hant                | 19  | 53  | Chinese (Taiwan)           |
| zh_CN = zh = zh-Hans = Chinese | 33  | 52  | Chinese (China)            |
| ur_PK = ur = Urdu              | 20  | 34  | Urdu (Pakistan)            |
| ur_IN                          | 20  | 96  | Urdu (India)               |
| hi_IN = hi = Hindi             | 21  | 33  | Hindi (India)              |
| th_TH = th = Thai              | 22  | 54  | Thai (Thailand)            |
| ko_KR = ko = Korean            | 23  | 51  | Korean (South Korea)       |
| lt_LT = lt = Lithuanian        | 24  | 41  | Lithuanian (Lithuania)     |
| pl_PL = pl = Polish            | 25  | 42  | Polish (Poland)            |
| hu_HU = hu = Hungarian         | 26  | 43  | Hungarian (Hungary)        |
| et_EE = et = Estonian          | 27  | 44  | Estonian (Estonia)         |
| lv_LV = lv = Latvian           | 28  | 45  | Latvian (Latvia)           |
|         se = Sami              | 29  | 46  | Northern Sami              |
| fo_FO = fo = Faroese           | 30  | 47  | Faroese (Faroe Islands)    |
| fa_IR = fa = Farsi             | 31  | 48  | Persian (Iran)             |
| ru_RU = ru = Russian           | 32  | 49  | Russian (Russia)           |
| ga_IE = ga = Irish             | 35  | 50  | Irish (Ireland)            |
|         sq = Albanian          | 36  | -1  | Albanian                   |
| ro_RO = ro = Romanian          | 37  | 39  | Romanian (Romania)         |
| cs_CZ = cs = Czech             | 38  | 56  | Czech (Czech Republic)     |
| sk_SK = sk = Slovak            | 39  | 57  | Slovak (Slovakia)          |
| sl_SI = sl = Slovenian         | 40  | 66  | Slovenian (Slovenia)       |
|         yi = Yiddish           | 41  | -1  | Yiddish                    |
| sr_CS = sr = Serbian           | 42  | 65  | Serbian (Serbia)           |
| mk_MK = mk = Macedonian        | 43  | 67  | Macedonian (Macedonia)     |
| bg_BG = bg = Bulgarian         | 44  | 72  | Bulgarian (Bulgaria)       |
| uk_UA = uk = Ukrainian         | 45  | 62  | Ukrainian (Ukraine)        |
| be_BY = be = Byelorussian      | 46  | 61  | Belarusian (Belarus)       |
| uz_UZ = uz = Uzbek             | 47  | 99  | Uzbek (Uzbekistan)         |
|         kk = Kazakh            | 48  | -1  | Kazakh                     |
| hy_AM = hy = Armenian          | 51  | 84  | Armenian (Armenia)         |
| ka_GE = ka = Georgian          | 52  | 85  | Georgian (Georgia)         |
|         mo = Moldavian         | 53  | -1  | Moldavian                  |
|         ky = Kirghiz           | 54  | -1  | Kyrgyz                     |
|         tg = Tajiki            | 55  | -1  | Tajik                      |
|         tk = Turkmen           | 56  | -1  | Turkmen                    |
|         mn = Mongolian         | 58  | -1  | Mongolian                  |
|         ps = Pashto            | 59  | -1  | Pashto                     |
|         ku = Kurdish           | 60  | -1  | Kurdish                    |
|         ks = Kashmiri          | 61  | -1  | Kashmiri                   |
|         sd = Sindhi            | 62  | -1  | Sindhi                     |
|         bo = Tibetan           | 63  | 105 | Tibetan                    |
| ne_NP = ne = Nepali            | 64  | 106 | Nepali (Nepal)             |
|         sa = Sanskrit          | 65  | -1  | Sanskrit                   |
| mr_IN = mr = Marathi           | 66  | 104 | Marathi (India)            |
|         bn = Bengali           | 67  | 60  | Bengali                    |
|         as = Assamese          | 68  | -1  | Assamese                   |
| gu_IN = gu = Gujarati          | 69  | 94  | Gujarati (India)           |
|         pa = Punjabi           | 70  | 95  | Punjabi                    |
|         or = Oriya             | 71  | -1  | Oriya                      |
|         ml = Malayalam         | 72  | -1  | Malayalam                  |
|         kn = Kannada           | 73  | -1  | Kannada                    |
|         ta = Tamil             | 74  | -1  | Tamil                      |
|         te = Telugu            | 75  | -1  | Telugu                     |
|         si = Sinhalese         | 76  | -1  | Sinhala                    |
|         my = Burmese           | 77  | -1  | Burmese                    |
|         km = Khmer             | 78  | -1  | Khmer                      |
|         lo = Lao               | 79  | -1  | Lao                        |
| vi_VN = vi = Vietnamese        | 80  | 97  | Vietnamese (Vietnam)       |
|         id = Indonesian        | 81  | -1  | Indonesian                 |
|         tl = Tagalog           | 82  | -1  | Tagalog                    |
|         ms = Malay             | 83  | -1  | Malay                      |
|         am = Amharic           | 85  | -1  | Amharic                    |
|         ti = Tigrinya          | 86  | -1  | Tigrinya                   |
|         om = Oromo             | 87  | -1  | Oromo                      |
|         so = Somali            | 88  | -1  | Somali                     |
|         sw = Swahili           | 89  | -1  | Swahili                    |
|         rw = Kinyarwanda       | 90  | -1  | Kinyarwanda                |
|         rn = Rundi             | 91  | -1  | Rundi                      |
|              Nyanja            | 92  | -1  | Nyanja                     |
|         mg = Malagasy          | 93  | -1  | Malagasy                   |
|         eo = Esperanto         | 94  | 103 | Esperanto                  |
|         cy = Welsh             | 128 | 79  | Welsh                      |
|         eu = Basque            | 129 | -1  | Basque                     |
| ca_ES = ca = Catalan           | 130 | 73  | Catalan (Spain)            |
|         la = Latin             | 131 | -1  | Latin                      |
|         qu = Quechua           | 132 | -1  | Quechua                    |
|         gn = Guarani           | 133 | -1  | Guarani                    |
|         ay = Aymara            | 134 | -1  | Aymara                     |
|         tt = Tatar             | 135 | -1  | Tatar                      |
|         ug = Uighur            | 136 | -1  | Uyghur                     |
| dz_BT = dz = Dzongkha          | 137 | 83  | Dzongkha (Bhutan)          |
|         jv = Javanese          | 138 | -1  | Javanese                   |
|         su = Sundanese         | 139 | -1  | Sundanese                  |
|         gl = Galician          | 140 | -1  | Galician                   |
| af_ZA = af = Afrikaans         | 141 | 102 | Afrikaans (South Africa)   |
|         br = Breton            | 142 | 77  | Breton                     |
| iu_CA = iu = Inuktitut         | 143 | 78  | Inuktitut (Canada)         |
|         gd = Scottish          | 144 | 75  | Scottish Gaelic            |
|         gv = Manx              | 145 | 76  | Manx                       |
| to_TO = to = Tongan            | 147 | 88  | Tongan (Tonga)             |
|         grc                    | 148 | 40  | Ancient Greek              |
|         kl = Greenlandic       | 149 | 107 | Kalaallisut                |
|         az = Azerbaijani       | 150 | -1  | Azerbaijani                |

Here:

  • L# is the language code and C# is the country code. I consider two identifier identical if they share the same language and country code.
  • I have only listed strings appearing the source file. It also recognizes something like zh_HK and Traditional Chinese (both have same code number as zh_TW), probably through the more sophisticated CFLocale list.

As of iOS 10.3.1, the following list of lproj names are actually used by Apple:

  • Danish, Dutch, English, French, German, Italian, Japanese, Polish, Portuguese, Russian, Spanish, Swedish
  • ar, bo, ca, cs, da, de, el, en, es, fi, fr, he, hi, hr, hu, id, it, ja, ko, ms, nb, nl, no, pa, pl, pt, ro, ru, sk, sv, th, tr, uk, ur, vi, chr (Note: chr = Cherokee)
  • en_AU, en_CA, en_CN, en_GB, en_ID, en_IN, en_JP, en_MY, en_NZ, en_SG
  • es_419, es_AR, es_CL, es_CO, es_CR, es_GT, es_MX, es_PA, es_PE, es_US
  • ar_SA, da_DK, de_AT, de_CH, fi_FI, fr_BE, fr_CA, fr_CH, he_IL, it_CH, ms_MY, nb_NO, nl_BE, nl_NL, pt_BR, pt_PT, ru_RU, sv_SE, th_TH, tr_TR, yue_CN, zh_CN, zh_HK, zh_TW
ヤ经典坏疍 2024-09-12 06:20:11

不久,您应该在大多数情况下使用两个字母代码,如 BCP 47 代码

更长,如 Apple 官方文档 你应该使用 BCP 47代码

现在的经验法则是使用尽可能短且有意义的代码。您应该使用它,因为这可以最大限度地覆盖类似区域设置。

例如,如果您本地化为俄语,则应仅使用 ru 代码,而不是 ru-RU 等替代代码。这很重要,因为如果您使用短代码,来自其他讲俄语的国家/地区的用户将看到您的俄语应用程序。否则,您将仅对来自俄罗斯的使用俄语的用户显示俄语。

如果您想了解有关语言代码的更多信息,包括最常用语言的推荐代码,您应该阅读我一年多前写的一篇短文 http://blog.i18n.ro/simplified-locale-codes/ - 请记住,关于葡萄牙语有一些技巧中文,但对于其他语言,您可以使用下面的列表。

阿拉伯语 (ar)、捷克语 (cs)、丹麦语 (da)、德语 (de)、希腊语 (el)、芬兰语 (fi)、希伯来语 (he)、匈牙利语 (hu)、意大利语 (it)、日语 ( ja)、韩语 (ko)、挪威语 (nb)、荷兰语 (nl)、波兰语 (pl)、罗马尼亚语 (ro)、俄语 (ru)、瑞典语 (sv)、土耳其语 (tr)、乌克兰语 (uk)。

Shortly, you should use two letters codes for most cases, as specified by BCP 47 codes.

Longer, as specified by official Apple documentation you are supposed to use BCP 47 codes.

Now the rule of thumb is to use the shortest code possible that makes sense. You should use this because this maximizes the coverage for similar locales.

For example, if you localize in Russian, you should use only ru code, instead of alternatives like ru-RU. This is important because if you use the short code, the users from other countries that are speaking Russian will see your application in Russian. Otherwise you will display Russian only for people using Russian language from Russia.

If you want to know more information about language codes including recommended codes for most used languages, you should to read a short article I wrote more than a year ago http://blog.i18n.ro/simplified-locale-codes/ - Remember that there are some tricks regarding Portuguese and Chinese but for other languages you can use the list below.

Arabic (ar), Czech (cs), Danish (da), German (de), Greek (el), Finnish (fi), Hebrew (he), Hungarian (hu), Italian (it), Japanese (ja), Korean (ko), Norwegian (nb), Dutch (nl), Polish (pl), Romanian (ro), Russian (ru), Swedish (sv), Turkish (tr), Ukrainian (uk).

枕头说它不想醒 2024-09-12 06:20:11

德语是de,西班牙语是es。这些代码的一般格式是
语言代码_国家代码
或者
languageCode(指定语言而非国家/地区时用作默认值)。

因此,您可以执行以下操作:en(通用英语)、en_GB(英语,但来自英国)、fr_FR(法语,来自法国)、和 fr_CH(瑞士法语)。

语言代码是 ISO 639-1 标准的一部分,国家/地区代码来自 ISO 3166 标准

German is de, Spanish is es. The general format for these codes is
languageCode_CountryCode
or
languageCode (used as the default for when a language is specified, but not a country).

So you can do things like en (generic english), en_GB (english, but from the UK), fr_FR (French from France), and fr_CH (swiss french).

Language codes are part of the ISO 639-1 standard, and country codes are from the ISO 3166 standard.

删除会话 2024-09-12 06:20:11

这个问题已经得到解答,但我认为多个来源让这个问题变得更加混乱。事实上,iOS 有 30 种语言,它将被识别为 .lproj 文件夹。它不接受任何区域代码,因此告诉它 fr-CA 不会为您提供法语加拿大语,而只会使用您的英语字符串。您需要使用该语言的两个字母代码(en.lproj、fr.lproj、es.lproj、de.lproj 等)。此规则的唯一例外是中文,简体中文应为 zh_Hans,繁体中文应为 zh_Hant。

更令人困惑的是,iTunes 应用商店有一组不同的语言,它可以理解,并且它确实可以识别许多区域版本,例如澳大利亚英语和巴西葡萄牙语。

这里有 iOS 和 iTunes 当前支持的语言和语言代码的完整(和更新)列表:

This question has been answered but I think made more confusing by the multiple sources. The fact is that iOS has 30 languages that it will recognize as .lproj folders. It won't accept any regional codes, so telling it fr-CA won't get you French Canadian, but rather will simply use your English strings. You need to use the two-letter code for the language (en.lproj, fr.lproj, es.lproj, de.lproj, and so on). The only exception to this rule is Chinese, which should be zh_Hans for Simplified Chinese and zh_Hant for Traditional Chinese.

What makes this even more confusing is that the iTunes App Store has a different set of languages that it understands, and it does recognize many regional versions like Australian English and Brazilian Portuguese.

There is a complete (and updated) list of the current supported languages and language codes for both iOS and iTunes here:

http://www.ibabbleon.com/iOS-Language-Codes-ISO-639.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文