ONNX

Japanese voice uses invalid locale code ja_JA (should be ja_JP)

#106
by IhorShevchuk - opened

The voice ja_JA-hi_fi_captain-medium is tagged with language code ja_JA, but JA is not a registered region subtag (checked against the IANA language subtag registry). Japan is JP, so the valid BCP 47 tag is ja_JP.

This breaks locale-aware consumers: e.g. on iOS, Locale.localizedString(forIdentifier: "ja_JA") returns nil, so apps fall back to showing the raw code.

Suggested fix: rename the key, language.code, and the ja/ja_JA/ file paths to ja_JP. Happy to provide more detail if needed.

Confirmed, thanks for the careful report β€” and for pinning it to the registry rather than just the symptom.

JA is not an assigned ISO 3166-1 alpha-2 / IANA region subtag, so ja_JA is not a well-formed BCP 47 tag and the nil you get back from Locale.localizedString(forIdentifier:) is the correct behavior on iOS's side. I checked the other 57 locales in voices.json as well: this is the only invalid one.

Two PRs:

On the second one: a renamed voice records its old name in an ALIASES file, which voices.json surfaces as the entry's aliases list, but nothing actually honored that list β€” the downloader builds its URL from the voice name alone and never reads voices.json. So every pre-1.0 name has been broken since the rename that introduced them. With #308, ja_JA-hi_fi_captain-medium keeps working after the move and downloads under the new name, with a warning saying what it was renamed to.

One thing to plan for: once #107 merges, ja/ja_JA/... URLs will 404. That follows the precedent set by the v0 to v1 rename, which moved files rather than leaving copies behind, but it does mean anything with a hardcoded ja_JA path needs updating to ja_JP β€” a client-side alias can't help there.

Sign up or log in to comment