[tor-bugs] #17344 [Tor Launcher]: language prompt should enumerate available langpacks
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Oct 13 20:25:22 UTC 2015
#17344: language prompt should enumerate available langpacks
--------------------------+-----------------------
Reporter: mcs | Owner: brade
Type: defect | Status: new
Priority: Medium | Milestone:
Component: Tor Launcher | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: #12967 | Points:
Sponsor: |
--------------------------+-----------------------
Changes (by mcs):
* severity: => Normal
Comment:
Code like the following can be used to enumerate the installed language
add-ons:
{{{
let { AddonManager } =
Cu.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonsByTypes(["locale"], function(aList)
{
for (let addon of aList)
{
let uri = addon.getResourceURI("");
dump(addon.id + ": name: \"" + addon.name + "\", uri: " + uri.spec +
"\n");
}
});
}}}
The output from the above code looks like this:
{{{
langpack-es-ES at firefox.mozilla.org: name: "Español (España) Language
Pack", uri: file:///Users/brade/Desktop/tb-
esr38.app/TorBrowser/Data/Browser/profile.default/extensions/langpack-es-
ES at firefox.mozilla.org.xpi
langpack-da at firefox.mozilla.org: name: "Dansk (da) Language Pack", uri:
file:///Users/brade/Desktop/tb-
esr38.app/TorBrowser/Data/Browser/profile.default/extensions/langpack-
da at firefox.mozilla.org.xpi
langpack-de at firefox.mozilla.org: name: "Deutsch (DE) Language Pack", uri:
file:///Users/brade/Desktop/tb-
esr38.app/TorBrowser/Data/Browser/profile.default/extensions/langpack-
de at firefox.mozilla.org.xpi
}}}
There does not seem to be an easy way to determine the locale (e.g., es-
ES), so we may need to extract it from the id or uri. Similarly, we may
need to obtain a language name to show to the user by parsing the name
property (ugh). We can also include a locale-to-name lookup table in our
code for the language packs we currently include in our packages.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17344#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list