grosser / gettext_i18n_rails

Rails: FastGettext, I18n integration -- simple, threadsafe and fast!
MIT License
268 stars 91 forks source link

Add support for translation context in HAML #201

Closed adam-h closed 1 year ago

adam-h commented 1 year ago

Resolving: https://github.com/grosser/gettext_i18n_rails/issues/199

Note that this removes support for very old versions of gettext too as this uses the ruby parser which was refactored in 3.0.0 (2013). The development dependency is 3.0.2 so I think this should be OK.

See individual commits for details, key change is in:

Switch out haml and slim parsers to use GetText::RubyParser

We now just parse the haml or slim to ruby code and then hand it off to the GetText::RubyParser to actually extract the strings into the PO format.

This adds support for translations with context (p_("My Context", "id_key")) and removes the custom ruby extractor entirely.

It also fixes the 'pending' spec for slim to parse ruby 1.9 syntax.

grosser commented 1 year ago

nice!

grosser commented 1 year ago

1.12.0 🤞