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

Remove unused gettext-setup dependency #91

Merged
merged 1 commit into from
Nov 1, 2021

Conversation

bastelfreak
Copy link
Collaborator

This patch removes the dependency to gettext-setup. My understanding is
that this was a preparation to support multiple locales/languages within
the whole puppet ecosystem. I also heard that this plan was cancelled.
Also this gem has no locales. On the other side pulling gettext-setup in
raises several issues. The puppet gem starts it's locale logic if the
gem is present and that raises some errors, for example
https://tickets.puppetlabs.com/browse/MODULES-6598

Another issue is that https://github.com/puppetlabs/gettext-setup-gem
isn't maintained at all. The dependencies aren't up2date, no response
to open PRs since 1.5 years. This is also blocking the current vox
pupuli modulesync run.

Copy link
Contributor

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

You need to replace all _() calls as well since that's the actual translations.

This patch removes the dependency to gettext-setup. My understanding is
that this was a preparation to support multiple locales/languages within
the whole puppet ecosystem. I also heard that this plan was cancelled.
Also this gem has no locales. On the other side pulling gettext-setup in
raises several issues. The puppet gem starts it's locale logic if the
gem is present and that raises some errors, for example
https://tickets.puppetlabs.com/browse/MODULES-6598

Another issue is that https://github.com/puppetlabs/gettext-setup-gem
isn't maintained at all. The dependencies aren't up2date, no response
to open PRs since 1.5 years. This is also blocking the current vox
pupuli modulesync run.
bastelfreak added a commit to bastelfreak/voxpupuli-test that referenced this pull request Aug 26, 2021
@bastelfreak
Copy link
Collaborator Author

did you spot any remaining _() calls? I reverted the initial commit d68963e9d81f060a42e379299068450b59e870bd but had to do a lot of rebasing to get it working. I didn't find any remaining calls for _() .

if proxy = env[:request][:proxy]
errmsg = _("Unable to connect to %{scheme}://%{host} (using proxy %{proxy}) (for request %{path_query})") % {
errmsg << ("Unable to connect to %{scheme}://%{host} (using proxy %{proxy}) (for request %{path_query})") % {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look correct.

Suggested change
errmsg << ("Unable to connect to %{scheme}://%{host} (using proxy %{proxy}) (for request %{path_query})") % {
errmsg = ("Unable to connect to %{scheme}://%{host} (using proxy %{proxy}) (for request %{path_query})") % {

Same below. Also, you shouldn't introduce the single errmsg variable above the loop.

Or you can append, but then you should do this:

Suggested change
errmsg << ("Unable to connect to %{scheme}://%{host} (using proxy %{proxy}) (for request %{path_query})") % {
errmsg << " (using proxy #{proxy})"

And then also drop the other errmsg << in the else.

@bastelfreak
Copy link
Collaborator Author

Hey forge team, could I get a review here? :)

Copy link
Contributor

@caseywilliams caseywilliams left a comment

Choose a reason for hiding this comment

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

Thank you very much, @bastelfreak, and our apologies for the delay here! This looks good to me - we'll do a release later this week.

@caseywilliams caseywilliams merged commit 19457cc into puppetlabs:main Nov 1, 2021
@ekohl
Copy link
Contributor

ekohl commented Nov 1, 2021

I'm slightly surprised my comments from #91 (comment) weren't addressed. You will have a regression where the error message is essentially duplicated since it concats.

@caseywilliams
Copy link
Contributor

Hi @ekohl - I'm out today but I do plan to do some more cleanup here before we release this week - I'll be making sure your comments are addressed

@caseywilliams
Copy link
Contributor

Thanks very much to @bastelfreak and @ekohl for your efforts here - version 3.2.0 has been released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants