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

No explanation of how to add a new language #564

Open
joelnitta opened this issue Jan 12, 2024 · 6 comments
Open

No explanation of how to add a new language #564

joelnitta opened this issue Jan 12, 2024 · 6 comments

Comments

@joelnitta
Copy link
Contributor

The translation vignette only describes how to update existing PO files (translations), not how to add a new language.

@froggleston
Copy link
Contributor

@olexandr-konovalov , @martin-raden - given you have both submitted new translations in recent months, do you have any input to this issue? e.g. any quick bullet points or references that you feel we could build into some improved documentation? Thank you!

@olexandr-konovalov
Copy link
Contributor

I'm afraid not, since all setup for us was kindly made by @joelnitta - but I will definitely look later at the current document and will try to help to review any PRs, as this is something I want to understand better!

@martin-raden
Copy link
Contributor

Eventually, the process was rather straight, but yes, maybe a "todo list" might help motivating people to contribute.


## How to add a new language

If you find your preferred language missing in the list of supported language, feel free to contribute a respective translation. 
This is straight forward using the following steps.

- fork the repository (and maybe create a translation-specific local branch)
- create your own `.po` translation raw file as a copy of `po/R-sandpaper.pot`
  - ensure it's in the `po/` subfolder
  - ensure it is named `R-[LANGUAGE].po`, where `[LANGUAGE]` is your language's 2-letter code
  - therin: 
    - update the general information within the head section (compare with other language files)
    - replace the `msgstr` entries in your language (AI will help but needs revision!)
- create a pull request to add your file
  - therin: request the integration of you `.po` file and the built of the final `.mo` translation files

Done.

Thanks and looking forward to your contribution!

Hope that helps.

Best,
Martin

@martin-raden
Copy link
Contributor

Also many thanks to make language-specific translations possible!

This makes the lessons much more consistent!

👍

@joelnitta
Copy link
Contributor Author

I am a bit swamped right now so can't get to this right away, but this gives me an idea: it should be possible to add a function to {dovetail} to automate some (most?) of the steps described by @martin-raden above.

If we get really ambitious, could probably even allow the user to provide a chatGPT/deepL/etc API key to auto-translate the first draft of the PO file.

@martin-raden
Copy link
Contributor

I think most important is to partly automate that the .mo files are generated as soon as .po file appear or change...

this would save problems and reduce actions on the devs' side..

or you can autogenerate a big bunch of translation files and request changes via PR in case the autogenerator fucked it up. In my case, I rephrased about 4-5 autogenerate translations. They were not totally wrong but (within the carpentry context) not fully fitting..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants