onionshare
onionshare copied to clipboard
Text doesn't appear in UI Arabic localisation
Text doesn't appear in the Arabic locale in OnionShare 2.1 on Ubuntu 16.04
The name of Arabic language in Arabic itself doesn't ever appear in the list of UI localisations in the settings dialogue, even when the effective locale is not Arabic.
Moreover, when the Arabic localisation itself is chosen -- and effected with a restart -- all Arabic strings in the UI do not appear as well.
See two attached screenshots.
Hi @agharbeia, thank you for translating OnionShare into Arabic! The list of languages that you can choose is defined by the self.available_locales
variable in onionshare/settings.py
: https://github.com/micahflee/onionshare/blob/develop/onionshare/settings.py#L59
So unfortunately just adding a ar.json
alone won't do it. The git repo has JSON files for lots of languages that aren't finished yet, so they only get enabled when they're added to that list.
I just made a new git branch for you called arabic_locale, which merges in the Arabic translations from weblate, and also adds العربية to the list of languages.
I just built a .deb (and PGP-signed it with my key) of this version that includes Arabic: onionshare_arabic_deb.zip
Thanks for the explanation, @micahflee But I experienced this issue with the package installable from Ubuntu's repository which did already have some Arabic localisation, before my attempt to test the localisation I worked on.
Also, is it currently possible to support left-to-right in the interface?
Have you been able to reproduce this in the current release, @micahflee ? I mean with the Arabic localisation already packaged with version 2.1?
@agharbeia sorry about taking so long to respond!
Even though the Ubuntu package for OnionShare 2.1 includes Arabic translations in /usr/share/onionshare/locale/ar.json
, you can't actually use them in that version of OnionShare. This is because we include a copy of all translation files, even ones that are totally incomplete, but only enable the translations that are finished.
For Arabic to appear in the dropdown list, it needs to be listed as a language in the available_locales
variable inonionshare/settings.py
. As you can see here, the available locales for version 2.1 doesn't include Arabic:
# Dictionary of available languages in this version of OnionShare,
# mapped to the language name, in that language
self.available_locales = {
#'bn': 'বাংলা', # Bengali (commented out because not at 90% translation)
'ca': 'Català', # Catalan
'zh_Hant': '正體中文 (繁體)', # Traditional Chinese
'zh_Hans': '中文 (简体)', # Simplified Chinese
'da': 'Dansk', # Danish
'en': 'English', # English
'fi': 'Suomi', # Finnish
'fr': 'Français', # French
'de': 'Deutsch', # German
'el': 'Ελληνικά', # Greek
'is': 'Íslenska', # Icelandic
'ga': 'Gaeilge', # Irish
'it': 'Italiano', # Italian
'ja': '日本語', # Japanese
'nb': 'Norsk Bokmål', # Norwegian Bokmål
#'fa': 'فارسی', # Persian (commented out because not at 90% translation)
'pl': 'Polski', # Polish
'pt_BR': 'Português (Brasil)', # Portuguese Brazil
'pt_PT': 'Português (Portugal)', # Portuguese Portugal
'ru': 'Русский', # Russian
'es': 'Español', # Spanish
'sv': 'Svenska', # Swedish
'te': 'తెలుగు', # Telugu
'tr': 'Türkçe', # Turkish
'uk': 'Українська', # Ukrainian
}
Sorry about that. Once we make the first release where Arabic is included there, then it should work fine to just update your ar.json
file.
And at the moment, right-to-left text isn't supported in the interface, but I'd love to support if for languages like Arabic. I don't know how it's supposed to work though because I only read English. In the settings dialog should the checkboxes and the radio buttons be on the right side of the label instead of the left?
Thanks for the explanation. I didn't know the rationale behind not enabling the Arabic locale in the release, an so thought it was an omission. Regarding RTL, yes, ideally, everything should be mirrored. UI toolkits succeed in that with varying degrees. some resources I found:
- https://code.briarproject.org/briar/briar/wikis/translation-workflow/rtl-language-testing
- https://medium.freecodecamp.org/designing-for-the-arab-user-basic-arabic-ux-for-business-6ff29d4c7c60
At its most basic level, a working RTL implementation should at least guarantee that strings appear in the right order, even when BiDi algorithm is at play, such as with cases of having LTR-scripts embedded within RTL-scripts. In the screenshot above all strings that have Latin script words have their order mingled and are unreadable.