Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mistranslated BiDi Brackets

My team got a bug report (bsc#1127563) about misplaced brackets in Arabic translation:

comparison of Arabic and English screen contents

Looking at the first problematic line, "Total System Memory", notice that the Arabic translation has both square brackets in the right-hand version. Let's check the corresponding translations file.

screenshot of the PO file as displayed by GitHub

At the first sight we see a matching left+right bracket, but that is misleading, since they are not in the correct place. The GitHub rendering of that line is confused by the msgstr prefix, which incorrectly sets the line up for Left-to-Right rendering.

I find it best to diagnose problems with bidirectional text by displaying each character on a separate line, so I set up a simple web application for it. See how the bidi-debugger tool displays this translation:

m
s
g
s
t
r

"
إ
ج
م
ا
ل
ي

[...]

]
م
ي
ج
ا
ب
ا
ي
ت
]
:
"

Now we have a proof that the error is in the translated text. Likely the translator got confused by a tool that used the wrong directionality, like the GitHub rendering above.

Tools that handle translations of bidirectional text correctly, by showing the translation alone (without the msgstr prefix):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.