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

Add internationalisation support for docs #2224

Merged
merged 6 commits into from
Feb 3, 2025
Merged

Add internationalisation support for docs #2224

merged 6 commits into from
Feb 3, 2025

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Feb 2, 2025

Summary:

This PR adds a translation setup for the documentation based on @Karduin's work discussed in #1834.

The necessary commands have been added to pkgutils.py and can be listed with pkguitls.py --help. However, the needed commands for French are:

To update the sources for translation, run:

./pkgutils.py docs-lupdate fr

This will generate or update the *.po files for the specified language code (multiple codes are possible). The translation files are then available under docs/source/locales/fr/LC_MESSAGES. When translated, the *.po files should be committed to the repository.

To build the manual, run:

./pkgutils.py docs-lrelease fr

The manual should then appear as: novelwriter/assets/manual_fr.pdf.

Related Issue(s):

Discussion #1834

Reviewer's Checklist:

  • The header of all files contain a reference to the repository license
  • The overall test coverage is increased or remains the same as before
  • All tests are passing
  • All flake8 checks are passing and the style guide is followed
  • Documentation (as docstrings) is complete and understandable
  • Only files that have been actively changed are committed

@vkbo vkbo added this to the Release 2.7 Beta 1 milestone Feb 2, 2025
@vkbo
Copy link
Owner Author

vkbo commented Feb 2, 2025

@Karduin, I think this is enough for you to submit the files you already have. Feel free to test it if you want to, but wait until I've merged this before you make a pull request with the files.

Also, docs/source/locales/authors_fr.conf is used to keep a record of translation authors. Feel free to also edit the name in there. I added your GitHub username.

It looks like it's only necessary to keep the *.po files in the repo, I won't add the *.pot and of course not the *.mo files.

@Karduin
Copy link
Contributor

Karduin commented Feb 3, 2025

After installing PyQt6 it works.
I've updated the only modified file (index.po).

do I also have to generate the pdf or is it done automatically?

ps: sorry for this question, but I'm not familiar with PR and I don't want to do anything stupid.
Do I have to create a different branch of main like docs_fr or do I PR from main.

@vkbo
Copy link
Owner Author

vkbo commented Feb 3, 2025

First, I will merge this now that we know it works. I can see that you've already forked this repository, but you need to update your copy of the main branch after I merge this one.

After that, you can follow this guide.

@vkbo vkbo merged commit 52f1c31 into main Feb 3, 2025
8 checks passed
@vkbo vkbo deleted the docs_i18n branch February 3, 2025 19:05
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

Successfully merging this pull request may close these issues.

2 participants