From 30b62f2cfb7aadd4237cee95b6e7776de8e707dc Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 14 Jul 2015 12:51:17 -0700 Subject: [PATCH 1/5] GUAC-1230: Restore usage of browser language default. --- .../src/main/webapp/app/settings/services/preferenceService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guacamole/src/main/webapp/app/settings/services/preferenceService.js b/guacamole/src/main/webapp/app/settings/services/preferenceService.js index 0d6b9fe31..f02270d38 100644 --- a/guacamole/src/main/webapp/app/settings/services/preferenceService.js +++ b/guacamole/src/main/webapp/app/settings/services/preferenceService.js @@ -127,7 +127,7 @@ angular.module('settings').provider('preferenceService', function preferenceServ * * @type String */ - language : 'en' + language : getDefaultLanguageKey() }; From d60370b2d3edbec20c2ffe283e3c76b04029b906 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 14 Jul 2015 12:54:18 -0700 Subject: [PATCH 2/5] GUAC-1230: Do not rely on loader for fallback. Force fallback within angular-translate by returning an empty translation. --- .../app/index/config/indexTranslationConfig.js | 9 +++------ .../app/locale/services/translationLoader.js | 14 ++++---------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/guacamole/src/main/webapp/app/index/config/indexTranslationConfig.js b/guacamole/src/main/webapp/app/index/config/indexTranslationConfig.js index dbea322d2..b59d37f41 100644 --- a/guacamole/src/main/webapp/app/index/config/indexTranslationConfig.js +++ b/guacamole/src/main/webapp/app/index/config/indexTranslationConfig.js @@ -30,19 +30,16 @@ angular.module('index').config(['$injector', function($injector) { var preferenceServiceProvider = $injector.get('preferenceServiceProvider'); // Fallback to US English - var fallbackLanguages = ['en']; + $translateProvider.fallbackLanguage('en'); - // Prefer chosen language, use fallback languages if necessary - $translateProvider.fallbackLanguage(fallbackLanguages); + // Prefer chosen language $translateProvider.preferredLanguage(preferenceServiceProvider.preferences.language); // Escape any HTML in translation strings $translateProvider.useSanitizeValueStrategy('escape'); // Load translations via translationLoader service - $translateProvider.useLoader('translationLoader', { - fallbackLanguages : fallbackLanguages - }); + $translateProvider.useLoader('translationLoader'); // Provide pluralization, etc. via messageformat.js $translateProvider.useMessageFormatInterpolation(); diff --git a/guacamole/src/main/webapp/app/locale/services/translationLoader.js b/guacamole/src/main/webapp/app/locale/services/translationLoader.js index 7e2ca49bf..ec05ef540 100644 --- a/guacamole/src/main/webapp/app/locale/services/translationLoader.js +++ b/guacamole/src/main/webapp/app/locale/services/translationLoader.js @@ -56,9 +56,9 @@ angular.module('locale').factory('translationLoader', ['$injector', function tra // Get current language key var currentKey = remainingKeys.shift(); - // If no languages to try, just fail + // If no languages to try, "succeed" with an empty translation (force fallback) if (!currentKey) { - deferred.reject(requestedKey); + deferred.resolve('{}'); return; } @@ -122,14 +122,8 @@ angular.module('locale').factory('translationLoader', ['$injector', function tra var translation = $q.defer(); - // Get requested language from options - var requestedKey = options.key; - - // Append fallback languages to requested language - var keys = getKeyVariations(requestedKey).concat(options.fallbackLanguages); - - // Satisfy the translation request - satisfyTranslation(translation, requestedKey, keys); + // Satisfy the translation request using possible variations of the given key + satisfyTranslation(translation, options.key, getKeyVariations(options.key)); // Return promise which is resolved only after the translation file is loaded return translation.promise; From 7efbaf10c3d04d87ad1d74e504bb1104dcd4786c Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 14 Jul 2015 13:11:09 -0700 Subject: [PATCH 3/5] GUAC-1230: Only explicitly specify JavaScript source files where order is critical. --- guacamole/pom.xml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/guacamole/pom.xml b/guacamole/pom.xml index 00b4434a9..945724ff6 100644 --- a/guacamole/pom.xml +++ b/guacamole/pom.xml @@ -156,27 +156,14 @@ lib/jquery.js - lib/lodash.js lib/angular.min.js lib/angular-module-shim.js - lib/angular-touch.js - lib/plugins/angular-cookies.js - lib/plugins/angular-route.js - lib/plugins/angular-translate.js - lib/plugins/angular-translate-loader-static-files.js - lib/plugins/angular-translate-interpolation-messageformat.js - lib/blob/blob.js - lib/filesaver/filesaver.js - lib/messageformat/messageformat.js - lib/messageformat/de.js - lib/messageformat/fr.js - lib/messageformat/nl.js - lib/messageformat/ru.js license.txt guacamole-common-js/all.js + lib/**/*.js app/**/*.js generated/**/*.js From 8e1d8b8af9f62d852c79a54ffadebecc7577202d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 14 Jul 2015 13:20:44 -0700 Subject: [PATCH 4/5] GUAC-1230: Add all messageformat.js locales. --- guacamole/pom.xml | 1 + .../main/webapp/lib/messageformat/locale/af.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/am.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/ar.js | 18 ++++++++++++++++++ .../main/webapp/lib/messageformat/locale/bg.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/bn.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/br.js | 18 ++++++++++++++++++ .../main/webapp/lib/messageformat/locale/ca.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/cs.js | 9 +++++++++ .../main/webapp/lib/messageformat/locale/cy.js | 18 ++++++++++++++++++ .../main/webapp/lib/messageformat/locale/da.js | 6 ++++++ .../lib/messageformat/{ => locale}/de.js | 0 .../main/webapp/lib/messageformat/locale/el.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/en.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/es.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/et.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/eu.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/fa.js | 3 +++ .../main/webapp/lib/messageformat/locale/fi.js | 6 ++++++ .../webapp/lib/messageformat/locale/fil.js | 6 ++++++ .../lib/messageformat/{ => locale}/fr.js | 0 .../main/webapp/lib/messageformat/locale/ga.js | 9 +++++++++ .../main/webapp/lib/messageformat/locale/gl.js | 6 ++++++ .../webapp/lib/messageformat/locale/gsw.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/gu.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/he.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/hi.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/hr.js | 14 ++++++++++++++ .../main/webapp/lib/messageformat/locale/hu.js | 3 +++ .../main/webapp/lib/messageformat/locale/id.js | 3 +++ .../main/webapp/lib/messageformat/locale/in.js | 3 +++ .../main/webapp/lib/messageformat/locale/is.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/it.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/iw.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/ja.js | 3 +++ .../main/webapp/lib/messageformat/locale/kn.js | 3 +++ .../main/webapp/lib/messageformat/locale/ko.js | 3 +++ .../webapp/lib/messageformat/locale/lag.js | 9 +++++++++ .../main/webapp/lib/messageformat/locale/ln.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/lt.js | 10 ++++++++++ .../main/webapp/lib/messageformat/locale/lv.js | 9 +++++++++ .../main/webapp/lib/messageformat/locale/mk.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/ml.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/mo.js | 10 ++++++++++ .../main/webapp/lib/messageformat/locale/mr.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/ms.js | 3 +++ .../main/webapp/lib/messageformat/locale/mt.js | 12 ++++++++++++ .../lib/messageformat/{ => locale}/nl.js | 0 .../main/webapp/lib/messageformat/locale/no.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/or.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/pl.js | 15 +++++++++++++++ .../main/webapp/lib/messageformat/locale/pt.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/ro.js | 10 ++++++++++ .../lib/messageformat/{ => locale}/ru.js | 0 .../webapp/lib/messageformat/locale/shi.js | 9 +++++++++ .../main/webapp/lib/messageformat/locale/sk.js | 9 +++++++++ .../main/webapp/lib/messageformat/locale/sl.js | 12 ++++++++++++ .../main/webapp/lib/messageformat/locale/sq.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/sr.js | 14 ++++++++++++++ .../main/webapp/lib/messageformat/locale/sv.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/sw.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/ta.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/te.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/th.js | 3 +++ .../main/webapp/lib/messageformat/locale/tl.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/tr.js | 3 +++ .../main/webapp/lib/messageformat/locale/uk.js | 14 ++++++++++++++ .../main/webapp/lib/messageformat/locale/ur.js | 6 ++++++ .../main/webapp/lib/messageformat/locale/vi.js | 3 +++ .../main/webapp/lib/messageformat/locale/zh.js | 3 +++ 70 files changed, 466 insertions(+) create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/af.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/am.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ar.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/bg.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/bn.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/br.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ca.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/cs.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/cy.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/da.js rename guacamole/src/main/webapp/lib/messageformat/{ => locale}/de.js (100%) create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/el.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/en.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/es.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/et.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/eu.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/fa.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/fi.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/fil.js rename guacamole/src/main/webapp/lib/messageformat/{ => locale}/fr.js (100%) create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ga.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/gl.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/gsw.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/gu.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/he.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/hi.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/hr.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/hu.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/id.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/in.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/is.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/it.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/iw.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ja.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/kn.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ko.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/lag.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ln.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/lt.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/lv.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/mk.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ml.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/mo.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/mr.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ms.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/mt.js rename guacamole/src/main/webapp/lib/messageformat/{ => locale}/nl.js (100%) create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/no.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/or.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/pl.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/pt.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ro.js rename guacamole/src/main/webapp/lib/messageformat/{ => locale}/ru.js (100%) create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/shi.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/sk.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/sl.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/sq.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/sr.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/sv.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/sw.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ta.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/te.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/th.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/tl.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/tr.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/uk.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/ur.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/vi.js create mode 100644 guacamole/src/main/webapp/lib/messageformat/locale/zh.js diff --git a/guacamole/pom.xml b/guacamole/pom.xml index 945724ff6..fb426e743 100644 --- a/guacamole/pom.xml +++ b/guacamole/pom.xml @@ -158,6 +158,7 @@ lib/jquery.js lib/angular.min.js lib/angular-module-shim.js + lib/messageformat/messageformat.js license.txt guacamole-common-js/all.js diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/af.js b/guacamole/src/main/webapp/lib/messageformat/locale/af.js new file mode 100644 index 000000000..b03849f2d --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/af.js @@ -0,0 +1,6 @@ +MessageFormat.locale.af = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/am.js b/guacamole/src/main/webapp/lib/messageformat/locale/am.js new file mode 100644 index 000000000..aa8af1d1a --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/am.js @@ -0,0 +1,6 @@ +MessageFormat.locale.am = function(n) { + if (n === 0 || n == 1) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ar.js b/guacamole/src/main/webapp/lib/messageformat/locale/ar.js new file mode 100644 index 000000000..d33d95ddb --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ar.js @@ -0,0 +1,18 @@ +MessageFormat.locale.ar = function(n) { + if (n === 0) { + return 'zero'; + } + if (n == 1) { + return 'one'; + } + if (n == 2) { + return 'two'; + } + if ((n % 100) >= 3 && (n % 100) <= 10 && n == Math.floor(n)) { + return 'few'; + } + if ((n % 100) >= 11 && (n % 100) <= 99 && n == Math.floor(n)) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/bg.js b/guacamole/src/main/webapp/lib/messageformat/locale/bg.js new file mode 100644 index 000000000..868baea07 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/bg.js @@ -0,0 +1,6 @@ +MessageFormat.locale.bg = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/bn.js b/guacamole/src/main/webapp/lib/messageformat/locale/bn.js new file mode 100644 index 000000000..1641ff32d --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/bn.js @@ -0,0 +1,6 @@ +MessageFormat.locale.bn = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/br.js b/guacamole/src/main/webapp/lib/messageformat/locale/br.js new file mode 100644 index 000000000..2e0d43fee --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/br.js @@ -0,0 +1,18 @@ +MessageFormat.locale.br = function (n) { + if (n === 0) { + return 'zero'; + } + if (n == 1) { + return 'one'; + } + if (n == 2) { + return 'two'; + } + if (n == 3) { + return 'few'; + } + if (n == 6) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ca.js b/guacamole/src/main/webapp/lib/messageformat/locale/ca.js new file mode 100644 index 000000000..e2a685c67 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ca.js @@ -0,0 +1,6 @@ +MessageFormat.locale.ca = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/cs.js b/guacamole/src/main/webapp/lib/messageformat/locale/cs.js new file mode 100644 index 000000000..6a7f67ee2 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/cs.js @@ -0,0 +1,9 @@ +MessageFormat.locale.cs = function (n) { + if (n == 1) { + return 'one'; + } + if (n == 2 || n == 3 || n == 4) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/cy.js b/guacamole/src/main/webapp/lib/messageformat/locale/cy.js new file mode 100644 index 000000000..d98b1f49f --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/cy.js @@ -0,0 +1,18 @@ +MessageFormat.locale.cy = function (n) { + if (n === 0) { + return 'zero'; + } + if (n == 1) { + return 'one'; + } + if (n == 2) { + return 'two'; + } + if (n == 3) { + return 'few'; + } + if (n == 6) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/da.js b/guacamole/src/main/webapp/lib/messageformat/locale/da.js new file mode 100644 index 000000000..7ea5765b2 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/da.js @@ -0,0 +1,6 @@ +MessageFormat.locale.da = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/de.js b/guacamole/src/main/webapp/lib/messageformat/locale/de.js similarity index 100% rename from guacamole/src/main/webapp/lib/messageformat/de.js rename to guacamole/src/main/webapp/lib/messageformat/locale/de.js diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/el.js b/guacamole/src/main/webapp/lib/messageformat/locale/el.js new file mode 100644 index 000000000..8c5215a44 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/el.js @@ -0,0 +1,6 @@ +MessageFormat.locale.el = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/en.js b/guacamole/src/main/webapp/lib/messageformat/locale/en.js new file mode 100644 index 000000000..c2380b9bf --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/en.js @@ -0,0 +1,6 @@ +MessageFormat.locale.en = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/es.js b/guacamole/src/main/webapp/lib/messageformat/locale/es.js new file mode 100644 index 000000000..4397d10b8 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/es.js @@ -0,0 +1,6 @@ +MessageFormat.locale.es = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/et.js b/guacamole/src/main/webapp/lib/messageformat/locale/et.js new file mode 100644 index 000000000..d4b7f5a31 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/et.js @@ -0,0 +1,6 @@ +MessageFormat.locale.et = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/eu.js b/guacamole/src/main/webapp/lib/messageformat/locale/eu.js new file mode 100644 index 000000000..6da55df13 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/eu.js @@ -0,0 +1,6 @@ +MessageFormat.locale.eu = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/fa.js b/guacamole/src/main/webapp/lib/messageformat/locale/fa.js new file mode 100644 index 000000000..4280d1dab --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/fa.js @@ -0,0 +1,3 @@ +MessageFormat.locale.fa = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/fi.js b/guacamole/src/main/webapp/lib/messageformat/locale/fi.js new file mode 100644 index 000000000..3315a8404 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/fi.js @@ -0,0 +1,6 @@ +MessageFormat.locale.fi = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/fil.js b/guacamole/src/main/webapp/lib/messageformat/locale/fil.js new file mode 100644 index 000000000..af882daf4 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/fil.js @@ -0,0 +1,6 @@ +MessageFormat.locale.fil = function(n) { + if (n === 0 || n == 1) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/fr.js b/guacamole/src/main/webapp/lib/messageformat/locale/fr.js similarity index 100% rename from guacamole/src/main/webapp/lib/messageformat/fr.js rename to guacamole/src/main/webapp/lib/messageformat/locale/fr.js diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ga.js b/guacamole/src/main/webapp/lib/messageformat/locale/ga.js new file mode 100644 index 000000000..c29aaadb6 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ga.js @@ -0,0 +1,9 @@ +MessageFormat.locale.ga = function (n) { + if (n == 1) { + return 'one'; + } + if (n == 2) { + return 'two'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/gl.js b/guacamole/src/main/webapp/lib/messageformat/locale/gl.js new file mode 100644 index 000000000..0d2a1b448 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/gl.js @@ -0,0 +1,6 @@ +MessageFormat.locale.gl = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/gsw.js b/guacamole/src/main/webapp/lib/messageformat/locale/gsw.js new file mode 100644 index 000000000..9aae2bcc8 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/gsw.js @@ -0,0 +1,6 @@ +MessageFormat.locale.gsw = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/gu.js b/guacamole/src/main/webapp/lib/messageformat/locale/gu.js new file mode 100644 index 000000000..70820dd9e --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/gu.js @@ -0,0 +1,6 @@ +MessageFormat.locale.gu = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/he.js b/guacamole/src/main/webapp/lib/messageformat/locale/he.js new file mode 100644 index 000000000..bf828a5a7 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/he.js @@ -0,0 +1,6 @@ +MessageFormat.locale.he = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/hi.js b/guacamole/src/main/webapp/lib/messageformat/locale/hi.js new file mode 100644 index 000000000..68fac22a3 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/hi.js @@ -0,0 +1,6 @@ +MessageFormat.locale.hi = function(n) { + if (n === 0 || n == 1) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/hr.js b/guacamole/src/main/webapp/lib/messageformat/locale/hr.js new file mode 100644 index 000000000..668e28e2b --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/hr.js @@ -0,0 +1,14 @@ +MessageFormat.locale.hr = function (n) { + if ((n % 10) == 1 && (n % 100) != 11) { + return 'one'; + } + if ((n % 10) >= 2 && (n % 10) <= 4 && + ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { + return 'few'; + } + if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || + ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/hu.js b/guacamole/src/main/webapp/lib/messageformat/locale/hu.js new file mode 100644 index 000000000..1fa3c21b2 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/hu.js @@ -0,0 +1,3 @@ +MessageFormat.locale.hu = function(n) { + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/id.js b/guacamole/src/main/webapp/lib/messageformat/locale/id.js new file mode 100644 index 000000000..fb4b62bde --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/id.js @@ -0,0 +1,3 @@ +MessageFormat.locale.id = function(n) { + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/in.js b/guacamole/src/main/webapp/lib/messageformat/locale/in.js new file mode 100644 index 000000000..95abe006a --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/in.js @@ -0,0 +1,3 @@ +MessageFormat.locale["in"] = function(n) { + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/is.js b/guacamole/src/main/webapp/lib/messageformat/locale/is.js new file mode 100644 index 000000000..48efd8f46 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/is.js @@ -0,0 +1,6 @@ +MessageFormat.locale.is = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/it.js b/guacamole/src/main/webapp/lib/messageformat/locale/it.js new file mode 100644 index 000000000..be964ccbe --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/it.js @@ -0,0 +1,6 @@ +MessageFormat.locale.it = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/iw.js b/guacamole/src/main/webapp/lib/messageformat/locale/iw.js new file mode 100644 index 000000000..a25fb2b17 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/iw.js @@ -0,0 +1,6 @@ +MessageFormat.locale.iw = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ja.js b/guacamole/src/main/webapp/lib/messageformat/locale/ja.js new file mode 100644 index 000000000..a02267fa0 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ja.js @@ -0,0 +1,3 @@ +MessageFormat.locale.ja = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/kn.js b/guacamole/src/main/webapp/lib/messageformat/locale/kn.js new file mode 100644 index 000000000..44c782db7 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/kn.js @@ -0,0 +1,3 @@ +MessageFormat.locale.kn = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ko.js b/guacamole/src/main/webapp/lib/messageformat/locale/ko.js new file mode 100644 index 000000000..899ffeae9 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ko.js @@ -0,0 +1,3 @@ +MessageFormat.locale.ko = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/lag.js b/guacamole/src/main/webapp/lib/messageformat/locale/lag.js new file mode 100644 index 000000000..d4990b96c --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/lag.js @@ -0,0 +1,9 @@ +MessageFormat.locale.lag = function (n) { + if (n === 0) { + return 'zero'; + } + if (n > 0 && n < 2) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ln.js b/guacamole/src/main/webapp/lib/messageformat/locale/ln.js new file mode 100644 index 000000000..562e220b8 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ln.js @@ -0,0 +1,6 @@ +MessageFormat.locale.ln = function(n) { + if (n === 0 || n == 1) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/lt.js b/guacamole/src/main/webapp/lib/messageformat/locale/lt.js new file mode 100644 index 000000000..82878cfef --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/lt.js @@ -0,0 +1,10 @@ +MessageFormat.locale.lt = function (n) { + if ((n % 10) == 1 && ((n % 100) < 11 || (n % 100) > 19)) { + return 'one'; + } + if ((n % 10) >= 2 && (n % 10) <= 9 && + ((n % 100) < 11 || (n % 100) > 19) && n == Math.floor(n)) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/lv.js b/guacamole/src/main/webapp/lib/messageformat/locale/lv.js new file mode 100644 index 000000000..75beb3401 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/lv.js @@ -0,0 +1,9 @@ +MessageFormat.locale.lv = function (n) { + if (n === 0) { + return 'zero'; + } + if ((n % 10) == 1 && (n % 100) != 11) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/mk.js b/guacamole/src/main/webapp/lib/messageformat/locale/mk.js new file mode 100644 index 000000000..c17aa2e3a --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/mk.js @@ -0,0 +1,6 @@ +MessageFormat.locale.mk = function (n) { + if ((n % 10) == 1 && n != 11) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ml.js b/guacamole/src/main/webapp/lib/messageformat/locale/ml.js new file mode 100644 index 000000000..f400a5f10 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ml.js @@ -0,0 +1,6 @@ +MessageFormat.locale.ml = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/mo.js b/guacamole/src/main/webapp/lib/messageformat/locale/mo.js new file mode 100644 index 000000000..16d84d98f --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/mo.js @@ -0,0 +1,10 @@ +MessageFormat.locale.mo = function (n) { + if (n == 1) { + return 'one'; + } + if (n === 0 || n != 1 && (n % 100) >= 1 && + (n % 100) <= 19 && n == Math.floor(n)) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/mr.js b/guacamole/src/main/webapp/lib/messageformat/locale/mr.js new file mode 100644 index 000000000..da4d494ac --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/mr.js @@ -0,0 +1,6 @@ +MessageFormat.locale.mr = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ms.js b/guacamole/src/main/webapp/lib/messageformat/locale/ms.js new file mode 100644 index 000000000..e635ae79a --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ms.js @@ -0,0 +1,3 @@ +MessageFormat.locale.ms = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/mt.js b/guacamole/src/main/webapp/lib/messageformat/locale/mt.js new file mode 100644 index 000000000..6a071a734 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/mt.js @@ -0,0 +1,12 @@ +MessageFormat.locale.mt = function (n) { + if (n == 1) { + return 'one'; + } + if (n === 0 || ((n % 100) >= 2 && (n % 100) <= 4 && n == Math.floor(n))) { + return 'few'; + } + if ((n % 100) >= 11 && (n % 100) <= 19 && n == Math.floor(n)) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/nl.js b/guacamole/src/main/webapp/lib/messageformat/locale/nl.js similarity index 100% rename from guacamole/src/main/webapp/lib/messageformat/nl.js rename to guacamole/src/main/webapp/lib/messageformat/locale/nl.js diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/no.js b/guacamole/src/main/webapp/lib/messageformat/locale/no.js new file mode 100644 index 000000000..025d3489d --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/no.js @@ -0,0 +1,6 @@ +MessageFormat.locale.no = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/or.js b/guacamole/src/main/webapp/lib/messageformat/locale/or.js new file mode 100644 index 000000000..04240a185 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/or.js @@ -0,0 +1,6 @@ +MessageFormat.locale.or = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/pl.js b/guacamole/src/main/webapp/lib/messageformat/locale/pl.js new file mode 100644 index 000000000..a9020d0a5 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/pl.js @@ -0,0 +1,15 @@ +MessageFormat.locale.pl = function (n) { + if (n == 1) { + return 'one'; + } + if ((n % 10) >= 2 && (n % 10) <= 4 && + ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { + return 'few'; + } + if ((n % 10) === 0 || n != 1 && (n % 10) == 1 || + ((n % 10) >= 5 && (n % 10) <= 9 || (n % 100) >= 12 && (n % 100) <= 14) && + n == Math.floor(n)) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/pt.js b/guacamole/src/main/webapp/lib/messageformat/locale/pt.js new file mode 100644 index 000000000..a4b65eb90 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/pt.js @@ -0,0 +1,6 @@ +MessageFormat.locale.pt = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ro.js b/guacamole/src/main/webapp/lib/messageformat/locale/ro.js new file mode 100644 index 000000000..26453eadd --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ro.js @@ -0,0 +1,10 @@ +MessageFormat.locale.ro = function (n) { + if (n == 1) { + return 'one'; + } + if (n === 0 || n != 1 && (n % 100) >= 1 && + (n % 100) <= 19 && n == Math.floor(n)) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/ru.js b/guacamole/src/main/webapp/lib/messageformat/locale/ru.js similarity index 100% rename from guacamole/src/main/webapp/lib/messageformat/ru.js rename to guacamole/src/main/webapp/lib/messageformat/locale/ru.js diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/shi.js b/guacamole/src/main/webapp/lib/messageformat/locale/shi.js new file mode 100644 index 000000000..9e86dca14 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/shi.js @@ -0,0 +1,9 @@ +MessageFormat.locale.shi = function(n) { + if (n >= 0 && n <= 1) { + return 'one'; + } + if (n >= 2 && n <= 10 && n == Math.floor(n)) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/sk.js b/guacamole/src/main/webapp/lib/messageformat/locale/sk.js new file mode 100644 index 000000000..ef041ddb2 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/sk.js @@ -0,0 +1,9 @@ +MessageFormat.locale.sk = function (n) { + if (n == 1) { + return 'one'; + } + if (n == 2 || n == 3 || n == 4) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/sl.js b/guacamole/src/main/webapp/lib/messageformat/locale/sl.js new file mode 100644 index 000000000..7dd591b01 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/sl.js @@ -0,0 +1,12 @@ +MessageFormat.locale.sl = function (n) { + if ((n % 100) == 1) { + return 'one'; + } + if ((n % 100) == 2) { + return 'two'; + } + if ((n % 100) == 3 || (n % 100) == 4) { + return 'few'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/sq.js b/guacamole/src/main/webapp/lib/messageformat/locale/sq.js new file mode 100644 index 000000000..1e683894f --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/sq.js @@ -0,0 +1,6 @@ +MessageFormat.locale.sq = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/sr.js b/guacamole/src/main/webapp/lib/messageformat/locale/sr.js new file mode 100644 index 000000000..c2e3d3df1 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/sr.js @@ -0,0 +1,14 @@ +MessageFormat.locale.sr = function (n) { + if ((n % 10) == 1 && (n % 100) != 11) { + return 'one'; + } + if ((n % 10) >= 2 && (n % 10) <= 4 && + ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { + return 'few'; + } + if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || + ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/sv.js b/guacamole/src/main/webapp/lib/messageformat/locale/sv.js new file mode 100644 index 000000000..e566a339d --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/sv.js @@ -0,0 +1,6 @@ +MessageFormat.locale.sv = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/sw.js b/guacamole/src/main/webapp/lib/messageformat/locale/sw.js new file mode 100644 index 000000000..7dd56c146 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/sw.js @@ -0,0 +1,6 @@ +MessageFormat.locale.sw = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ta.js b/guacamole/src/main/webapp/lib/messageformat/locale/ta.js new file mode 100644 index 000000000..08a4ae01f --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ta.js @@ -0,0 +1,6 @@ +MessageFormat.locale.ta = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/te.js b/guacamole/src/main/webapp/lib/messageformat/locale/te.js new file mode 100644 index 000000000..61ccb27f6 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/te.js @@ -0,0 +1,6 @@ +MessageFormat.locale.te = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/th.js b/guacamole/src/main/webapp/lib/messageformat/locale/th.js new file mode 100644 index 000000000..9ef170824 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/th.js @@ -0,0 +1,3 @@ +MessageFormat.locale.th = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/tl.js b/guacamole/src/main/webapp/lib/messageformat/locale/tl.js new file mode 100644 index 000000000..bc68843df --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/tl.js @@ -0,0 +1,6 @@ +MessageFormat.locale.tl = function(n) { + if (n === 0 || n == 1) { + return 'one'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/tr.js b/guacamole/src/main/webapp/lib/messageformat/locale/tr.js new file mode 100644 index 000000000..438941ad9 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/tr.js @@ -0,0 +1,3 @@ +MessageFormat.locale.tr = function(n) { + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/uk.js b/guacamole/src/main/webapp/lib/messageformat/locale/uk.js new file mode 100644 index 000000000..aad90c797 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/uk.js @@ -0,0 +1,14 @@ +MessageFormat.locale.uk = function (n) { + if ((n % 10) == 1 && (n % 100) != 11) { + return 'one'; + } + if ((n % 10) >= 2 && (n % 10) <= 4 && + ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { + return 'few'; + } + if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || + ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { + return 'many'; + } + return 'other'; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/ur.js b/guacamole/src/main/webapp/lib/messageformat/locale/ur.js new file mode 100644 index 000000000..5a875c9e3 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/ur.js @@ -0,0 +1,6 @@ +MessageFormat.locale.ur = function ( n ) { + if ( n === 1 ) { + return "one"; + } + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/vi.js b/guacamole/src/main/webapp/lib/messageformat/locale/vi.js new file mode 100644 index 000000000..8a5b74698 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/vi.js @@ -0,0 +1,3 @@ +MessageFormat.locale.vi = function ( n ) { + return "other"; +}; diff --git a/guacamole/src/main/webapp/lib/messageformat/locale/zh.js b/guacamole/src/main/webapp/lib/messageformat/locale/zh.js new file mode 100644 index 000000000..6ae270cf6 --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/locale/zh.js @@ -0,0 +1,3 @@ +MessageFormat.locale.zh = function ( n ) { + return "other"; +}; From 1ac2986b9311c1ad8c4f79c490befe52f2b38ce0 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 14 Jul 2015 13:36:10 -0700 Subject: [PATCH 5/5] GUAC-1230: Standardize inclusion of third-party JavaScript libraries. --- guacamole/pom.xml | 6 ++-- .../main/webapp/lib/angular-module-shim.js | 35 ------------------- .../webapp/lib/angular-module-shim/LICENSE | 21 +++++++++++ .../angular-module-shim.js | 32 +++++++++++++++++ .../main/webapp/lib/angular-translate/LICENSE | 21 +++++++++++ ...r-translate-interpolation-messageformat.js | 0 .../angular-translate-loader-static-files.js | 0 .../angular-translate.js | 0 guacamole/src/main/webapp/lib/angular/LICENSE | 22 ++++++++++++ .../{plugins => angular}/angular-cookies.js | 0 .../lib/{plugins => angular}/angular-route.js | 0 .../webapp/lib/{ => angular}/angular-touch.js | 0 .../webapp/lib/{ => angular}/angular.min.js | 0 .../main/webapp/lib/jquery/MIT-LICENSE.txt | 21 +++++++++++ .../main/webapp/lib/{ => jquery}/jquery.js | 0 .../src/main/webapp/lib/lodash/LICENSE.txt | 22 ++++++++++++ .../main/webapp/lib/{ => lodash}/lodash.js | 0 .../src/main/webapp/lib/messageformat/LICENSE | 14 ++++++++ 18 files changed, 156 insertions(+), 38 deletions(-) delete mode 100644 guacamole/src/main/webapp/lib/angular-module-shim.js create mode 100644 guacamole/src/main/webapp/lib/angular-module-shim/LICENSE create mode 100644 guacamole/src/main/webapp/lib/angular-module-shim/angular-module-shim.js create mode 100644 guacamole/src/main/webapp/lib/angular-translate/LICENSE rename guacamole/src/main/webapp/lib/{plugins => angular-translate}/angular-translate-interpolation-messageformat.js (100%) rename guacamole/src/main/webapp/lib/{plugins => angular-translate}/angular-translate-loader-static-files.js (100%) rename guacamole/src/main/webapp/lib/{plugins => angular-translate}/angular-translate.js (100%) create mode 100644 guacamole/src/main/webapp/lib/angular/LICENSE rename guacamole/src/main/webapp/lib/{plugins => angular}/angular-cookies.js (100%) rename guacamole/src/main/webapp/lib/{plugins => angular}/angular-route.js (100%) rename guacamole/src/main/webapp/lib/{ => angular}/angular-touch.js (100%) rename guacamole/src/main/webapp/lib/{ => angular}/angular.min.js (100%) create mode 100644 guacamole/src/main/webapp/lib/jquery/MIT-LICENSE.txt rename guacamole/src/main/webapp/lib/{ => jquery}/jquery.js (100%) create mode 100644 guacamole/src/main/webapp/lib/lodash/LICENSE.txt rename guacamole/src/main/webapp/lib/{ => lodash}/lodash.js (100%) create mode 100644 guacamole/src/main/webapp/lib/messageformat/LICENSE diff --git a/guacamole/pom.xml b/guacamole/pom.xml index fb426e743..29b177aec 100644 --- a/guacamole/pom.xml +++ b/guacamole/pom.xml @@ -155,9 +155,9 @@ guacamole.js - lib/jquery.js - lib/angular.min.js - lib/angular-module-shim.js + lib/jquery/jquery.js + lib/angular/angular.min.js + lib/angular-module-shim/angular-module-shim.js lib/messageformat/messageformat.js license.txt guacamole-common-js/all.js diff --git a/guacamole/src/main/webapp/lib/angular-module-shim.js b/guacamole/src/main/webapp/lib/angular-module-shim.js deleted file mode 100644 index af62f1fba..000000000 --- a/guacamole/src/main/webapp/lib/angular-module-shim.js +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * Workaround to make defining and retrieving angular modules easier and more intuitive. - * https://gist.github.com/hiddentao/7300694 - */ - -(function(angular) { - var origMethod = angular.module; - - var alreadyRegistered = {}; - - /** - * Register/fetch a module. - * - * @param name {string} module name. - * @param reqs {array} list of modules this module depends upon. - * @param configFn {function} config function to run when module loads (only applied for the first call to create this module). - * @returns {*} the created/existing module. - */ - angular.module = function(name, reqs, configFn) { - reqs = reqs || []; - var module = null; - - if (alreadyRegistered[name]) { - module = origMethod(name); - module.requires.push.apply(module.requires, reqs); - } else { - module = origMethod(name, reqs, configFn); - alreadyRegistered[name] = module; - } - - return module; - }; - -})(angular); diff --git a/guacamole/src/main/webapp/lib/angular-module-shim/LICENSE b/guacamole/src/main/webapp/lib/angular-module-shim/LICENSE new file mode 100644 index 000000000..806ee6e34 --- /dev/null +++ b/guacamole/src/main/webapp/lib/angular-module-shim/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jed Richards + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/guacamole/src/main/webapp/lib/angular-module-shim/angular-module-shim.js b/guacamole/src/main/webapp/lib/angular-module-shim/angular-module-shim.js new file mode 100644 index 000000000..fbd4a7df9 --- /dev/null +++ b/guacamole/src/main/webapp/lib/angular-module-shim/angular-module-shim.js @@ -0,0 +1,32 @@ +(function(angular) { + + 'use strict'; + + if ( !angular ) { + throw new Error('angular-module-shim: Missing Angular'); + } + + var origFn = angular.module; + var hash = {}; + + angular.module = function(name,requires,configFn) { + + var requires = requires || []; + var registered = hash[name]; + var module; + + if ( registered ) { + module = origFn(name); + module.requires.push.apply(module.requires,requires); + // Register the config function if it exists. + if (configFn) { + module.config(configFn); + } + } else { + hash[name] = true; + module = origFn(name,requires,configFn); + } + + return module; + }; +})(window.angular); diff --git a/guacamole/src/main/webapp/lib/angular-translate/LICENSE b/guacamole/src/main/webapp/lib/angular-translate/LICENSE new file mode 100644 index 000000000..f3e753f87 --- /dev/null +++ b/guacamole/src/main/webapp/lib/angular-translate/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) <2014> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/guacamole/src/main/webapp/lib/plugins/angular-translate-interpolation-messageformat.js b/guacamole/src/main/webapp/lib/angular-translate/angular-translate-interpolation-messageformat.js similarity index 100% rename from guacamole/src/main/webapp/lib/plugins/angular-translate-interpolation-messageformat.js rename to guacamole/src/main/webapp/lib/angular-translate/angular-translate-interpolation-messageformat.js diff --git a/guacamole/src/main/webapp/lib/plugins/angular-translate-loader-static-files.js b/guacamole/src/main/webapp/lib/angular-translate/angular-translate-loader-static-files.js similarity index 100% rename from guacamole/src/main/webapp/lib/plugins/angular-translate-loader-static-files.js rename to guacamole/src/main/webapp/lib/angular-translate/angular-translate-loader-static-files.js diff --git a/guacamole/src/main/webapp/lib/plugins/angular-translate.js b/guacamole/src/main/webapp/lib/angular-translate/angular-translate.js similarity index 100% rename from guacamole/src/main/webapp/lib/plugins/angular-translate.js rename to guacamole/src/main/webapp/lib/angular-translate/angular-translate.js diff --git a/guacamole/src/main/webapp/lib/angular/LICENSE b/guacamole/src/main/webapp/lib/angular/LICENSE new file mode 100644 index 000000000..9ced33195 --- /dev/null +++ b/guacamole/src/main/webapp/lib/angular/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2010-2014 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/guacamole/src/main/webapp/lib/plugins/angular-cookies.js b/guacamole/src/main/webapp/lib/angular/angular-cookies.js similarity index 100% rename from guacamole/src/main/webapp/lib/plugins/angular-cookies.js rename to guacamole/src/main/webapp/lib/angular/angular-cookies.js diff --git a/guacamole/src/main/webapp/lib/plugins/angular-route.js b/guacamole/src/main/webapp/lib/angular/angular-route.js similarity index 100% rename from guacamole/src/main/webapp/lib/plugins/angular-route.js rename to guacamole/src/main/webapp/lib/angular/angular-route.js diff --git a/guacamole/src/main/webapp/lib/angular-touch.js b/guacamole/src/main/webapp/lib/angular/angular-touch.js similarity index 100% rename from guacamole/src/main/webapp/lib/angular-touch.js rename to guacamole/src/main/webapp/lib/angular/angular-touch.js diff --git a/guacamole/src/main/webapp/lib/angular.min.js b/guacamole/src/main/webapp/lib/angular/angular.min.js similarity index 100% rename from guacamole/src/main/webapp/lib/angular.min.js rename to guacamole/src/main/webapp/lib/angular/angular.min.js diff --git a/guacamole/src/main/webapp/lib/jquery/MIT-LICENSE.txt b/guacamole/src/main/webapp/lib/jquery/MIT-LICENSE.txt new file mode 100644 index 000000000..cdd31b5c7 --- /dev/null +++ b/guacamole/src/main/webapp/lib/jquery/MIT-LICENSE.txt @@ -0,0 +1,21 @@ +Copyright 2014 jQuery Foundation and other contributors +http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/guacamole/src/main/webapp/lib/jquery.js b/guacamole/src/main/webapp/lib/jquery/jquery.js similarity index 100% rename from guacamole/src/main/webapp/lib/jquery.js rename to guacamole/src/main/webapp/lib/jquery/jquery.js diff --git a/guacamole/src/main/webapp/lib/lodash/LICENSE.txt b/guacamole/src/main/webapp/lib/lodash/LICENSE.txt new file mode 100644 index 000000000..49869bbab --- /dev/null +++ b/guacamole/src/main/webapp/lib/lodash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/guacamole/src/main/webapp/lib/lodash.js b/guacamole/src/main/webapp/lib/lodash/lodash.js similarity index 100% rename from guacamole/src/main/webapp/lib/lodash.js rename to guacamole/src/main/webapp/lib/lodash/lodash.js diff --git a/guacamole/src/main/webapp/lib/messageformat/LICENSE b/guacamole/src/main/webapp/lib/messageformat/LICENSE new file mode 100644 index 000000000..ee7d6a54e --- /dev/null +++ b/guacamole/src/main/webapp/lib/messageformat/LICENSE @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. +