[tor-bugs] #30310 [Circumvention/Snowflake]: Snowflake localization
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Jul 23 19:14:07 UTC 2019
#30310: Snowflake localization
-------------------------------------------------+-------------------------
Reporter: cohosh | Owner: arlolra
Type: task | Status:
| needs_review
Priority: Medium | Milestone:
Component: Circumvention/Snowflake | Version:
Severity: Normal | Resolution:
Keywords: l10n, snowflake-webextension, anti- | Actual Points:
censorship-roadmap-august |
Parent ID: | Points:
Reviewer: | Sponsor:
| Sponsor28-can
-------------------------------------------------+-------------------------
Comment (by dcf):
This implementation looks good.
* It may be worth doing the `/^__MSG_([^_]*)__$/` HTML replacement
recursively on every element, to reduce coupling between popup.html and
popup.js.
* The popupStatusOn and popupDescOn strings are going to result in
displays like "1 clients connected" and "Your snowflake has helped 1
users". Splitting into singular/plural strings isn't enough, because
Polish and Russian may need more distinctions depending on how it is
phrased ("1 użytkownik", "2 użytkownicy", "5 użytkowników). We may need
some custom logic here, something like
{{{
const numUsersStringEN = (n) => if (n == 1) { return "1 user"; } else {
return String(n) + " users"; };
const NUM_USERS_STRING = new Map([
"en": (n) => numUsersStringEN,
"fr": (n) => if (n == 1) { return "1 client"; } else { return String(n)
+ " clients"; },
"pl": (n) => {
if (n == 1) {
return "1 użytkownik";
}
let d = n % 10;
if ((d == 2 || d == 3 || d == 4) && n < 10 && n >= 20) {
return String(n) + " użtkownicy";
}
return String(n) + " użytkowników";
},
]);
function numUsersString(n) {
return (NUM_USERS_STRING.get(chrome.i18n.getUILanguage()) ||
numUsersStringEN)(n);
}
...
popup.setStatusText(chrome.i18n.getMessage('popupStatusOn',
numUsersString(clients)));
}}}
An alternative is to rephrase the UI so it's less dependent on grammar:
"Number of users helped: 1".
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30310#comment:11>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list