Skip to content
IlyaBOT edited this page Mar 15, 2023 · 15 revisions

Translating in HFS 3

Translation in HFS 3 has become much more convenient and easier, since for this you just need to create a JSON file with the translation of all words or only for some, for example:

{
    "author": "IlyaBOT",
    "version": 1.0,
    "hfs_version": "0.39.0",
    "translate": {
        "Select": "Select",
        "n_files": "{n} files",
        "n_folders": "{n,plural, one{# folder} other{# folders}}",
        "filter_count": "{n,plural, one{# element} other{# elements}}",
        "select_count": "{n,plural, one{# select} other{# select}}",
        "filter_placeholder": "Filter",
        "Select some files": "Select some files"
    }
}

To start translating:

Download the english file as a starting point. Rename the file changing the "en" part with your language's 2-letter code.

The file syntax is JSON, and the translation syntax is ICU. When you see curly braces like {n}, that's a variable, like a number, always changing. Commands within curly braces MUST NOT be translated, like plural.

The way plural works in your language is probably different from english, so if you don't get the results you need, you may need to make some changes. Refer to this guide to know your options.

Always check your file is working good before submitting. When you are sure it's good, you can publish it. The easiest way is to open an issue and attach your file (you may need to zip it, first). We will include it in our folder.

Clone this wiki locally