@kiwicom/smart-faq
Version:
Smart FAQ
35 lines (24 loc) • 2.28 kB
Markdown
---
id: translations
title: Translations
sidebar_label: Translations
---
## Summary
- Check out [nitrolib](https://github.com/kiwicom/nitrolib) docs for more info.
- [DOCs for PhraseApp](https://phraseapp.com/docs/) - Where the translations are stored for translators
- [Phraseapp dashboard](https://phraseapp.com/accounts/oliver-dlouhy/projects/kiwi-com-website/dashboard) - Phraseapp dashboard - check 1Password SmartFAQ vault for access
## How to use translations in code
- Use `Text` from [nitrolib](https://github.com/kiwicom/nitrolib) for usual text, it's possible to pass tkey without having to use `__()`, e.g. `<Text t="some.key" />`, combines `Translate` + `Text` from orbit into one component.
- use `Translate` from nitro if you only want to translate something.
- Use `TextNode` if you want to use React components as placeholder in translations.
- Use `Consumer` as `IntlConsumer` to use `intl.translate` function.
Try to use `Text` or `TextNode` over `Consumer` whenever practical.
To see examples go to [nitrolib docs](https://github.com/kiwicom/nitrolib).
## Flow with translations
1. Upload new strings via [retool](https://retool.skypicker.com/presentation/phraseapp-upload), better if you can add one screenshot, it will help a lot to put translators in context.
1.2 Add your keys to `static/locales/en/translations.json` json file. (this is to make it work locally)
1.3 The CI will automatically collect all the keys with nitro, these keys will be used along with FE keys to extract all the translations needed from the [npm translation package](https://www.npmjs.com/package/@kiwicom/translations).
3. Post it on #web-translations, mentioning all keys that needs to be translated.
4. Wait for strings to be translated and then go to #logs-phraseapp and write command `paexport`, this will publish a new [npm translation package](https://www.npmjs.com/package/@kiwicom/translations).
6. Go to FE repo and create MR updating the [npm translation package](https://www.npmjs.com/package/@kiwicom/translations) along with the [npm smartfaq package](https://www.npmjs.com/package/@kiwicom/smart-faq).
If you need more info about translations go to the [kiwi wiki](https://kiwi.wiki/frontend/wiki/#/general/translations?id=frontend-translations).