Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: use enum for supported language codes (#3917)
- Loading branch information
Showing
6 changed files
with
125 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
app/src/main/java/openfoodfacts/github/scrachx/openfood/utils/SupportedLanguages.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package openfoodfacts.github.scrachx.openfood.utils | ||
|
||
@Suppress("unused") | ||
enum class SupportedLanguages(val code: String) { | ||
AA("aa"), | ||
ACH("ach"), | ||
AF("af"), | ||
AK("ak"), | ||
AM("am"), | ||
AR("ar"), | ||
AS("as"), | ||
AST("ast"), | ||
AZ("az"), | ||
B_SR_CYRL("b+sr+Cyrl"), | ||
B_SR_LATN("b+sr+Latn"), | ||
BE("be"), | ||
BN("bn"), | ||
BG("bg"), | ||
CA("ca"), | ||
CS("cs"), | ||
DA("da"), | ||
DE("de"), | ||
EL("el"), | ||
EN("en"), | ||
EO("eo"), | ||
ES("es"), | ||
ET("et"), | ||
EU("eu"), | ||
FA("fa"), | ||
FI("fi"), | ||
FIL("fil"), | ||
FR("fr"), | ||
GA("ga"), | ||
GL("gl"), | ||
GU("gu"), | ||
HE("he"), | ||
HI("hi"), | ||
HU("hu"), | ||
HR("hr"), | ||
HY("hy"), | ||
ID("id"), | ||
IT("it"), | ||
IS("is"), | ||
JA("ja"), | ||
KAB("kab"), | ||
KK("kk"), | ||
KM("km"), | ||
KO("ko"), | ||
KU("ku"), | ||
LO("lo"), | ||
LT("lt"), | ||
LV("lv"), | ||
MG("mg"), | ||
ML("ml"), | ||
MN("mn"), | ||
MS("ms"), | ||
MT("mt"), | ||
MY("my"), | ||
NE("ne"), | ||
NO("no"), | ||
NB("nb"), | ||
NL_BE("nl-BE"), | ||
NL("nl"), | ||
PL("pl"), | ||
PT_BR("pt-BR"), | ||
PT("pt"), | ||
RO("ro"), | ||
RU("ru"), | ||
SI("si"), | ||
SL("sl"), | ||
SK("sk"), | ||
SV("sv"), | ||
TA("ta"), | ||
TE("te"), | ||
TG("tg"), | ||
TH("th"), | ||
TI("ti"), | ||
TL("tl"), | ||
TR("tr"), | ||
UG("ug"), | ||
UK("uk"), | ||
UZ("uz"), | ||
VI("vi"), | ||
WA("wa"), | ||
WO("wo"), | ||
XH("xh"), | ||
YI("yi"), | ||
YO("yo"), | ||
ZH_CN("zh-CN"), | ||
ZH_HK("zh-HK"), | ||
ZH_TW("zh-TW"), | ||
ZH("zh"), | ||
ZU("zu"); | ||
|
||
companion object { | ||
fun codes() = values().map { it.code } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.