store-locales: verify App Store and Play codes against the official lists (2026-10-11), drop zu, aliases for the 2025 languages, tests

This commit is contained in:
CRTkafa 2026-10-10 23:37:18 +00:00
parent 67e490520b
commit efb3521279
3 changed files with 67 additions and 4 deletions

View file

@ -4,8 +4,20 @@
// "he" vs "iw-IL". storebound keeps one `languages[]` entry per language with both codes, so an importer needs the pairs.
import type { Language } from './config';
/** App Store Connect localizations (App Store Connect Help, "App Store localizations"). The Indian languages, Bangla,
* Urdu and Slovenian were added in 2025. */
// Sources, checked 2026-10-11 (re-check when a store announces new languages):
// - App Store: the 50 locale shortcodes in "Managing metadata in your app by using locale shortcodes" (App Store Connect
// API docs, developer.apple.com/documentation/appstoreconnectapi/managing-metadata-in-your-app-by-using-locale-shortcodes),
// the same 50 languages as App Store Connect Help > Reference > "App Store localizations"
// (developer.apple.com/help/app-store-connect/reference/app-store-localizations). These are the `locale` values of
// appInfoLocalizations / appStoreVersionLocalizations. Apple names or-IN "Oriya" there and "Odia" in the Help table.
// - Google Play: "View list of available languages" in Play Console Help "Translate and localize your app"
// (support.google.com/googleplay/android-developer/answer/9844778), 86 codes; the androidpublisher API's
// edits.listings `language` takes the same codes. NOT the "Supported languages" table
// (support.google.com/googleplay/android-developer/table/4419860): that one lists Play Console's own UI languages with
// other spellings (he, tr, ja, de) that are not listing codes.
/** App Store Connect locales (50). Bangla, Gujarati, Kannada, Malayalam, Marathi, Odia, Punjabi, Slovenian, Tamil, Telugu
* and Urdu were added in 2025. */
export const APPLE_LOCALES: readonly string[] = [
'ar-SA', 'bn-BD', 'ca', 'cs', 'da', 'de-DE', 'el', 'en-AU', 'en-CA', 'en-GB', 'en-US', 'es-ES', 'es-MX', 'fi', 'fr-CA',
'fr-FR', 'gu-IN', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn-IN', 'ko', 'ml-IN', 'mr-IN', 'ms', 'nl-NL', 'no',
@ -13,14 +25,15 @@ export const APPLE_LOCALES: readonly string[] = [
'vi', 'zh-Hans', 'zh-Hant',
];
/** Google Play store listing languages (Play Console > Store presence > Translations; the API uses the same codes). */
/** Google Play store listing languages (86; Play Console > Store listing > Manage translations, the API uses the same
* codes). Zulu ("zu", in older lists and fastlane's) is no longer in Google's list. Odia has no Play code. */
export const PLAY_LOCALES: readonly string[] = [
'af', 'am', 'ar', 'az-AZ', 'be', 'bg', 'bn-BD', 'ca', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-CA', 'en-GB',
'en-IN', 'en-SG', 'en-US', 'en-ZA', 'es-419', 'es-ES', 'es-US', 'et', 'eu-ES', 'fa', 'fa-AE', 'fa-AF', 'fa-IR', 'fi-FI',
'fil', 'fr-CA', 'fr-FR', 'gl-ES', 'gu', 'hi-IN', 'hr', 'hu-HU', 'hy-AM', 'id', 'is-IS', 'it-IT', 'iw-IL', 'ja-JP',
'ka-GE', 'kk', 'km-KH', 'kn-IN', 'ko-KR', 'ky-KG', 'lo-LA', 'lt', 'lv', 'mk-MK', 'ml-IN', 'mn-MN', 'mr-IN', 'ms', 'ms-MY',
'my-MM', 'ne-NP', 'nl-NL', 'no-NO', 'pa', 'pl-PL', 'pt-BR', 'pt-PT', 'rm', 'ro', 'ru-RU', 'si-LK', 'sk', 'sl', 'sq',
'sr', 'sv-SE', 'sw', 'ta-IN', 'te-IN', 'th', 'tr-TR', 'uk', 'ur', 'vi', 'zh-CN', 'zh-HK', 'zh-TW', 'zu',
'sr', 'sv-SE', 'sw', 'ta-IN', 'te-IN', 'th', 'tr-TR', 'uk', 'ur', 'vi', 'zh-CN', 'zh-HK', 'zh-TW',
];
/** App Store locale -> the Play code of the same language, where the two differ (the rest are spelled the same). */
@ -43,11 +56,18 @@ const APPLE_ALIASES: Readonly<Record<string, string>> = {
'ru-RU': 'ru', 'tr-TR': 'tr', 'sv-SE': 'sv', 'da-DK': 'da', 'fi-FI': 'fi', 'no-NO': 'no', 'pl-PL': 'pl', 'cs-CZ': 'cs',
'el-GR': 'el', 'hu-HU': 'hu', 'hi-IN': 'hi', 'uk-UA': 'uk', 'th-TH': 'th', 'vi-VN': 'vi', 'id-ID': 'id', 'ms-MY': 'ms',
'ro-RO': 'ro', 'sk-SK': 'sk', 'hr-HR': 'hr', 'ca-ES': 'ca',
// the 2025 languages without their region, and Play's spellings of them
'bn': 'bn-BD', 'gu': 'gu-IN', 'kn': 'kn-IN', 'ml': 'ml-IN', 'mr': 'mr-IN', 'or': 'or-IN', 'pa': 'pa-IN', 'sl': 'sl-SI',
'ta': 'ta-IN', 'te': 'te-IN', 'ur': 'ur-PK',
};
const PLAY_ALIASES: Readonly<Record<string, string>> = {
'he-IL': 'iw-IL', 'he': 'iw-IL', 'iw': 'iw-IL', 'id-ID': 'id', 'in-ID': 'id', 'nb-NO': 'no-NO', 'nb': 'no-NO',
'fil-PH': 'fil', 'zh-Hans': 'zh-CN', 'zh-Hant': 'zh-TW', 'en': 'en-US', 'de': 'de-DE', 'fr': 'fr-FR', 'es': 'es-ES',
'tr': 'tr-TR', 'ja': 'ja-JP', 'ko': 'ko-KR', 'it': 'it-IT', 'ru': 'ru-RU', 'pt': 'pt-PT', 'nl': 'nl-NL', 'pl': 'pl-PL',
// App Store spellings of languages Play writes differently
'ar-SA': 'ar', 'bn': 'bn-BD', 'gu-IN': 'gu', 'kn': 'kn-IN', 'ml': 'ml-IN', 'mr': 'mr-IN', 'pa-IN': 'pa', 'sl-SI': 'sl',
'ta': 'ta-IN', 'te': 'te-IN', 'ur-PK': 'ur', 'es-MX': 'es-419', 'cs': 'cs-CZ', 'da': 'da-DK', 'el': 'el-GR', 'fi': 'fi-FI',
'hi': 'hi-IN', 'hu': 'hu-HU', 'sv': 'sv-SE', 'no': 'no-NO',
};
export interface Normalized { code: string; known: boolean; alias?: string }