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

Sync translation infrastructure from foreman_plugin_template #11193

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Oct 29, 2024

What are the changes introduced in this pull request?

This copies the Makefile from foreman_plugin_template to resolve an issue with the time stamp handling and pulling in new translations that made it past 50%. See theforeman/foreman_plugin_template#65 & theforeman/foreman_plugin_template#57 for that.

It also ignores action_names.rb since that's now considered a best practice. Generated files do not belong in git. See theforeman/foreman_plugin_template#64.

Considerations taken when implementing this change?

It's now a draft since I see some changes and we should investigate those. A PR helps to centralize that discussion.

What are the testing steps for this pull request?

Update translations per standard practice and see that everything is properly updated.

Copy link
Member Author

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ianballou in the past we looked into this. Would you mind taking a look?

cc @sambible @chris1984 for visibility. We should merge this before we do the final pull with translations. Especially the .po.time_stamp handling previously caused issues where some languages weren't updated and thus missed translations.


%.mo: %.po
mkdir -p $(shell dirname $@)/LC_MESSAGES
msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $<
touch $(shell dirname $@)/LC_MESSAGES/$(MOFILE)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed that msgfmt doesn't always update the timestamp, if there are no changes. Now I'm unsure if this is still an issue after the time_stamp handling is fixed.

commit-translation-files: $(POFILES)
git add $(POFILES) $(POTFILE) $(ACTIONFILE) ../app/assets/javascripts/katello/locale
mo-files: $(MOFILES)
git add $(POFILES) $(POTFILE) $(JSFILES) ../locale/*/LC_MESSAGES
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ../locale/*/LC_MESSAGES part adds the .mo files and I think we ignore those here.

@ianballou
Copy link
Member

We'll get this reviewed soon.

@lfu
Copy link
Member

lfu commented Dec 3, 2024

Tested with

make -C locale tx-pull     # katello dir
bundle exec rake plugin:gettext[katello]     # foreman dir

Seems lots of new messages are picked up: https://www.jstoolset.com/diff/f830a909fc082b1d where left side file is the result from master and right side from this PR.

Not sure why message on this line is not updated in the translation file with this PR.

@lfu
Copy link
Member

lfu commented Jan 6, 2025

Tested again. Here is the comparison of locale/zh_CN/katello.po between master version (left side) and from this PR (right side).

The line in question from last comment has been picked up by this PR this time.
The result looks good to me. Out-dated messages have been removed and translation updates have been picked up when running with this PR.

@ianballou
Copy link
Member

@ekohl since this is still a draft, were any other changes expected?

@ekohl ekohl marked this pull request as ready for review January 7, 2025 20:24
@ekohl
Copy link
Member Author

ekohl commented Jan 7, 2025

@ianballou no, I needed to test it but thanks to @lfu that is now done.

@ianballou
Copy link
Member

I think this just needs a rebase

This copies the Makefile from foreman_plugin_template to resolve an
issue with the time stamp handling and pulling in new translations that
made it past 50%.

It also ignores action_names.rb since that's now considered a best
practice. Generated files do not belong in git.
@ekohl ekohl force-pushed the sync-translation-infra branch from d16e840 to 4c61c62 Compare January 7, 2025 22:48
@ekohl
Copy link
Member Author

ekohl commented Jan 7, 2025

Trivial rebase done.

Copy link
Member

@lfu lfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with latest commit. LGTM 👍

@ianballou
Copy link
Member

Re-running the failed jobs, seems the CI had a hiccup.

@ianballou ianballou merged commit 2607abb into Katello:master Jan 8, 2025
25 of 26 checks passed
@ekohl ekohl deleted the sync-translation-infra branch January 8, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants