Some languages (e.g. Welsh, cy) are not a supported lang parameter by certain Phonos engines — currently, Phonos will fail to render any audio when an unsupported language is passed.
In these cases, we should show an error message, and help the user choose a supported language. We did think about falling back to another "parent" language, but decided against that.
E.g.
<phonos text="llandudno" ipa="/ɬanˈdɨdnoː/" lang="cy" />
will return an error message and render no audio, whereas
<phonos text="llandudno" ipa="/ɬanˈdɨdnoː/" lang="en" />
returns an audio rendering.
Further examples at https://en.wikipedia.beta.wmflabs.org/wiki/Phonos
Acceptance criteria
- When provided with an unsupported language, Phonos will show an error message (and not use the already established language fallback path).
- The error message will, if possible, suggest alternative (supported) language codes.
- When provided with a supported language, Phonos will send the request unchanged.
- The user-provided language code will be normalized as appropriate (e.g. if PT_BR is given and pt-BR is supported then no error will be shown).