FbDevWiki is for sale on Flippa. Please take a look at the page if you're interested. There's only a few days left to the auction!

Locales

From Facebook Developer Wiki (FbDevWiki.com)
Jump to: navigation, search

Instead of using the ISO 639 language codes employed across the internet, Facebook has devised their own system of labeling languages. Some are the same as the ISO standard, but others are not. There also seems to be support lacking for Accept-Language: HTTP request headers.

Each code is made up of two parts as follows:

[language]_[region]

Contents

Getting the User's Locale

If your application runs through the canvas (iframe or FBML), your application will receive a signed_request on each page load. Regardless of whether the user has signed in or not, you will receive user locale information. In the same JSON encoded object you will also receive the 2 letter country code based on the user's IP address (not what they've entered in their profile).

Example retrieving locale via the PHP SDK:

// assumes $facebook is already created and initialized earlier

$signed_request = $facebook->getSignedRequest();

$locale = $signed_request['user']['locale'];
$country = $signed_request['user']['country'];

// get age range of current user
$age_min = isset($signed_request['user']['age']) && isset($signed_request['user']['age']['min']) ? $signed_request['user']['age']['min'] : 0;
$age_max = isset($signed_request['user']['age']) && isset($signed_request['user']['age']['max']) ? $signed_request['user']['age']['max'] : 199; 

Complete List (as of 2012-06-10)

The list is in the same order that it appears on Facebook when you click the language link at the bottom of the page.

The "Publish Code" is taken from locale csv file provided by Facebook and is used when targeting posts to a pages wall via the "targeting" variable. As you can see, there are some languages that people can select that can't be targeted yet by page posts.

