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:
parent
67e490520b
commit
efb3521279
3 changed files with 67 additions and 4 deletions
|
|
@ -11,6 +11,11 @@
|
|||
named in the report; submission flags, `price_tier`, the age rating config, lanes and signing are listed with their
|
||||
storebound counterpart. New skill `migrate-from-fastlane`.
|
||||
|
||||
- Store language codes checked against the official lists (2026-10-11): the 50 App Store Connect locale shortcodes
|
||||
and the 86 Google Play listing codes all match; Zulu (`zu`) is no longer a Play listing language and was dropped;
|
||||
`import fastlane` also accepts region-less folders of the 2025 App Store languages (`ta`, `sl`, `ur`, ...) and
|
||||
App Store spellings in Play folders (`pa-IN`, `ur-PK`, `sl-SI`, ...). Sources are cited in `cli/lib/store-locales.ts`.
|
||||
|
||||
- Fixes from a read-only run against live store accounts: `apps check` says `api-disabled` (not `permission`) when the
|
||||
Play Developer Reporting API is off, and `apps list` / serve `apps.list` fail with that reason and the fix instead of
|
||||
a JSON fragment (API error bodies are kept on one line everywhere); the newest App Store version is the newest by
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -54,6 +54,44 @@ describe('store locales', () => {
|
|||
expect(appleLocale('EN-gb')).toEqual({ code: 'en-GB', known: true, alias: 'EN-gb' });
|
||||
expect(appleLocale('xx-YY')).toEqual({ code: 'xx-YY', known: false });
|
||||
});
|
||||
test('the official lists (checked 2026-10-11): 50 App Store locales, 86 Play codes', () => {
|
||||
// Apple: "Managing metadata in your app by using locale shortcodes" (App Store Connect API docs)
|
||||
expect([...APPLE_LOCALES].sort()).toEqual(['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', 'or-IN', 'pa-IN', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk', 'sl-SI', 'sv', 'ta-IN',
|
||||
'te-IN', 'th', 'tr', 'uk', 'ur-PK', 'vi', 'zh-Hans', 'zh-Hant']);
|
||||
// Google: Play Console Help "Translate and localize your app" > "View list of available languages"
|
||||
expect(PLAY_LOCALES).toHaveLength(86);
|
||||
expect(new Set(PLAY_LOCALES).size).toBe(86);
|
||||
for (const c of ['bn-BD', 'gu', 'kn-IN', 'ml-IN', 'mr-IN', 'pa', 'sl', 'ta-IN', 'te-IN', 'ur', 'iw-IL', 'es-US', 'fil', 'rm', 'fa-AE'])
|
||||
expect(PLAY_LOCALES).toContain(c);
|
||||
for (const c of ['zu', 'he', 'or', 'or-IN', 'tr', 'ja']) expect(PLAY_LOCALES).not.toContain(c);
|
||||
});
|
||||
test('the 2025 App Store languages pair with Play where Play has them', () => {
|
||||
const want: Record<string, string | undefined> = { 'bn-BD': 'bn-BD', 'gu-IN': 'gu', 'kn-IN': 'kn-IN', 'ml-IN': 'ml-IN',
|
||||
'mr-IN': 'mr-IN', 'or-IN': undefined, 'pa-IN': 'pa', 'sl-SI': 'sl', 'ta-IN': 'ta-IN', 'te-IN': 'te-IN', 'ur-PK': 'ur' };
|
||||
for (const [a, p] of Object.entries(want)) {
|
||||
expect(appleToPlay(a)).toBe(p);
|
||||
if (p) expect(playToApple(p)).toBe(a);
|
||||
}
|
||||
// every App Store locale maps to a real Play code or to none, and back again
|
||||
for (const a of APPLE_LOCALES) { const p = appleToPlay(a); if (p) { expect(PLAY_LOCALES).toContain(p); expect(playToApple(p)).toBe(a); } }
|
||||
// bare spellings in fastlane folders
|
||||
expect(appleLocale('ta').code).toBe('ta-IN');
|
||||
expect(appleLocale('sl').code).toBe('sl-SI');
|
||||
expect(appleLocale('ur')).toEqual({ code: 'ur-PK', known: true, alias: 'ur' });
|
||||
expect(playLocale('pa-IN')).toEqual({ code: 'pa', known: true, alias: 'pa-IN' });
|
||||
expect(playLocale('ur-PK').code).toBe('ur');
|
||||
expect(playLocale('bn').code).toBe('bn-BD');
|
||||
expect(playLocale('zu').known).toBe(false);
|
||||
});
|
||||
test('every alias lands on a listed code', async () => {
|
||||
const src = await Bun.file(new URL('../cli/lib/store-locales.ts', import.meta.url)).text();
|
||||
for (const k of [...src.matchAll(/'([A-Za-z-]+)': '[A-Za-z0-9-]+'/g)].map(m => m[1]!)) {
|
||||
const a = appleLocale(k), p = playLocale(k);
|
||||
expect(a.known || p.known).toBe(true);
|
||||
}
|
||||
});
|
||||
test('fastlane supply folders -> Play codes', () => {
|
||||
expect(playLocale('tr-TR')).toEqual({ code: 'tr-TR', known: true });
|
||||
expect(playLocale('iw-IL').known).toBe(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue