Issues with Displaying Language Tags Compliant with RFC 5646

Hello,

I'm currently facing some issues with localization for the Safari extension on iOS:

Issues with Language Tags:

  • Folder names like pt-BR (Brazilian Portuguese) and pt-PT (European Portuguese) placed in the Resources/_locales/ directory are not displaying the respective languages correctly; instead, the default English is shown.
  • Similarly, using folder names like zh-CN (Simplified Chinese) and zh-TW (Traditional Chinese) also results in default English display instead of the intended Chinese language.
  • Conversely, when changing the folder names to pt (Portuguese general) and zh (Chinese general), the languages display correctly.

Could you please provide any recommendations or tips regarding language tag settings and how to ensure they are properly recognized according to RFC 5646?

Thanks for your help!

Best,

Did you try something like zh_CN where zh is a language designator (ISO 639), CN is a locale ID, and _ (underscore) is the separator? See Language and Locale IDs for more information.

Also, the Resources/_locales/ directory doesn't look right to me. On Apple's platforms, the resources of a certain localization must be in a .lproj folder, and the folder is under the Resources folder. For example, <app bundle root>/Contents/Resources/zh_CN.lproj contains Simplified Chinese resources.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Thank you for your response.

I attempted to use the zh_CN and pt_BR formats with underscores as suggested. Unfortunately, these did not display correctly within the Safari extension's description section in the Preferences.

From my testing, if a directory for zh or pt exists, it is prioritized. If these directories are not present, the content from messages.json in the en directory is shown instead. This behavior aligns with the issues I previously observed, where zh and pt directories work correctly, but zh_CN and pt_BR do not. I tested this on iOS versions 18.0 (22A5350a) and 17.5 (21F79).

Could you provide any further recommendations or insights on how to resolve this issue?

Best,

It seems to me that the Safari extension localization has something special then. Would you mind to start with filing a feedback report with screenshots to show the following information, and share your report ID here? I'd see if I have more to say from there.

  • The structure of your main app and extension bundle, including all the .lproj folders.
  • The system language settings of your device.
  • The per-app language settings, if any.
  • The issue.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Issues with Displaying Language Tags Compliant with RFC 5646
 
 
Q