summaryrefslogtreecommitdiff
path: root/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@gnu.org>2018-09-13 20:39:48 -0400
committerRuben Rodriguez <ruben@gnu.org>2018-09-13 21:02:13 -0400
commitd26b319fd6f98517cc3421f10bf18698b953e4d2 (patch)
treebc70c4e472a2eaf514d411dba5067d530e5bbea9 /data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js
parentc3b304c51a3386ea09527a479a883253ea35243a (diff)
Updated extensions list for v60
Diffstat (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js')
-rw-r--r--data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js
deleted file mode 100644
index 22ed58c..0000000
--- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/l10n.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const global = this;
-const {Cc,Ci,Cu} = require("chrome");
-Cu.import("resource://gre/modules/Services.jsm", global);
-
-exports.locale = Cc["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Ci.nsIXULChromeRegistry).getSelectedLocale("global");
-
-exports.l10n = (function(global) {
- let splitter = /(\w+)-\w+/;
-
- // get user's locale
- let locale = exports.locale;
-
- function getStr(aStrBundle, aKey) {
- if (!aStrBundle) return false;
- try {
- return aStrBundle.GetStringFromName(aKey);
- } catch (e) {
- //console.log(e);
- }
- return "";
- }
-
- function l10n(options) {
- var filename = options.filename;
- var baseURL = options.baseURL;
- var defaultLocale = options.defaultLocale || "en";
- function filepath(locale) {
- var path = baseURL + "/" + locale + "/" + filename;
- //console.log(path);
- return path;
- }
-
- let defaultBundle = Services.strings.createBundle(filepath(locale));
-
- let defaultBasicBundle;
- let (locale_base = locale.match(splitter)) {
- if (locale_base) {
- defaultBasicBundle = Services.strings.createBundle(
- filepath(locale_base[1]));
- }
- }
-
- let addonsDefaultBundle =
- Services.strings.createBundle(filepath(defaultLocale));
-
- return _ = function l10n_underscore(aKey, aLocale) {
- let localeBundle, localeBasicBundle;
- if (aLocale) {
- localeBundle = Services.strings.createBundle(filepath(aLocale));
-
- let locale_base = aLocale.match(splitter)
- if (locale_base)
- localeBasicBundle = Services.strings.createBundle(
- filepath(locale_base[1]));
- }
-
- var x = getStr(localeBundle, aKey)
- || getStr(localeBasicBundle, aKey)
- || getStr(defaultBundle, aKey)
- || getStr(defaultBasicBundle, aKey)
- || getStr(addonsDefaultBundle, aKey);
- return x;
- }
- }
-
- return l10n;
-})(this);
-
-require("unload").when(Services.strings.flushBundles);
-