Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Crowdin workflow for firmware translations #4489

Open
7 tasks
obrusvit opened this issue Jan 10, 2025 · 0 comments
Open
7 tasks

Enable Crowdin workflow for firmware translations #4489

obrusvit opened this issue Jan 10, 2025 · 0 comments
Assignees
Labels
core Trezor Core firmware. Runs on Trezor Model T and T2B1. translations Put this label on a PR to run tests in all languages

Comments

@obrusvit
Copy link
Contributor

obrusvit commented Jan 10, 2025

In order to use Crowdin effectively, we need to modify the way we work with language JSONs.

  • en.json (a source JSON) currently has the following KV pairs: str -> str. Change it to str -> str | dict where dict allows to use same keys but different strings for different UIs. These changes must be propagated into the generation of translated_strings.rs, python mocks and language blobs. This helps with:
    • setting strings of different lengths to different UIs
    • achieving de-duplication of various versions of the same string.
    • Something like this:
"title__signtx": "Sign transaction"
"title__signtx": {"Bolt": "Sign transaction", "Samson": "Sign tx", "Quicksilver": "Sign transaction"}
  • a script that takes the source json of each language and splits it per UI layout, i.e.
    • en.json -> en_Bolt.json, en_Samson.json, en_Quicksilver.json
    • de.json -> de_Bolt.json, de_Samson.json, de_Quicksilver.json
    • etc.
  • these JSONs are submitted to Crowdin firmware project
    • it's possible to set maximal lengths of strings for individual models
  • after translations on Crowdin are finished, the resulting translated strings are merged together into the source JSONs
    • Optionally use Crowdin API to upload/download JSOns
    • Optionally perform sanity checks for consistency (e.g. set of keys is matching for all langs for a UI)
@obrusvit obrusvit added core Trezor Core firmware. Runs on Trezor Model T and T2B1. translations Put this label on a PR to run tests in all languages labels Jan 10, 2025
@obrusvit obrusvit added this to the 🌍 Translations milestone Jan 10, 2025
@romanz romanz self-assigned this Jan 14, 2025
@romanz romanz linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Trezor Core firmware. Runs on Trezor Model T and T2B1. translations Put this label on a PR to run tests in all languages
Projects
Status: No status
Development

No branches or pull requests

2 participants