language_code
Get the current language code and Locale of the device. Also includes almost the language codes with English names and native names.
0.7.1
6.2K downloads/mo
#3541 most downloaded on pub.dev
lamnhan066/language_code
What this package is like to depend on
Last release 3 months ago
25 May 2026
Release timing varies
gaps range from 1 weeks to 11 months
Nearly every release is documented
notes for 20 of 20 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
27 releases · first in 2023
7 releases in the last 12 months
see the full history below
Release timeline
27 releases · Jan 2023 to May 2026Releases
latest 27-
0.7.125 May 2026Release notes
Open source →- Add support for additional language codes including Spanish (Latin America) and Punjabi (India).
- Add
StoreCodeandStoreSupportedCodesfor enhanced store language support. - Update docs.
-
0.7.014 May 2026Release notes
Open source →- Add
resolveFromLocaleandtryResolveFromLocalemethods for flexible LanguageCodes retrieval from Locale. - [BREAKING CHANGE]: Update
LanguageCode.codeto useresolveFromLocale. - Add tests.
- Update docs.
- Add
-
0.6.007 Mar 2026Release notes
Open source →- Add Croatian language codes.
- Update docs.
- Add a weekly crawler to update the database.
- Release to stable.
-
0.6.0-rc.502 Dec 2025 pre-releaseRelease notes
Open source →- Update the crawler for the
namebreaking change. - Use
englishNamefornativeNameif there is no native names.
- Update the crawler for the
-
0.6.0-rc.402 Nov 2025 pre-release -
0.6.0-rc.302 Nov 2025 pre-releaseRelease notes
Open source →- [BREAKING CHANGE] The
LanguageCodes.nameis now return enum's name (default behavior of enum). - [BREAKING CHANGE] Bump dart sdk to >= 3.9.0 and flutter to ^3.35.0.
- Add more tests.
- [BREAKING CHANGE] The
-
0.6.0-rc.201 Sep 2025 pre-releaseRelease notes
Open source →- Add
nativeLatinNameandnativeNonLatinNametoLanguageCodes. All the old codes will use the inheritlatinNameandnonLatinNamefrom it main code. Example:aa_DJwill use thelatinNameandnonLatinNamefromaa. - Update the
nativeNameto use the first parsed name (instead of preferred non-latin name). - Improve the parser.
- Add
-
0.6.0-rc.126 Aug 2025 pre-releaseRelease notes
Open source →- Improve the
LanguageCode.rawLocalemethod to be able to test. - Improve tests.
- Improve README.
- Improve the
-
0.6.0-rc26 Aug 2025 pre-releaseRelease notes
Open source →Added
-
New crawler script to fetch ISO 639-1 and ISO 639-2 codes from Wikipedia.
- Extracts 2-letter and 3-letter codes.
- Includes English names and native names in
non-Latin (Latin)format when available. - Generates
enum LanguageCodeswith all codes. - Adds the missing codes from the older version.
-
LanguageCode.tryCode()- Retrieves the device language as
LanguageCodeswith an optionaldefaultCode. - Fallback order:
- Full
rawLocale. rawLocale.languageCode.- Returns
defaultCode(default:LanguageCodes.und).
- Full
- Retrieves the device language as
Deprecated
LanguageCode.rawCode→ userawLocale.toString()instead.
-
-
0.5.501 Oct 2024Release notes
Open source →- Update
kulocale native name (thanks @msonntag13). - Add
ckb,kmr,lki,prs&sdhlocale entries (thanks @msonntag13).
- Update
-
0.5.420 Sep 2024Release notes
Open source →- Return
en_USlocale if the device's locale is the standard C locale (CorPOSIX).
- Return
-
0.5.316 Apr 2024Release notes
Open source →- Able to set test by Locale.
- Remove the version of Flutter environment.
- Improve tests for Locale.
- Improve tests for unavailable language.
-
0.5.3+117 Apr 2024 -
0.5.3+217 Apr 2024 -
0.5.215 Apr 2024Release notes
Open source →- Better to handle the way to get the [LanguageCode.code] to make it more compatible with the older major version.
- Improve comments.
- Mark
LanguageCode.rawCodeas deprecated, useLanguageCode.rawLocale.toString()instead.
-
0.5.104 Apr 2024 -
0.5.004 Apr 2024Release notes
Open source →- Add multiple language codes and country codes. Also add common ISO 639-3 language codes and country codes (851 in total).
- BREAKING CHANGE: Remove
englishNamesandnativeNamesto reduce the complexity. We only haveenglishNameandnativeNamefrom now. - BREAKING CHANGE: Method
fromEnglishNameandfromNativeNamereturn asIterablefrom this version. - Add
LanguageCode.rawLocaleto get the raw locale of the device.
-
0.4.227 Mar 2024 -
0.4.126 Feb 2024Release notes
Open source →- Add
Filipino(Thanks @Ushie). - Add
:tonativeNameparameter in comments.
- Add
-
0.4.009 Jan 2024Release notes
Open source →- Modify the
englishNameandnativeNameto reduce the complexity:- zh("zh", "Chinese", "中文 (Zhōngwén)|汉语|漢語") -> zh("zh", "Chinese", "中文|Zhōngwén")
- nl("nl", "Dutch", "Nederlands, Vlaams") -> nl("nl", "Dutch", "Nederlands")
- el("el", "Greek|Modern", "Ελληνικά") -> el("el", "Greek", "Ελληνικά")
- he("he", "Hebrew (modern)", "עברית") -> he("he", "Hebrew", "עברית")
- ja("ja", "Japanese", "日本語 (にほんご/にっぽんご)") -> ja("ja", "Japanese", "日本語|にほんご|にっぽんご")
- ko("ko", "Korean", "한국어 (韓國語)|조선말 (朝鮮語)") -> ko("ko", "Korean", "한국어|韓國語|조선말|朝鮮語|")
- mr("mr", "Marathi (Marāṭhī)", "मराठी") -> mr("mr", "Marathi", "मराठी|Marāṭhī")
- ro("ro", "Romanian|Moldavian|Moldovan", "română") -> ro("ro", "Romanian", "română")
- sa("sa", "Sanskrit (Saṁskṛta)", "संस्कृतम्") -> sa("sa", "Sanskrit", "संस्कृतम्|Saṁskṛta")
- to("to", "Tonga (Tonga Islands)", "faka Tonga") -> to("to", "Tonga", "faka Tonga")
- za("za", "Zhuang|Chuang", "Saɯ cueŋƅ|Saw cuengh") -> za("za", "Zhuang|Chuang", "Saɯ cueŋƅ|Saw cuengh")
- Add more language codes:
- dz("dz", "Dzongkha", "རྫོང་ཁ")
- sh("sh", "Serbo-Croatian", "Srpskohrvatski")
- zu("zu", "Zulu", "isiZulu")
- Add some common country codes:
- nl_BE("nl_BE", "Flemish", "Vlaams")
- en_AU("en_AU", "English (Australian)", "Australian English")
- en_CA("en_CA", "English (Canadian)", "Canadian English")
- en_GB("en_GB", "English (British)", "British English")
- en_US("en_US", "English (American)", "American English")
- fr_CA("fr_CA", "French (Canadian)", "français canadien")
- fr_CH("fr_CH", "French (Swiss)", "français suisse")
- de_AT("de_AT", "Austrian German", "Österreichisches Deutsch")
- de_CH("de_CH", "Swiss High German", "Schweizer Hochdeutsch")
- pt_BR("pt_BR", "Brazilian Portuguese", "português do Brasil")
- pt_PT("pt_PT", "European Portuguese", "português europeu")
- ro_MD("ro_MD", "Moldavian|Moldovan", "moldovenească")
- es_ES("es_ES", "Spanish (Spain)", "español de España")
- es_MX("es_MX", "Spanish (Mexico)", "español de México")
- zh_CN("zh_CN", "Chinese (simplified)", "简体中文")
- zh_TW("zh_TW", "Chinese (traditional)", "繁體中文")
- BREAKING CHANGE NOTE: The method
.fromEnglishNameand.fromNativeNamemay be broken in this version because of those changes.
- Modify the
-
0.3.107 Oct 2023 -
0.3.004 Aug 2023Release notes
Open source →- Add
englishNameandnativeNameto get the first value fromenglishNamesandnativeNames. - Bring
nameback and returnsenglishName.
- Add
-
0.3.0-rc.126 Jul 2023 pre-releaseRelease notes
Open source →- Change from
nametoenglishNamesand returns a list of English names, thenamewas removed. Because it's a default value ofenumso I have to change it to throwUnimplementedError. - Change from
nativeNametonativeNamesand returns a list of native names,nativeNamewas removed. - Change from
.fromNameto.fromEnglishName.
- Change from
-
0.2.022 Jun 2023Release notes
Open source →- Change from using
windowtoPlatformDispatcher. - Using sdk: ">=2.18.0 <4.0.0" and flutter: ">=3.3.0".
- Change from using
-
0.1.122 Apr 2023 -
0.1.011 Jan 2023Release notes
Open source →- Add
LanguageCodes, a pre-defined language code, name in English and name in Native for all the countries. - [BREAKING CHANGE] Rename from
LanguageCode.codetoLanguageCode.rawCode. - Add new
LanguageCode.code, this variable will return asLanguageCodes.
- Add
-
0.0.102 Jan 2023