author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/gamma/js/Clipperz/PM/Strings.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/Strings.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/Strings.js | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/Strings.js b/frontend/gamma/js/Clipperz/PM/Strings.js index a051365..7e855ff 100644 --- a/frontend/gamma/js/Clipperz/PM/Strings.js +++ b/frontend/gamma/js/Clipperz/PM/Strings.js | |||
@@ -1,46 +1,44 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } | 26 | if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } |
29 | if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } | 27 | if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } |
30 | 28 | ||
31 | //----------------------------------------------------------------------------- | 29 | //----------------------------------------------------------------------------- |
32 | /* | 30 | /* |
33 | Clipperz.PM.Strings.standardStrings = { | 31 | Clipperz.PM.Strings.standardStrings = { |
34 | 'loginPanelSwitchLanguageSelectOptions':[ | 32 | 'loginPanelSwitchLanguageSelectOptions':[ |
35 | / * | 33 | / * |
36 | {tag:'option', html:"Arabic (Oman) (العربية)", value:'ar-OM', disabled:true}, | 34 | {tag:'option', html:"Arabic (Oman) (العربية)", value:'ar-OM', disabled:true}, |
37 | {tag:'option', html:"Arabic (Syria) (العربية)", value:'ar-SY', disabled:true}, | 35 | {tag:'option', html:"Arabic (Syria) (العربية)", value:'ar-SY', disabled:true}, |
38 | {tag:'option', html:"Bahasa Indonesia", value:'id-ID', disabled:true}, | 36 | {tag:'option', html:"Bahasa Indonesia", value:'id-ID', disabled:true}, |
39 | {tag:'option', html:"Bulgarian (Български)", value:'bg-BG', disabled:true}, | 37 | {tag:'option', html:"Bulgarian (Български)", value:'bg-BG', disabled:true}, |
40 | {tag:'option', html:"Català", value:'ca-ES', disabled:true}, | 38 | {tag:'option', html:"Català", value:'ca-ES', disabled:true}, |
41 | {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN', disabled:true}, | 39 | {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN', disabled:true}, |
42 | {tag:'option', html:"Chinese (Traditional) (正體中文)", value:'zh-TW', disabled:true}, | 40 | {tag:'option', html:"Chinese (Traditional) (正體中文)", value:'zh-TW', disabled:true}, |
43 | {tag:'option', html:"Czech (Česky)", value:'cs-CZ', disabled:true}, | 41 | {tag:'option', html:"Czech (Česky)", value:'cs-CZ', disabled:true}, |
44 | {tag:'option', html:"Dansk", value:'da-DK', disabled:true}, | 42 | {tag:'option', html:"Dansk", value:'da-DK', disabled:true}, |
45 | {tag:'option', html:"Deutsch", value:'de-DE'/ *, disabled:true* /}, | 43 | {tag:'option', html:"Deutsch", value:'de-DE'/ *, disabled:true* /}, |
46 | {tag:'option', html:"English (American)", value:'en-US'/ *, disabled:true* /}, | 44 | {tag:'option', html:"English (American)", value:'en-US'/ *, disabled:true* /}, |
@@ -220,64 +218,59 @@ Clipperz.PM.Strings.Languages.setSelectedLanguage = function(aLanguage) { | |||
220 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[Clipperz.PM.Strings.defaultLanguages['default']]); | 218 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[Clipperz.PM.Strings.defaultLanguages['default']]); |
221 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[Clipperz.PM.Strings.defaultLanguages['default']]); | 219 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[Clipperz.PM.Strings.defaultLanguages['default']]); |
222 | 220 | ||
223 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[selectedLanguage]); | 221 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[selectedLanguage]); |
224 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[selectedLanguage]); | 222 | MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[selectedLanguage]); |
225 | 223 | ||
226 | Clipperz.PM.Strings.stringsObjectStore = new Clipperz.KeyValueObjectStore(/*{'name':'String.stringsObjectStore [1]'}*/); | 224 | Clipperz.PM.Strings.stringsObjectStore = new Clipperz.KeyValueObjectStore(/*{'name':'String.stringsObjectStore [1]'}*/); |
227 | Clipperz.PM.Strings.stringsObjectStore.initWithValues(translations); | 225 | Clipperz.PM.Strings.stringsObjectStore.initWithValues(translations); |
228 | 226 | ||
229 | if (typeof(bookmarklet) != 'undefined') { | 227 | if (typeof(bookmarklet) != 'undefined') { |
230 | Clipperz.PM.Strings.stringsObjectStore.setValue('bookmarklet', Clipperz.PM.Strings.translateBookmarklet(bookmarklet)); | 228 | Clipperz.PM.Strings.stringsObjectStore.setValue('bookmarklet', Clipperz.PM.Strings.translateBookmarklet(bookmarklet)); |
231 | } | 229 | } |
232 | 230 | ||
233 | MochiKit.Signal.signal(Clipperz.PM.Strings.Languages, 'switchLanguage', selectedLanguage); | 231 | MochiKit.Signal.signal(Clipperz.PM.Strings.Languages, 'switchLanguage', selectedLanguage); |
234 | } | 232 | } |
235 | } | 233 | } |
236 | 234 | ||
237 | //----------------------------------------------------------------------------- | 235 | //----------------------------------------------------------------------------- |
238 | 236 | ||
239 | Clipperz.PM.Strings.getValue = function (aKeyPath, someKeyValues) { | 237 | Clipperz.PM.Strings.getValue = function (aKeyPath, someKeyValues) { |
240 | varresult; | 238 | varresult; |
241 | 239 | ||
242 | result = Clipperz.PM.Strings.stringsObjectStore.getValue(aKeyPath); | 240 | result = Clipperz.PM.Strings.stringsObjectStore.getValue(aKeyPath); |
243 | 241 | ||
244 | //try { | ||
245 | if (typeof(result) == 'string') { | 242 | if (typeof(result) == 'string') { |
246 | if (typeof (someKeyValues) != 'undefined') { | 243 | if (typeof (someKeyValues) != 'undefined') { |
247 | varkey; | 244 | varkey; |
248 | 245 | ||
249 | for (key in someKeyValues) { | 246 | for (key in someKeyValues) { |
250 | result = result.replace( new RegExp(key), someKeyValues[key]); | 247 | result = result.replace( new RegExp(key), someKeyValues[key]); |
251 | // result.replace(, ''); | ||
252 | } | 248 | } |
253 | } | 249 | } |
254 | 250 | ||
255 | result = result.replace(new RegExp('\n'), '<br>'); | 251 | result = result.replace(new RegExp('\n'), '<br>'); |
256 | } | 252 | } |
257 | //} catch (exception) { | ||
258 | //console.log("####", result, aKeyPath, someKeyValues, exception); | ||
259 | //} | ||
260 | 253 | ||
261 | return result; | 254 | return result; |
262 | } | 255 | } |
263 | 256 | ||
264 | Clipperz.PM.Strings.errorDescriptionForException = function (anException) { | 257 | Clipperz.PM.Strings.errorDescriptionForException = function (anException) { |
265 | var result; | 258 | var result; |
266 | 259 | ||
267 | result = Clipperz.PM.Strings.getValue('exceptionsMessages' + '.' + anException.name); | 260 | result = Clipperz.PM.Strings.getValue('exceptionsMessages' + '.' + anException.name); |
268 | 261 | ||
269 | if (result == null) { | 262 | if (result == null) { |
270 | result = anException.message; | 263 | result = anException.message; |
271 | } | 264 | } |
272 | 265 | ||
273 | return result; | 266 | return result; |
274 | }, | 267 | }, |
275 | 268 | ||
276 | //----------------------------------------------------------------------------- | 269 | //----------------------------------------------------------------------------- |
277 | 270 | ||
278 | Clipperz.PM.Strings.Languages.initSetup = function() { | 271 | Clipperz.PM.Strings.Languages.initSetup = function() { |
279 | varlanguage; | 272 | varlanguage; |
280 | varlanguageParser; | 273 | varlanguageParser; |
281 | 274 | ||
282 | language = navigator.language || navigator.userLanguage; //en, en-US, .... "de", "nb-no" | 275 | language = navigator.language || navigator.userLanguage; //en, en-US, .... "de", "nb-no" |
283 | languageParser = new RegExp("language=([a-z]{2}(?:\-[a-z]{2})?)(\&|$)", "i"); | 276 | languageParser = new RegExp("language=([a-z]{2}(?:\-[a-z]{2})?)(\&|$)", "i"); |