Software is used by a wide variety of folks who live in a wide variety of regions. As such, both the macOS operating system and Nova support localization into multiple languages. To enable this for its extensions, Nova provides a suite of tools that make it easy to ensure that your extension can be used in multiple languages with minimal effort.
Supported App Languages
Currently, the Nova editor and IDE is localized into the following languages:
- Chinese (Simplified) (
- English (
- French (
- German (
- Japanese (
Extensions can add localization support for multiple languages by using translation files in JSON-format in special subfolders of the extension.
For each specific language an extension wishes to provide, a folder should be created in the extension root with the following name format:
The language code is one those defined by the IETF BCP 47 standardization. The language codes for those directly supported by the Nova IDE itself are listed in parenthesis above.
By default, any assets and text provided by the extension is assumed to be its “Base” localization. This localization is the fallback used when a more specific localization does not apply. As such, it’s often common to place English translations in this base localization, and to not provide a specific English localization folder.
To provide localizations for the French language, for example, the extension should provide a folder named
fr.lproj in its root. This will cause the extension runtime to look in this folder first for string translations if the user is running using a French locale.
Within a localization folder (
lproj), an extension may provide one or more JSON files for translated text. The name of the JSON file represents the table name used for localization. The default file name is
strings.json, which will be referenced if no table name is provided. Most extensions will likely only need a single
Localizing UI Text
By default, any text that is provided to the Nova IDE through an extension’s
extension.json manifest (such as display names for preference keys) will automatically be looked up in the extension’s localization tables without the need to provide localizations through code.
Localizing Text in Code
key argument represents the key in the relevant localized JSON file that will be used for lookup. If the user is running in a French locale, it will be looked for in the
value argument represents the value to return if no suitable localized text can be found. This is a fallback that represents your “base” localization.
tableName argument represents which JSON file in which to look up the translation (without the
.json file extension). If not provided, it will be looked up in a
strings.json table as if
strings had been provided as the argument.
Because users can configure their system with a cascade of supported languages, Nova will attempt to localize text using the same fallback behavior. If a user configures their system to use French, German, and English (in that order), Nova will look for a translation in the
en.lproj directories. If none is found, it will fall back to the