Skip to content

Translation prompt improvement #5651

Open
@grvsachdeva

Description

@grvsachdeva

Currently, we show Translation prompts on /subscriptions page, some on /dashboard and /blog page.

Conditions for translation prompt:

  1. translated_string.length > 3 - If translated string has length greater than 3
  2. current_user &.has_tag('translation-helper') - User has tag translation-helper on their profile
  3. !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:

eng_as_lang

Subscription page in Russian:

russian_as_a_lang

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, 💥 👇 😅

bug

Let's collect ideas and issues about improving translation prompts here. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Translation Systemissues which involve adding new translations, improving the translation systemdiscussionenhancementexplains that the issue is to improve upon one of our existing features

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions