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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.
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.

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