I found a PR for translations in n8n and want to use it. The problem is that I can’t fully understand how to translate some of the fields.
According to README I can translate lots of fields but it’s not said how can I actually translate usual diplayName and description fields. For example for Github node description field is equal to ‘Consume GitHub API’. But I don’t see any example of how can I translate it to some other language.
Would appreciate any help. Thanks
Welcome to the community @GiddeonWyeth
I think it’s better to wait until it’s merged to use it, as things might change. In case you still want to use it as it’s @ivan might be able to help you.
@ivov can I ask for your advise on this one?
The i18n PR is a proof of concept, so it does yet not cover all strings.
Specifically, it does not yet cover:
- the nodes panel (refactored in parallel with i18n),
- Element UI native components like the datepicker, and
- strings originating in the backend:
- error handler messages
- helpers in
- subtitle in
Translation occurs via calls to this mixin in the Vue templates. These methods convert props and slices of the Vuex store into a path to navigate the translation object, rendering the value or falling back to English.
For the nodes panel, what remains to be done is (1) including its base strings in the English locale file, (2) adding translation methods to the mixin, (3) calling the methods for base strings and for node params in
components/NodeCreator, and (4) loading the display names and descriptions for the nodes panel on init. For reference, node translations are loaded on demand, as each node is placed on the canvas, so display names and descriptions for the nodes panel might need to be loaded separately, all at once.
It would be best to wait until this PR is completed, but at the moment I cannot say when it will be reprioritized.