/usr/share/javascript/angular.js/angular-gettext.min.js is in libjs-angular-gettext 2.1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 | angular.module("gettext",[]);angular.module("gettext").constant("gettext",function(a){return a});angular.module("gettext").factory("gettextCatalog",["gettextPlurals","$http","$cacheFactory","$interpolate","$rootScope",function(a,i,j,d,k){var f;var c="$$noContext";var h='<span id="test" title="test" class="tested">test</span>';var g=(angular.element("<span>"+h+"</span>").html()!==h);var e=function(m){if(f.debug&&f.currentLanguage!==f.baseLanguage){return f.debugPrefix+m}else{return m}};var b=function(m){if(f.showTranslatedMarkers){return f.translatedMarkerPrefix+m+f.translatedMarkerSuffix}else{return m}};function l(){k.$broadcast("gettextLanguageChanged")}f={debug:false,debugPrefix:"[MISSING]: ",showTranslatedMarkers:false,translatedMarkerPrefix:"[",translatedMarkerSuffix:"]",strings:{},baseLanguage:"en",currentLanguage:"en",cache:j("strings"),setCurrentLanguage:function(m){this.currentLanguage=m;l()},getCurrentLanguage:function(){return this.currentLanguage},setStrings:function(s,m){if(!this.strings[s]){this.strings[s]={}}for(var o in m){var r=m[o];if(g){o=angular.element("<span>"+o+"</span>").html()}if(angular.isString(r)||angular.isArray(r)){var p={};p[c]=r;r=p}for(var n in r){var q=r[n];r[n]=angular.isArray(q)?q:[q]}this.strings[s][o]=r}l()},getStringForm:function(m,s,o){var r=this.strings[this.currentLanguage]||{};var q=r[m]||{};var p=q[o||c]||[];return p[s]},getString:function(m,o,n){m=this.getStringForm(m,0,n)||e(m);m=o?d(m)(o):m;return b(m)},getPlural:function(s,m,r,p,o){var q=a(this.currentLanguage,s);m=this.getStringForm(m,q,o)||e(s===1?m:r);if(p){p.$count=s;m=d(m)(p)}return b(m)},loadRemote:function(m){return i({method:"GET",url:m,cache:f.cache}).success(function(n){for(var o in n){f.setStrings(o,n[o])}})}};return f}]);angular.module("gettext").directive("translate",["gettextCatalog","$parse","$animate","$compile","$window",function(h,d,f,e,b){var c=(function(){if(!String.prototype.trim){return function(j){return(typeof j==="string")?j.replace(/^\s*/,"").replace(/\s*$/,""):j}}return function(j){return(typeof j==="string")?j.trim():j}})();function a(l,j,k){if(!l){throw new Error("You should add a "+j+" attribute whenever you add a "+k+" attribute.")}}var g=parseInt((/msie (\d+)/.exec(angular.lowercase(b.navigator.userAgent))||[])[1],10);return{restrict:"AE",terminal:true,compile:function i(k,j){a(!j.translatePlural||j.translateN,"translate-n","translate-plural");a(!j.translateN||j.translatePlural,"translate-plural","translate-n");var l=c(k.html());var n=j.translatePlural;var m=j.translateContext;if(g<=8){if(l.slice(-13)==="<!--IE fix-->"){l=l.slice(0,-13)}}return{post:function(r,q,p){var t=d(p.translateN);var o=null;var s=true;function u(){var y;if(n){r=o||(o=r.$new());r.$count=t(r);y=h.getPlural(r.$count,l,n,null,m)}else{y=h.getString(l,null,m)}var v=q.contents();if(v.length===0){return}if(y===c(v.html())){if(s){e(v)(r)}return}var x=angular.element("<span>"+y+"</span>");e(x.contents())(r);var w=x.contents();f.enter(w,q);f.leave(v)}if(p.translateN){r.$watch(p.translateN,u)}r.$on("gettextLanguageChanged",u);u();s=false}}}}}]);angular.module("gettext").filter("translate",["gettextCatalog",function(b){function a(c,d){return b.getString(c,null,d)}a.$stateful=true;return a}]);angular.module("gettext").factory("gettextPlurals",function(){return function(b,a){switch(b){case"ay":case"bo":case"cgg":case"dz":case"fa":case"id":case"ja":case"jbo":case"ka":case"kk":case"km":case"ko":case"ky":case"lo":case"ms":case"my":case"sah":case"su":case"th":case"tt":case"ug":case"vi":case"wo":case"zh":return 0;case"is":return(a%10!=1||a%100==11)?1:0;case"jv":return a!=0?1:0;case"mk":return a==1||a%10==1?0:1;case"ach":case"ak":case"am":case"arn":case"br":case"fil":case"fr":case"gun":case"ln":case"mfe":case"mg":case"mi":case"oc":case"pt_BR":case"tg":case"ti":case"tr":case"uz":case"wa":case"zh":return a>1?1:0;case"lv":return(a%10==1&&a%100!=11?0:a!=0?1:2);case"lt":return(a%10==1&&a%100!=11?0:a%10>=2&&(a%100<10||a%100>=20)?1:2);case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2);case"mnk":return(a==0?0:a==1?1:2);case"ro":return(a==1?0:(a==0||(a%100>0&&a%100<20))?1:2);case"pl":return(a==1?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2);case"cs":case"sk":return(a==1)?0:(a>=2&&a<=4)?1:2;case"sl":return(a%100==1?1:a%100==2?2:a%100==3||a%100==4?3:0);case"mt":return(a==1?0:a==0||(a%100>1&&a%100<11)?1:(a%100>10&&a%100<20)?2:3);case"gd":return(a==1||a==11)?0:(a==2||a==12)?1:(a>2&&a<20)?2:3;case"cy":return(a==1)?0:(a==2)?1:(a!=8&&a!=11)?2:3;case"kw":return(a==1)?0:(a==2)?1:(a==3)?2:3;case"ga":return a==1?0:a==2?1:a<7?2:a<11?3:4;case"ar":return(a==0?0:a==1?1:a==2?2:a%100>=3&&a%100<=10?3:a%100>=11?4:5);default:return a!=1?1:0}}});
|