mainio / decidim-module-term_customizer

Decidim module that allows customizing the localization terms in the system for specific contexts.
GNU Affero General Public License v3.0
16 stars 21 forks source link

Use i18n_key_finder in order to understand where translation keys display on the app #36

Open virgile-dev opened 4 years ago

virgile-dev commented 4 years ago

Hello @ahukkanen,

Thanks a lot for this module, it's sooooo useful. Some of our client use it but are not as savy when it comes to understanding where the key they are translating is going to apply.

Alain, our CTO, shared with me this gem https://github.com/piotr-szachewicz/rails-i18n-key-finder which shows the translation keys in the front-end.

It would be great for the admin to have some kind of visual approach when it comes to adding custom keys.

Capture d’écran 2020-06-18 à 17 26 52

What do you think ?

ahukkanen commented 4 years ago

Something along these lines would be definitely useful.

I would prefer this to be implemented so that:

  1. The admin user would enter into a "translation mode" from the admin dashboard
  2. The admin user would go to the front-end where there would be now a floating button or toolbar where they could enable the display of the translation keys
  3. The admin user would click the button to enable the display of the translation keys
  4. Now, they could hover over any translatable string and it would "light up" with an overlay color
  5. When they click the overlay color, they would see the translation key for that string and also two buttons:
    • Copy the key to clipboard
    • Customize this term => this would take them to the dashboard with the new translation form pre-filled
  6. Finally, the admin user would exit the "translation mode" when the controls would disappear

Something along these lines but in Decidim's context: https://youtu.be/gUpRLc79eJE

We don't have the need or resources to implement this right now but pull requests are of course welcome.

armandfardeau commented 4 years ago

Hello @ahukkanen, would you be pleased if we proposed a minimal implementation of what you described? The idea is to verify that the translation mode meets a real need before continuing to improve it.

ahukkanen commented 4 years ago

Yeah, of course @armandfardeau, very pleased. We gotta start somewhere.

It's already quite minimal for the described need as specified. I'm mostly just worried in the original proposal that if we display the translation keys directly in the view, that could lead to layout problems and would not probably be very useful for other than technical users.