Repository navigation
Add multi-language build (i18n) + French translation - #465
FreeProject089 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Oh wow, very interesting!
First of all, thank you for your efforts and the interest 👍
The big thing first: This appears to be AI translated - that is not bad per se, but I do need to run this through the team first. I am not sure if we are currently able to officially support a language without a person dedicated to keeping it up2date. Having such a person is the only reason we can currently offer the Chinese manual.
Apart from that, a few things I noticed that would likely need to be addressed before this can be merged:
- that commit that uses
GITHUB_TOKENand removescnameneeds to be reverted (also says so in its description "revert this before merging") - I do not thinnk that we can currently support the assumption in this switcher-system that the language variations are all always on the same version. That is, it needs to gracefully be able to handle that some file
foo.mdon EN doesnt exist on FR or vice versa. The same goes for the images. For the images specifically it is also not safe to assume (at least in the current version) that they are language agnostic. Some of them have for example english annotations that need to be translated as well (see the chinese manual which did that). - Im not the biggest fan of putting in
npmfor this. But okay, maybe the easiest choice... Tech-wise if we could substitute that with a Python script it would be better for the team and the existing tech-stack.
Sorry that you are running into these questions now. Its not your fault and more that this project right now isnt well prepared for offerring multiple languages yet. I appreciate you trying to spearhead this though 👍
Some alternatives:
- everything moves to a branch
l10n/fr, next to the existingl10n/cn- but then I also need to see if we want to support AI translations officially - you can ofc always keep it on your fork and also distribute it inofficially as "ive translated heatblurs manual to french, look here: ...". we would ofc also support that and could also put the PDF into the modules doc folder as long as its clear that its not an "official module by Heatblur", so to speak
Either case, Ill get back to you with the feedback regarding AI translations, thanks! 😃
|
Thank you very much for your detailed feedback and for taking the time to review the PR. I have taken note of the different points you mentioned. I will apply the necessary changes on my side when I have the time:
Regarding npm, I chose it mainly because I am more comfortable with JavaScript, but I understand that Python may be more suitable for the team and for maintaining the project. Regarding the AI translation, I completely understand the concerns. My goal is not to provide an unchecked machine translation: I review and correct the translation manually to ensure a better quality result. Thank you again for the feedback. I will continue improving the PR based on your suggestions. |
Move English source to src/<lang>/ layout and add a single-command build (npm run build / node i18n/build.js) that produces one HTML site and one PDF per language in one pass, plus an in-page language switcher styled like the existing theme picker. npm run serve builds and serves the multi-language output for local testing, since plain mdbook serve only serves one language at the site root and 404s on switcher links. Translations don't need to be 1:1 with English: any missing page or image is filled in from English for the duration of a language's build (and never overwrites a real translation), so an incomplete translation still builds instead of breaking. The language switcher also checks a page actually exists before navigating to it, falling back to that language's home page instead of a 404. See i18n/README.md.
|
Quick update on this: Reverted the GITHUB_TOKEN/CNAME commit, both workflows are back to using GH_PAGES_DEPLOY_BOT_PAT and the original custom domain. |
|
@FreeProject089 Hey there, so I am back with a decision by the team. First of all, thanks again for all your efforts 👌
However, we are very interested in your contributions towards having the manual support a language-switching feature. We have a chinese manual already and will probably also get a korean one. They will benefit a lot from this feature. And who knows, maybe someone shows up who wants to translate the manual into french per hand as well, including future support? Plus the other HB UIs and the keybinds. (This invitation goes out to everyone ofc, you included 🙂) Either case, you are more than welcome to offer your french translations from your fork to everyone. Im sure the french community would appreciate it. |
|
Thank you for your feedback and for taking the time to discuss this with the team. I completely understand your decision and the reasons mentioned, especially regarding long-term maintenance of the translation and quality concerns. I am, however, very happy that the i18n part and the language-switching system are of interest to you. Regarding the French translation, I will continue to provide it from my fork for the French-speaking community. I will also continue maintaining it and making corrections when necessary to further improve its quality, even though the current version is already in a fairly clean state. For information, the translation process was done as follows: the manual's Thank you again for your feedback! |
Summary
src/en/, a single command(
npm run build/node i18n/build.js) now builds every configured languagein one pass — one HTML site per language (
book/html/<lang>) and one PDF perlanguage (
book/pdf/<lang>.pdf), plus a small landing page that remembersthe visitor's last language choice.
theme picker, that jumps to the same page in the other language.
npm run servebuilds and serves the multi-language output locally so theswitcher/landing page can be tested exactly as deployed — plain
mdbook serveonly serves one language at the site root and 404s on switcher links.
src/fr/), reviewed file-by-file against theEnglish source: literal cockpit switch/panel labels, weapon designations,
and BIT-checklist action values are kept in English (matching what's
actually displayed in-sim), machine-translation artifacts and garbled
sentences fixed.
deploy-gh-pages.yaml,deploy-release-pdf.yaml) updated to run the newbuild script and publish a PDF per language.
See
i18n/README.mdfor how it works and how to add another language.Test plan
node i18n/build.jscompletes with 0 HTML parse warnings and 0 errorsfor every language
underlying images, in the same order, on every page
other language, no 404s