-
Notifications
You must be signed in to change notification settings - Fork 12
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
Gettextize documentation #69
Conversation
cd03c82
to
976137b
Compare
Hey @rffontenelle ! This looks really good, thanks! I will check it out today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can handle the flatpak and meson stuff, but I have suggestions and questions:
- Rebase to the main branch.
- Move
po-docs
todocs/po
, it will make it easier to find and simpler for meson stuff. - Remove
docs/basics/es/index.md
, since this file will be generated anyway. - Rename
gamegeeky-docs.pot
togameeky.pot
- Is it possible to make
po4a
preserve lines as they are in the source md file? I noticed the translations are broken into multiple lines.
@tchx84 May I suggest moving Also, should I remove translated html too? |
It would complicate one thing on meson side (when installing those files, one file, en, would be a special case) but if you feel strongly about it, sure!
|
Fixed the requested changes, but I'm still trying to figure out:
So far I found a |
f48b4f7
to
ac28e7e
Compare
@rffontenelle Note that I pushed the "basic" integration bits to your branch, e.g. flatpak packaging and meson build steps... regarding instructions for managing this maybe you can add some notes here |
This won't make it to the next release, but I wanted to share a concern with po4a dependencies. I am currently trying to make Gameeky easier to run on MacOS and Windows and, since It wasn't trivial to make package po4a for Flatpak, I worry that it could make things a bit more complicated that needs to be for other platforms. I wonder if the alternatives are good enough, e.g., https://github.com/mondeja/mdpo. |
No problem, I'll try mdpo and get back to you. Sorry for taking long for landing the requested changes. One thing that I was wondering is whether we can make things easier in the documentation. For UI, it is to run |
No worries, we do what we can, and eventually we will land this.
Yes, I can figure that out after I am done with this new release. |
Is there an better way to get the project's version than |
yes, parse the data/dev.blah.blah.metainfo.xml file |
ac28e7e
to
9704e59
Compare
Let's go for another shot, now using mdpo. TL;DR: I liked it. The PO generation command (md2po) ignores code blocks by default (which are just code, no translation is done actually), it treats warning blocks correctly (no no-wrap flag, no The Markdown file generation from PO (po2md) has option to generate without line-wrap (exactly what you asked, as are the Markdowns today). Both have --quiet option, but we could remove it for more verbosity in GitHub Actions, for instance.
|
I'd like to note that if/when you choose to use Weblate as a translation platform, you'll probably not want to update the PO files. Instead, you'll want to update only the POT file and leave for Weblate to update PO files via the "Update PO files to match POT (msgmerge)" add-on. Updating PO files locally could cause annoying merge conflicts. |
@rffontenelle awesome, I will check this out ASAP.. Many thanks |
@rffontenelle let me know when you're done with this, because I will need to do some "surgery" in this branch to get it ready :) |
@tchx84 The only detail that I think we should define is the target languages. I implemented POT regeneration and update of all PO, but this causes to hardcode enabled language codes in the script. However they are also set in docs/meson.build to generate html file. One idea I had now is to implement an argument specifically for regenerating POT and otherwise reading language codes from stdin so that you can run meson.build passing only the enabled languages. Feedback is appreciated |
I think is this OK, the costs of ignoring regenerated files is less than making the building process more complex by having to specify parameters somewhere else. Don't worry too much about these details, I will figure out how to integrate this into meson. All I need to know is if your're done with the structure / translation pieces, so I can start refactoring the code on this branch to be able to merge it :)
|
Yeah, I'm good. Feel free to make your changes. |
Translating in a PO file is easier than directly in
docs/basics/LANG/index.md
. po4a is able to extract from source Markdown documents to PO/POT files and to convert it back.I managed to copy the Spanish translation from the current Spanish doc into the PO file and looks like it was generated without issue (I advise a review).
Some example of commands (from
po-docs
docs/po
dir):po4a --no-translations po4a.cfg
- Extract from source docs to POT file and PO filespo4a --no-update po4a.cfg
- Builds the translated docs in docs/basics/LANG/index.mdpo4a po4a.cfg
- Extract to POT/PO and build translated docsThings to improve in this suggestion:
meson compile
timeAnyway, this works, but needs more integration with the project build process. Suggestions or adding commits to this PR are welcome.
EDIT in 19/02/2024: updated the docs PO file's path.