-
Notifications
You must be signed in to change notification settings - Fork 5
Wire up translations #104
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
Wire up translations #104
Conversation
AlfioEmanueleFresta
left a comment
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.
Awesome stuff! 🗺️
AlfioEmanueleFresta
left a comment
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.
LGTM!
iinuwa
left a comment
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.
Thanks for putting so much work into this: this will really help us expand our reach.
I'm not familiar with managing internationalization with gettext, so I can't give much more feedbacl. I just had one question below.
| "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | ||
|
|
||
| #. Insert your license of choice here | ||
| #. <project_license>LGPL-3.0-only</project_license> |
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.
Could you explain more about the issue that occurs here?
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.
When running meson compile credentialsd-ui-pot, the license-field gets automatically filled with MIT, and one has to manually revert that change back to LGPL, before committing.
I have not found a way to tell gettext to use the correct license here when it auto-generates the file.
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.
Can't we skip checking in this file? In another project where we use gettext, we only check in the .po files.
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.
In principle, yes. But the .po-files have the same problem with the license-string.
And it may be a tiny bit easier to add new languages with the pot-file there (although that may be debatable).
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.
In the other project, msgmerge which update the .po file doesn't enforce any license on the .po file. I'll try your branch later today and see if I can tame the tools here as well ;)
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.
Ok, I looked closer into this. It is actually not any metadata about the project, it's only some surrounding context to help the translator for the next string to translate, "Credential Manager". It's extracted from data/xyz.iinuwa.credentialsd.CredentialsUi.metainfo.xml.in.in so that's where we should change.
I'm not sure if the strings in data/xyz.iinuwa.credentialsd.CredentialsUi.metainfo.xml.in.in are translated in the app so maybe easier to just remove that file from credentialsd-ui/po/POTFILES.in
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.
Oh, wow. Now that you say it, it's so obvious. 🤦
Thank for digging into that! That file needs to be reworked completely anyways. I'm leaving it in for now.
4f1cd15
|
Merged in 0f77670. Closing. Thank you! |
This isn't great yet, but it's working.
Esp. running
meson compile credentialds-ui-potthrows a bunch of warnings/errors, but it actually does the right thing. I'm not really used to meson, so I may be holding it wrong somewhere.Also, I have found no nice way to auto-fill some of the field that
xgettext()creates for the pot-file (like which license we use). So these get overwritten now with everymeson compile credentialds-ui-potand have to be manually reverted.And finally: I also have found no way to exclude some strings (e.g.
translatable=no|false|etc.does not work), so these also have to be manually removed after the generation step.