How to test localization

From the submission guidelines:

  • The plugin must provide localized strings for all languages indicated as supported by the developer and successfully display them when the system is set to each supported locale.
  • The plugin UI must not break due to localized strings for supported locales.

How are you testing locales?

Are you on Windows or macOS? On Windows, it uses the “Display Language” from the Windows Settings, which is (relatively) quick to change. I don’t know about macOS, but usually, I “just” hard-code the language code I want to test into the plugin (one after the other) and test it (or, ideally, I have plugin settings allowing to override “automatic language”)…

2 Likes

On Mac there’s this window in the System Preferences

When I switched to another region (locale?) one of Apples apps crashed. :thinking:

I guess I can hard code it for testing.

2 Likes

:thinking::laughing:

The truth is that as I use my xd-localization-helper for all my plugins (now), it’s quite easy as I’ve added an overrideLanguage config option to the library specifically for this reason (and maybe for options dialogs allowing users to override the plugin language, reference). I can recommend using some sort of library (may that be your own or something like mine) to anyone implementing i18n in plugins and include something like this, it makes things like this a lot easier

1 Like