Code Language Language (in English) Status Publish Code
af_ZA Afrikaans Afrikaans 36
gn_PY Avañe'ẽ Guaraní
ay_BO Aymar aru Aymara
az_AZ Azərbaycan dili Azeri beta
id_ID Bahasa Indonesia Indonesian 25
ms_MY Bahasa Melayu Malay 41
jv_ID Basa Jawa Javanese
bs_BA Bosanski Bosnian beta
ca_ES Català Catalan 1
cs_CZ Čeština Czech 2
ck_US Cherokee Cherokee
cy_GB Cymraeg Welsh 3
da_DK Dansk Danish 4
se_NO Davvisámegiella Northern Sámi
de_DE Deutsch German 5
et_EE Eesti Estonian beta
en_IN English (India) English (India)
en_PI English (Pirate) English (Pirate) beta
en_GB English (UK) English (UK) 24
en_UD English (Upside Down) English (Upside Down) 51
en_US English (US) English (US) 6
es_LA Español Spanish 23
es_CL Español (Chile) Spanish (Chile)
es_CO Español (Colombia) Spanish (Colombia)
es_ES Español (España) Spanish (Spain) 7
es_MX Español (México) Spanish (Mexico)
es_VE Español (Venezuela) Spanish (Venezuela)
eo_EO Esperanto Esperanto beta
eu_ES Euskara Basque beta
tl_PH Filipino Filipino 26
fo_FO Føroyskt Faroese beta
fr_FR Français (France) French (France) 9
fr_CA Français (Canada) French (Canada) 44
fy_NL Frysk Frisian beta
ga_IE Gaeilge Irish beta
gl_ES Galego Galician beta
ko_KR 한국어 Korean 12
hr_HR Hrvatski Croatian 38
xh_ZA isiXhosa Xhosa
zu_ZA isiZulu Zulu
is_IS Íslenska Icelandic beta
it_IT Italiano Italian 10
ka_GE ქართული Georgian beta
sw_KE Kiswahili Swahili beta
tl_ST tlhIngan-Hol Klingon
ku_TR Kurdî Kurdish beta
lv_LV Latviešu Latvian beta
fb_LT Leet Speak Leet Speak beta
lt_LT Lietuvių Lithuanian 40
li_NL Lèmbörgs Limburgish
la_VA lingua latina Latin beta
hu_HU Magyar Hungarian 30
mg_MG Malagasy Malagasy
mt_MT Malti Maltese
nl_NL Nederlands Dutch 14
nl_BE Nederlands (België) Dutch (België)
ja_JP 日本語 Japanese 11
nb_NO Norsk (bokmål) Norwegian (bokmal) 13
nn_NO Norsk (nynorsk) Norwegian (nynorsk) beta
uz_UZ O'zbek Uzbek
pl_PL Polski Polish 15
pt_BR Português (Brasil) Portuguese (Brazil) 16
pt_PT Português (Portugal) Portuguese (Portugal) 31
qu_PE Qhichwa Quechua
ro_RO Română Romanian 32
rm_CH Rumantsch Romansh
ru_RU Русский Russian 17
sq_AL Shqip Albanian beta
sk_SK Slovenčina Slovak 33
sl_SI Slovenščina Slovenian 34
so_SO Soomaaliga Somali
fi_FI Suomi Finnish 8
sv_SE Svenska Swedish 18
th_TH ภาษาไทย Thai 35
vi_VN Tiếng Việt Vietnamese 27
tr_TR Türkçe Turkish 19
zh_CN 中文(简体) Simplified Chinese (China) 20
zh_TW 中文(台灣) Traditional Chinese (Taiwan) 22
zh_HK 中文(香港) Traditional Chinese (Hong Kong) 21
el_GR Ελληνικά Greek 39
gx_GR Ἑλληνική ἀρχαία Classical Greek
be_BY Беларуская Belarusian beta
bg_BG Български Bulgarian 37
kk_KZ Қазақша Kazakh
mk_MK Македонски Macedonian beta
mn_MN Монгол Mongolian
sr_RS Српски Serbian 42
tt_RU татарча / Tatarça / تاتارچا Tatar
tg_TJ тоҷикӣ, تاجیکی‎, tojikī Tajik
uk_UA Українська Ukrainian beta
hy_AM Հայերեն Armenian beta
yi_DE ייִדיש Yiddish
he_IL ‏עברית‏ Hebrew 29
ur_PK اردو Urdu
ar_AR العربية Arabic 28
ps_AF پښتو Pashto beta
fa_IR فارسی Persian beta
sy_SY ‏ܐܪܡܝܐ‏ Syriac
ne_NP नेपाली Nepali beta
mr_IN मराठी Marathi
sa_IN संस्कृतम् Sanskrit
hi_IN हिन्दी Hindi 46
bn_IN বাংলা Bengali 45
pa_IN ਪੰਜਾਬੀ Punjabi 47
gu_IN ગુજરાતી Gujarati
ta_IN தமிழ் Tamil 48
te_IN తెలుగు Telugu 49
kn_IN ಕನ್ನಡ Kannada
ml_IN മലയാളം Malayalam 50
km_KH ភាសាខ្មែរ Khmer

Useless, Dead, Nearly-Dead, or Not Used Languages

These are languages you can probably not bother with...

  • en_PI - English (Pirate) [beta]
  • en_UD - English (Upside Down)
  • eo_EO - Esperanto (Esperanto [beta])
  • fb_LT - Leet Speak (Leet Speak [beta])
  • la_VA - lingua latina (Latin [beta])
  • be_BY - Беларуская (Belarusian [beta])
  • tl_ST - tlhIngan-Hol (Klingon)
  • gx_GR - Ἑλληνική ἀρχαία (Classical Greek)


Languages and Codes Previously Proposed

Here is a list of codes that were proposed to be used and seem to have partially existing support. None of these languages can be selected by Facebook users as their default language/locale. None of these languages appear in the "Translation App" to allow users to translate applications into other languages.

This list was taken from a page on Wing's FAQ which apparently was originally taken from the official Facebook Developer Wiki. The list can also be found at http://www.facebook.com/translations/FacebookLocales.xml .

The last column is if the https://connect.facebook.net/xx_XX/all.js JavaScript file exists where xx_XX is the language code given.

These locale codes also appear to work for the different Social Widgets.

Code Language Language (in English) JavaScript Exists Possible Replacement
fb_FI Finnish (test) no fi_FI
Personal tools
Namespaces
Variants
Actions
Navigation
Graph API
FQL
Toolbox