We should start localizing the user-facing parts of snowflake. Right now that is just the browser-based proxy, but eventually it will include the WebExtension version.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
One thing is that Snowflake translations have their own project in Transifex, so I will need saint to give me access to it to manage the translations. I will ask Erin from LocLab to get me access.
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".
Nice, this looks good to merge what we have right now.
It looks like while the webextension locale is set automatically once we populate the _local folder with translations, but do we need to do something more for the proxy page? Right now it looks like it will only display the English strings: R174
I like the modification from #31109 (moved) to just display that the snowflake is ready if there are zero users.
Awesome, this looks good. Just a few clarification questions:
Does call to writeFileSync with data from availableLangsR43 do the same as copying the translated files in a previous commit: R78? Do we need to remove the copy logic for the proxy if so?
Do we need to manually update the submodule when there are new translations before they become available?
Does call to writeFileSync with data from availableLangs R43 do the same as copying the translated files in a previous commit: R78? Do we need to remove the copy logic for the proxy if so?
No, the writeFileSync in R43 is concatenating code to the embed.js file so that the known availableLangs are present there.
The copying in R78 is moving the completed translations to a web accessible place, to be fetched based on the availableLangs.
Do we need to manually update the submodule when there are new translations before they become available?
The translation.git repo will be updated automatically when new translations are completed. However, when we're ready to make a new release, we do need to manually update the submodule beforehand. So, git submodule update --remote, then git add, commit, push. Followed by whatever regular release steps we do.
Does call to writeFileSync with data from availableLangs R43 do the same as copying the translated files in a previous commit: R78? Do we need to remove the copy logic for the proxy if so?
No, the writeFileSync in R43 is concatenating code to the embed.js file so that the known availableLangs are present there.
The copying in R78 is moving the completed translations to a web accessible place, to be fetched based on the availableLangs.
Do we need to manually update the submodule when there are new translations before they become available?
The translation.git repo will be updated automatically when new translations are completed. However, when we're ready to make a new release, we do need to manually update the submodule beforehand. So, git submodule update --remote, then git add, commit, push. Followed by whatever regular release steps we do.