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

LanguageISO-639 Code
Afrikaansaf
Albaniansq
Amharicam
Arabicar
Armenianhy
Assameseas
Aymaraay
Azerbaijaniaz
Bambarabm
Basqueeu
Belarusianbe
Bengalibn
Bhojpuribho
Bosnianbs
Bulgarianbg
Catalanca
Cebuanoceb
Chinese (Simplified)zh-CN or zh
Chinese (Traditional)zh-TW
Corsicanco
Croatianhr
Czechcs
Danishda
Dhivehidv
Dogridoi
Dutchnl
Englishen
Esperantoeo
Estonianet
Eweee
Filipino (Tagalog)fil
Finnishfi
Frenchfr
Frisianfy
Galiciangl
Georgianka
Germande
Greekel
Guaranign
Gujaratigu
Haitian Creoleht
Hausaha
Hawaiianhaw
Hebrewhe
Hindihi
Hmonghmn
Hungarianhu
Icelandicis
Igboig
Ilocanoilo
Indonesianid
Irishga
Italianit
Japaneseja
Javanesejv
Kannadakn
Kazakhkk
Khmerkm
Kinyarwandarw
Koreanko
Kriokri
Kurdishku
Kurdish (Sorani)ckb
Kyrgyzky
Laolo
Latinla
Latvianlv
Lingalaln
Lithuanianlt
Lugandalg
Luxembourgishlb
Macedonianmk
Maithilimai
Malagasymg
Malayms
Malayalamml
Maltesemt
Maorimi
Marathimr
Meiteilon (Manipuri)mni-Mtei
Mizolus
Mongolianmn
Myanmar (Burmese)my
Nepaline
Norwegianno
Nyanja (Chichewa)ny
Odia (Oriya)or
Oromoom
Pashtops
Persianfa
Polishpl
Portuguese (Portugal, Brazil)pt
Punjabipa
Quechuaqu
Romanianro
Russianru
Samoansm
Sanskritsa
Scots Gaelicgd
Sepedinso
Serbiansr
Sesothost
Shonasn
Sindhisd
Sinhala (Sinhalese)si
Slovaksk
Sloveniansl
Somaliso
Spanishes
Sundanesesu
Swahilisw
Swedishsv
Tagalog (Filipino)tl
Tajiktg
Tamilta
Tatartt
Telugute
Thaith
Tigrinyati
Tsongats
Turkishtr
Turkmentk
Twi (Akan)ak
Ukrainianuk
Urduur
Uyghurug
Uzbekuz
Vietnamesevi
Welshcy
Xhosaxh
Yiddishyi
Yorubayo
Zuluzu