Issue #175 new

Feedback page: untranslated strings are getting filled in with prevous language instead of English

Adam Pritchard
created an issue

Reproduction

  1. Open the feedback page.
  2. Switch language to one that's full translated (Chinese, Farsi, Russian).
  3. Switch language to one that's not fully translated.
  4. You will see instances of the first language showing in the second.

Problem

It's arguable that this is actually a bug and not a feature. For example, if the Uzbek translation is incomplete, perhaps they'd like the fallback language to be Russian rather than English.

But the potential for doing this is not surfaced in any way, and will likely just be confusing for a user who is switching between languages. It is probably better to have a single default language -- English.

Code

When the user switches languages, the keys in the target language's langJSON entry are iterated through, filing in matching page elements. But for a language with no translation, the entry looks like this: 'kk': {} -- no keys, no iterating, no element replacement.

Fix

The best fix is probably to, in feedback.html.tpl, mix in the English translation before doing the key-iterating.

Alternatively, the English could be mixed into the incomplete structure upstream in psi_feedback_templates.py or transifex_pull.py. But I think this is more special-case-y and brittle. Better to keep knowledge of what's needed nearer to where it's used.

Comments (0)

  1. Log in to comment