Description
Currently, we show Translation prompts on /subscriptions page, some on /dashboard and /blog page.
Conditions for translation prompt:
- translated_string.length > 3 - If translated string has length greater than 3
- current_user &.has_tag('translation-helper') - User has tag
translation-helper
on their profile - !translated_string.include?("translation missing") - There shouldn't be "translation missing" in the translated_string. This effectively means we show translation prompt only in case where translation is present.
The condition 3 is buggy or I would say totally wrong. Why? Because, previously we were running only 3 langs and in those while testing I got a span with translation missing, something like "<span class=\"translation_missing\" title=\"translation missing: ru.home.subscriptions.notes, fallback: false\">Notes</span>"
but this would be returned when the translation key is not found in any locale yes, not in en.yml too but in all other cases we would get something i.e., either a translated value in the Russian. japan, etc or a English string because we fallback to English.
Let's say, we want to show prompt only in case a translation is missing in the language we are browsing publiclab.org
then, it would be something like:
Subscription page in English:
Subscription page in Russian:
So, you can see so many prompts because we have less Russian translations. So, what should be the conditions in which prompt should be visible?
Bugs to solve: currently, we directly wrap the returned translation in the span(prompt is made using span element), but we don't get string always in translated value some times it is code too and in those cases, 💥 👇 😅
Let's collect ideas and issues about improving translation prompts here. Thanks!