Currently, we show Translation prompts on /subscriptions page, some on /dashboard and /blog page.
Conditions for translation prompt:
translation-helper on their profileThe 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, :boom: :point_down: :sweat_smile:

Let's collect ideas and issues about improving translation prompts here. Thanks!
@jywarren @ebarry @steviepubliclab
Ooh, good observations!
A couple ideas.
On Thu, May 2, 2019, 2:51 PM Gaurav Sachdeva notifications@github.com
wrote:
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 " class=\"translation_missing\" title=\"translation missing:
ru.home.subscriptions.notes, fallback: false\">Notes" 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.orgthen, it would be something like:
Subscription page in English:
[image: eng_as_lang]
https://user-images.githubusercontent.com/20878070/57098593-1d60f380-6d38-11e9-960f-bd9a3455a295.pngSubscription page in Russian:
[image: russian_as_a_lang]
https://user-images.githubusercontent.com/20878070/57098645-42556680-6d38-11e9-8d26-1cbec91932b9.pngSo, 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, ๐ฅ ๐ ๐[image: bug]
https://user-images.githubusercontent.com/20878070/57099061-2acaad80-6d39-11e9-9720-147f9e8126fa.pngLet's collect ideas and issues about improving translation prompts here.
Thanks!โ
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/5651, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAF6J5FQLGOWIQFOB34U63PTMZZ7ANCNFSM4HKEEXWA
.
- We could exempt any string that includes < or > for now?
Ok. Sounds good!
- We might limit the # of prompts to 5 per page, using css pseudo
selectors.
Will give it a try.
Also, we want to show prompt only if a translation is not present for the current language in which we're browsing the website. Right?
Thanks!
Reopening as limiting the prompt number on screen part is remaining @jywarren
Hi @gauravano! If you can point me at where the JS is for selecting all the prompt insertion points on the page, I can add code to get only the first 5. We could do this in jQuery with an array range or with a pseudo selector (http://nthmaster.com/, kind of cool). Should be pretty easy!
For wrapping up #5737 , would we then want to gradually convert all pages' translation texts to the new system?
And then begin finding untranslated texts that can be added into the system? This would be a great task for GCI! cc @publiclab/reviewers @SidharthBansal @CoderJolly
Ah, i see, it's in Ruby, not JS. We could set an instance variable like @translations_count ||= 0; @translations_count += 1 and then skip any where it's >5?
Hi @gauravano do you think this would work? It seems an easy addition and I'm happy to make it!
Hi @jywarren, sorry missed your question. Thanks for stalebot for highlighting the mention ๐.
Ah, i see, it's in Ruby, not JS. We could set an instance variable like @translations_count ||= 0; @translations_count += 1 and then skip any where it's >5?
This can work, have to be tried. I am not sure because translation_helper lies in application_helper so count can be persisted ๐ค
Most helpful comment
Ok. Sounds good!
Will give it a try.
Also, we want to show prompt only if a translation is not present for the current language in which we're browsing the website. Right?
Thanks!