[localization] Localize lit.dev into other languages
Lots of our users come from non-english speaking countries and so can many of our future users. It'd be great to support other languages for lit.dev and create a translation pipeline for our commits to the site. Might hopefully also be a great way to show off lit localize in our web components on the site
Requested PGM support / resourcing on this. Will organize with @AndrewJakubowicz on steps forward once we hear back
With @novenn having opened up #817 we have a big reason to figure out the i18n story now. It'd be good to outline some specifics of what we would need to be able to maintain translations and accept community contributions.
The are some issues that come up with i18n that we need to be able to handle:
- Translations may be incomplete
- Translations may get stale as changes are made to the English content
- Translations may be incorrect
- Translations may be malicious, abusive, or inappropriate
- Translations may otherwise not adhere to Google policy
Most of these seem to require some kind of review. We need to find out from our Google contacts what our responsibilities and options are here.
Then we have questions to answer and changes to make in infrastructure and process:
- What is the URL structure for localized variants? Are they subfolders or domains?
- Where is the language switcher in the UI?
- Are locale preferences stored anywhere? Does that trigger any data-retention or cookie policies?
- What libraries do we use for i18n? (#817 uses
eleventy-plugin-i18n. Seems like a good choice?) - What impact does this have on english doc changes?
- How do we sync english changes to other translations?
- Can we derive what changes need to be made?
- Can we auto-open tickets, or ping translators in PRs?
- Do we tag translated pages that may be out-of-sync with the source?
- Do we accept all language contributions?
- How much of the docs need to be translated before we enable it publicly?
- Do we keep a roster of translators and reviewers for different languages somewhere?
I personally would love to be very liberal with accepting translations, since they're so useful to so many, so I'd like to see us find out what the minimal infrastructure and process we need is, and build from there.
i have finished translate docs into chinese, preview here: https://lit.novenn.com/zh-CN/。
can i and how to merge my work to this repo。
i have commit a pr https://github.com/lit/lit.dev/pull/817.
Wow! This is amazing work!
I would love to get this out there somehow but there are a few issues:
- We need to find a way to make sure these sections stay in sync
- if we add documentation in english, we need to make sure those docs show up on the zh-CN site
- We need to find a way to get updated translations for new content
- despite your herculean work, I doubt you want to translate every new update from here on
- Will this be an automated issue tracker?
- Will we need to implement a tool that updates each string or will it just be a separate site?
- We need to find some way to peer review your content since nobody on the team can read Chinese and confirm the contents and quality
- We need to find a way to make the zh-CN site discoverable from the main site
This is stuff we have to do on our end so we need to figure out these processes so that we can have a solid plan going forward.
Wow! This is amazing work!
I would love to get this out there somehow but there are a few issues:
We need to find a way to make sure these sections stay in sync
- if we add documentation in english, we need to make sure those docs show up on the zh-CN site
We need to find a way to get updated translations for new content
- despite your herculean work, I doubt you want to translate every new update from here on
- Will this be an automated issue tracker?
- Will we need to implement a tool that updates each string or will it just be a separate site?
We need to find some way to peer review your content since nobody on the team can read Chinese and confirm the contents and quality
We need to find a way to make the zh-CN site discoverable from the main site
This is stuff we have to do on our end so we need to figure out these processes so that we can have a solid plan going forward.
Here's a demo that makes sure the source document is synced to the target language base sections:
https://github.com/novenn/lit.dev/tree/i18n/packages/lit-dev-i18n
follow the steps below: Step 1: yarn checkout: zh-CN. Pull the modified content from lit-dev-content/site/docs/, merge them into root_dir/workspace/zh-CN, and create them if they don't exist; Step 2: Do the translation work in the xml file of the workspace, to be precise, enter the target language text in the Target Element. maybe, you also need to handle conflicts in Source Elements; Step 3: yarn build:zh-CN: Extract the target language text from the Target Element in the xml file in the workspace, combine them into a file and send them to lit-dev-content/site/docs/zh-CN.