-
Notifications
You must be signed in to change notification settings - Fork 3
Translations
Alex Saltykov edited this page Apr 14, 2023
·
5 revisions
Each element in _index.html that contains a message has data-attribute data-translate-id
. At the same time there is a number of translate files here. File name is the language code, for example ar.json
stands for arabic
.
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
Each key of these json files is unique message id. Value is an object with properties:
-
value
- localized message -
prop
- which property should be localized (ex. if you have an element like<span data-translate-id="foo">Foo</span>
, prop will be 'text' and for element like<input data-translate-id="bar" placeholder="Bar" />
prop will be 'placeholder') -
defaultValue
- original message just for reference
- Clone https://github.com/johnSamilin/rosplata-back
- Run
npm run translations:add code
(where code is two-letters language code, likeru
orhi
) - Edit messages in
rosplata/translations/[code].json
- Run
npm run translations:apply
- Create PR
- Update this message in each translation file
- Run
npm run translations:apply
- Create PR
- Make sure you added
data-translate-id
- Run
npm run translations:generate
- Update this message in each translation file
- Run
npm run translations:apply
- Create PR