mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-28 00:34:47 -04:00
* Add ability to inject into Python files * Update outdated references to gen_global_components.py * Add code gen for registration locale validation * sort validators * update for pydantic 2 * run generator again --------- Co-authored-by: Gasper Gril <gasper@gril.si> Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
48 lines
840 B
Python
48 lines
840 B
Python
def validate_locale(locale: str) -> bool:
|
|
valid = {
|
|
# CODE_GEN_ID: MESSAGE_LOCALES
|
|
"af-ZA",
|
|
"ar-SA",
|
|
"bg-BG",
|
|
"ca-ES",
|
|
"cs-CZ",
|
|
"da-DK",
|
|
"de-DE",
|
|
"el-GR",
|
|
"en-GB",
|
|
"en-US",
|
|
"es-ES",
|
|
"fi-FI",
|
|
"fr-CA",
|
|
"fr-FR",
|
|
"gl-ES",
|
|
"he-IL",
|
|
"hr-HR",
|
|
"hu-HU",
|
|
"is-IS",
|
|
"it-IT",
|
|
"ja-JP",
|
|
"ko-KR",
|
|
"lt-LT",
|
|
"lv-LV",
|
|
"nl-NL",
|
|
"no-NO",
|
|
"pl-PL",
|
|
"pt-BR",
|
|
"pt-PT",
|
|
"ro-RO",
|
|
"ru-RU",
|
|
"sk-SK",
|
|
"sl-SI",
|
|
"sr-SP",
|
|
"sv-SE",
|
|
"tr-TR",
|
|
"uk-UA",
|
|
"vi-VN",
|
|
"zh-CN",
|
|
"zh-TW",
|
|
# END: MESSAGE_LOCALES
|
|
}
|
|
|
|
return locale in valid
|