-
Notifications
You must be signed in to change notification settings - Fork 25
Creating a new translation
To add a translation to a new language in Bonsai, the following should be done:
-
Add a new ResX file with localized strings next to
src/Bonsai/Localization/Texts.resx
similarly to the existing ones. -
Translate all strings from the
Texts.en-US.resx
file.If a string contains a placeholder, like
{0}
, it should be left intact. The values to be inserted into those places are described in the comment.If a string contains a vertical line separator (
|
), they should also be left intact. There should be no spaces around the separator.If the key ends with
M
orF
suffix, these mean male and female context respectively. In some lines the English form will be the same, but it can be different for other languages. -
Add a new class deriving from
LocaleBase
insrc/Bonsai/Code/Services/LocaleProvider.cs
. It should contain a function to resolve the appropriate word form depending on the quantity (e.g. "1 son, 2 sons").The instance of this class should be registered in the
LocaleProvider.Locales
field in the same class. -
Add
Guidelines.<locale>.cshtml
andMarkdown.<locale>.cshtml
to/src/Bonsai/Areas/Admin/Views/Help
. Translate their contents. -
Add translations for month and day names to
src/Bonsai/Areas/Common/Libs/gijgo.core.js
similarly to existing ones. -
Add
README.<locale>.md
to the root folder, translate its contents. -
Mention the newly created locale in other
README
files.