Language Support
AutoLocalise supports a wide range of languages for translation. This page provides information about the supported languages and how to use language codes in your projects.
Using Language Codes
When using AutoLocalise SDKs, you'll need to specify language codes for your translations. Here are examples of how to use language codes:
<TranslationProvider
config={
apiKey: "your-api-key",
sourceLocale: "fr",
targetLocale: "en"
}
>
<YourApp />
</TranslationProvider>
Language Code Standards
AutoLocalise uses ISO-639 language codes (e.g., 'en' for English, 'fr' for French). For some languages, region-specific codes may be used (e.g., 'en-US' for American English, 'en-GB' for British English).
How to get the language code
React
In React web applications, you can get the user's preferred locale from the browser:
// Get the primary locale
const browserLocale = navigator.language; // e.g., 'en-US'
// Get all preferred locales
const preferredLocales = navigator.languages; // e.g., ['en-US', 'en']
// Extract just the language code if needed
const languageCode = browserLocale.split("-")[0]; // e.g., 'en'
React Native
In React Native, you can get the device locale using the Localization API:
import * as Localization from "react-native-localization";
// or
import { NativeModules, Platform } from "react-native";
// Using react-native-localization
const deviceLocale = Localization.locale; // e.g., 'en-US'
// Alternative method using native modules
const deviceLanguage =
Platform.OS === "ios"
? NativeModules.SettingsManager.settings.AppleLocale ||
NativeModules.SettingsManager.settings.AppleLanguages[0]
: NativeModules.I18nManager.localeIdentifier;
React Native Expo
In Expo, you can use the Localization API from expo-localization:
import * as Localization from "expo-localization";
// Get the device locale
const locale = Localization.getLocales()[0]?.languageCode;
Supported Languages
Language | ISO-639 Code |
---|---|
Afrikaans | af |
Albanian | sq |
Amharic | am |
Arabic | ar |
Armenian | hy |
Assamese | as |
Aymara | ay |
Azerbaijani | az |
Bambara | bm |
Basque | eu |
Belarusian | be |
Bengali | bn |
Bhojpuri | bho |
Bosnian | bs |
Bulgarian | bg |
Catalan | ca |
Cebuano | ceb |
Chinese (Simplified) | zh-CN or zh |
Chinese (Traditional) | zh-TW |
Corsican | co |
Croatian | hr |
Czech | cs |
Danish | da |
Dhivehi | dv |
Dogri | doi |
Dutch | nl |
English | en |
Esperanto | eo |
Estonian | et |
Ewe | ee |
Filipino (Tagalog) | fil |
Finnish | fi |
French | fr |
Frisian | fy |
Galician | gl |
Georgian | ka |
German | de |
Greek | el |
Guarani | gn |
Gujarati | gu |
Haitian Creole | ht |
Hausa | ha |
Hawaiian | haw |
Hebrew | he |
Hindi | hi |
Hmong | hmn |
Hungarian | hu |
Icelandic | is |
Igbo | ig |
Ilocano | ilo |
Indonesian | id |
Irish | ga |
Italian | it |
Japanese | ja |
Javanese | jv |
Kannada | kn |
Kazakh | kk |
Khmer | km |
Kinyarwanda | rw |
Korean | ko |
Krio | kri |
Kurdish | ku |
Kurdish (Sorani) | ckb |
Kyrgyz | ky |
Lao | lo |
Latin | la |
Latvian | lv |
Lingala | ln |
Lithuanian | lt |
Luganda | lg |
Luxembourgish | lb |
Macedonian | mk |
Maithili | mai |
Malagasy | mg |
Malay | ms |
Malayalam | ml |
Maltese | mt |
Maori | mi |
Marathi | mr |
Meiteilon (Manipuri) | mni-Mtei |
Mizo | lus |
Mongolian | mn |
Myanmar (Burmese) | my |
Nepali | ne |
Norwegian | no |
Nyanja (Chichewa) | ny |
Odia (Oriya) | or |
Oromo | om |
Pashto | ps |
Persian | fa |
Polish | pl |
Portuguese (Portugal, Brazil) | pt |
Punjabi | pa |
Quechua | qu |
Romanian | ro |
Russian | ru |
Samoan | sm |
Sanskrit | sa |
Scots Gaelic | gd |
Sepedi | nso |
Serbian | sr |
Sesotho | st |
Shona | sn |
Sindhi | sd |
Sinhala (Sinhalese) | si |
Slovak | sk |
Slovenian | sl |
Somali | so |
Spanish | es |
Sundanese | su |
Swahili | sw |
Swedish | sv |
Tagalog (Filipino) | tl |
Tajik | tg |
Tamil | ta |
Tatar | tt |
Telugu | te |
Thai | th |
Tigrinya | ti |
Tsonga | ts |
Turkish | tr |
Turkmen | tk |
Twi (Akan) | ak |
Ukrainian | uk |
Urdu | ur |
Uyghur | ug |
Uzbek | uz |
Vietnamese | vi |
Welsh | cy |
Xhosa | xh |
Yiddish | yi |
Yoruba | yo |
Zulu | zu |