manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

Update dependency gettext_i18n_rails_js to "~>1.4.0"

Open renovate[bot] opened this issue 6 months ago • 12 comments

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
gettext_i18n_rails_js "~>1.3.0" -> "~>1.4.0" age adoption passing confidence

Release Notes

webhippie/gettext_i18n_rails_js (gettext_i18n_rails_js)

v1.4.0

Compare Source

  • Added support for doing conversion for different domains and rails engines (@​adamruzicka)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

renovate[bot] avatar Oct 06 '25 19:10 renovate[bot]

@kbrock @jrafanie Did we ever figure out the quotes issue here? Did https://github.com/webhippie/gettext_i18n_rails_js/pull/55 break us?

Fryguy avatar Oct 17 '25 18:10 Fryguy

yeah, it broke us... I haven't come back to it yet

jrafanie avatar Oct 17 '25 20:10 jrafanie

I'm pretty sure I fixed it. But then that other change went in. Maybe we ended up double doing that stuff

I haven't revisited either

kbrock avatar Oct 17 '25 23:10 kbrock

Which other change? If you mean the Po to Json change, that only kicks in after we create the Po and merge it. The changes in the latest version break the po generation itself.

Fryguy avatar Oct 17 '25 23:10 Fryguy

Do we have a simple (bash?) reproducer here?

@jrafanie You want to pair Monday?

kbrock avatar Oct 18 '25 14:10 kbrock

@kbrock You can just run rake locale:update_all with this PR

Fryguy avatar Oct 20 '25 13:10 Fryguy

@kbrock You can just run rake locale:update_all with this PR

you'll need a i18n database to run that:

i18n:
  <<: *base
  database: vmdb_i18n

jrafanie avatar Oct 20 '25 13:10 jrafanie

I was trying to build something isolated, but I think gettext_i18n_rails_js needs an entire rails project

Fryguy avatar Oct 20 '25 13:10 Fryguy

BTW, note that the latest version is actually 2.2.2 - not sure why we are still on 1.x

Fryguy avatar Oct 20 '25 13:10 Fryguy

ok, I created an isolated rails project.

TL;DR: gettext is in charge of creation of the pot and it does it correctly.

  • I'm not seeing the error we are seeing in miq.
  • So we introduced the issue.
  • This issue is no where near the _js gem. This is an error with pot generation.

So we probably introduce an issue via our code...

  • We monkey patched/broke the ruby extraction code (i.e. extract from _() in ruby files)
  • We introduce an issue with the code that concatenates yaml and ruby extraction.

Details

gem version miq latest notes
ruby 3.4.7 3.1.?
rails 8.0.3 7.1.*
fast_gettext 3.1.0 4.1.0 tried with and without this gem
gettext 3.5.1
gettext_i18n_rails 2.0
gettext_i18n_rails_js 2.2.2 1.3.1

I scaffold'd users, modified users/index.html.erb and ran rake gettext:find.

I did a simple rake gettext:find which is essentially calls rake gettext:po:update

html.erb convert quotes `locale/app.pot
_("All1 'Users'")) "All1 'Users'" "All1 'Users'"
_("All2 \'Users\'") "All2 'Users'" "All2 \\'Users\\'"
_("All3 \"Users\"") "All3 \"Users\"" "All3 \"Users\""
_('All4 "Users"') "All4 \"Users\"" "All4 \"Users\""
_('Show5 this \'user\'') "Show5 this 'user'" "Show5 this 'user'"
_('New6 \"user\"') "New6 \\\"user\\\"" "New6 \\\"user\\\""

Case 2 and 5 are unnecessary escaping. case 2 is what I expected the output to be, but technically incorrect for ruby. (unsure in the js, handlebars, and other cases) Not sure we should squabble over error cases.

kbrock avatar Oct 21 '25 13:10 kbrock

Yea. That or that I added was buggy. Got a pr in there and hopefully this will all be fixed

kbrock avatar Oct 23 '25 06:10 kbrock

@kbrock Any updates here?

Fryguy avatar Nov 19 '25 16:11 Fryguy