mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Don't mangle the i18n plugin and localization -- require w/ these plugins is a fickle beast.
This commit is contained in:
+5
-1
@@ -1,4 +1,8 @@
|
||||
{
|
||||
"presets": ["env"],
|
||||
"moduleIds": true
|
||||
"moduleIds": true,
|
||||
"ignore": [
|
||||
"i18n.js",
|
||||
"utils/localization.js"
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"sources":["utils/localization.js"],"names":["define","localeStrings","hasOwnProperty","locale","language","toLowerCase","split","__root","localize","strToLocalize","cacheNonLocalized"],"mappings":"uDAAAA,QAAQ,mBAAoB,SAASC,GAMjC,GAAIA,EAAcC,eAAe,UAAW,CAD5C,IAAAC,EACkBD,oBAAdD,UACA,UACIE,UACAC,UAMJH,UACIA,cAHU,UAOdI,cACAJ,EACHA,EAAA,KAAAE,IACDF,EAAA,KAAAE,EAAAG,MAAA,KAAA,KALQL,EAAcM,OAmBlB,IAAAC,EAAA,SAAAC,GArCR,OAAAR,EAAAQ,IAAAA,GAkDI,OAHAD,EAASE,mBAAoB,EAGtBF","file":"../../scripts/utils/localization.js","sourcesContent":["define([\"i18n!nls/locale\"], function(localeStrings) {\n // =============================================================================\n /** Simple string replacement localization. Language data from galaxy/scripts/nls */\n\n // support both requirejs and webpack from the same file\n // if loaded via webpack, it will be a different format than via requirejs - convert\n if (localeStrings.hasOwnProperty(\"__root\")) {\n //console.debug( 'amdi18n+webpack localization for ' + locale + ' loaded' );\n var locale =\n typeof navigator === \"undefined\"\n ? \"__root\"\n : (navigator.language ||\n navigator.userLanguage ||\n \"__root\"\n ).toLowerCase();\n localeStrings =\n localeStrings[\"__\" + locale] ||\n localeStrings[\"__\" + locale.split(\"-\")[0]] ||\n localeStrings.__root;\n\n // } else {\n // console.debug( 'i18n+requirejs localization for ' + locale + ' loaded' );\n }\n // TODO: when this is no longer necessary remove this, i18n.js, and the resolveModule in config\n\n // -----------------------------------------------------------------------------\n /** Attempt to get a localized string for strToLocalize. If not found, return\n * the original strToLocalize.\n * @param {String} strToLocalize the string to localize\n * @returns either the localized string if found or strToLocalize if not found\n */\n var localize = function(strToLocalize) {\n // console.debug( 'amdi18n.localize:', strToLocalize, '->', localeStrings[ strToLocalize ] || strToLocalize );\n\n // //TODO: conditional compile on DEBUG flag\n // // cache strings that need to be localized but haven't been?\n // if( localize.cacheNonLocalized && !localeStrings.hasOwnProperty( strToLocalize ) ){\n // // console.debug( 'localization NOT found:', strToLocalize );\n // // add nonCached as hash directly to this function\n // localize.nonLocalized = localize.nonLocalized || {};\n // localize.nonLocalized[ locale ] = localize.nonLocalized[ locale ] || {};\n // localize.nonLocalized[ locale ][ strToLocalize ] = false;\n // }\n\n // return the localized version from the closure if it's there, the strToLocalize if not\n return localeStrings[strToLocalize] || strToLocalize;\n };\n localize.cacheNonLocalized = false;\n\n // =============================================================================\n return localize;\n});\n"]}
|
||||
{"version":3,"sources":["utils/localization.js"],"names":["define","localeStrings","hasOwnProperty","locale","navigator","language","userLanguage","toLowerCase","split","__root","localize","strToLocalize","cacheNonLocalized"],"mappings":"AAAAA,QAAQ,mBAAoB,SAASC,GAMjC,GAAIA,EAAcC,eAAe,UAAW,CAExC,IAAIC,EACqB,oBAAdC,UACD,UACCA,UAAUC,UACPD,UAAUE,cACV,UACFC,cACZN,EACIA,EAAc,KAAOE,IACrBF,EAAc,KAAOE,EAAOK,MAAM,KAAK,KACvCP,EAAcQ,OAatB,IAAIC,EAAW,SAASC,GAcpB,OAAOV,EAAcU,IAAkBA,GAK3C,OAHAD,EAASE,mBAAoB,EAGtBF","file":"../../scripts/utils/localization.js","sourcesContent":["define([\"i18n!nls/locale\"], function(localeStrings) {\n // =============================================================================\n /** Simple string replacement localization. Language data from galaxy/scripts/nls */\n\n // support both requirejs and webpack from the same file\n // if loaded via webpack, it will be a different format than via requirejs - convert\n if (localeStrings.hasOwnProperty(\"__root\")) {\n //console.debug( 'amdi18n+webpack localization for ' + locale + ' loaded' );\n var locale =\n typeof navigator === \"undefined\"\n ? \"__root\"\n : (navigator.language ||\n navigator.userLanguage ||\n \"__root\"\n ).toLowerCase();\n localeStrings =\n localeStrings[\"__\" + locale] ||\n localeStrings[\"__\" + locale.split(\"-\")[0]] ||\n localeStrings.__root;\n\n // } else {\n // console.debug( 'i18n+requirejs localization for ' + locale + ' loaded' );\n }\n // TODO: when this is no longer necessary remove this, i18n.js, and the resolveModule in config\n\n // -----------------------------------------------------------------------------\n /** Attempt to get a localized string for strToLocalize. If not found, return\n * the original strToLocalize.\n * @param {String} strToLocalize the string to localize\n * @returns either the localized string if found or strToLocalize if not found\n */\n var localize = function(strToLocalize) {\n // console.debug( 'amdi18n.localize:', strToLocalize, '->', localeStrings[ strToLocalize ] || strToLocalize );\n\n // //TODO: conditional compile on DEBUG flag\n // // cache strings that need to be localized but haven't been?\n // if( localize.cacheNonLocalized && !localeStrings.hasOwnProperty( strToLocalize ) ){\n // // console.debug( 'localization NOT found:', strToLocalize );\n // // add nonCached as hash directly to this function\n // localize.nonLocalized = localize.nonLocalized || {};\n // localize.nonLocalized[ locale ] = localize.nonLocalized[ locale ] || {};\n // localize.nonLocalized[ locale ][ strToLocalize ] = false;\n // }\n\n // return the localized version from the closure if it's there, the strToLocalize if not\n return localeStrings[strToLocalize] || strToLocalize;\n };\n localize.cacheNonLocalized = false;\n\n // =============================================================================\n return localize;\n});\n"]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define("i18n",[],function(){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};!function(){function n(o,n,t,e,r,i){n[o]&&(t.push(o),!0!==n[o]&&1!==n[o]||e.push(r+o+"/"+i))}function t(o,n,t,e,r){var i=e+n+"/"+r;require._fileExists(o.toUrl(i+".js"))&&t.push(i)}function e(n,t,r){var i;for(i in t)!t.hasOwnProperty(i)||n.hasOwnProperty(i)&&!r?"object"===o(t[i])&&(!n[i]&&t[i]&&(n[i]={}),e(n[i],t[i],r)):n[i]=t[i]}var r=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define(["module"],function(o){var i=o.config?o.config():{};return{version:"2.0.6",load:function(o,a,l,u){(u=u||{}).locale&&(i.locale=u.locale);var f,c,s,g=r.exec(o),p=g[1],y=g[4],v=g[5],h=y.split("-"),b=[],m={},d="";if(g[5]?f=(p=g[1])+v:(f=o,v=g[4],(y=i.locale)||(y=i.locale="undefined"==typeof navigator?"root":(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage||"root").toLowerCase()),h=y.split("-")),u.isBuild){for(b.push(f),t(a,"root",b,p,v),c=0;c<h.length;c++)s=h[c],t(a,d+=(d?"-":"")+s,b,p,v);a(b,function(){l()})}else a([f],function(o){var t,r=[];for(n("root",o,r,b,p,v),c=0;c<h.length;c++)t=h[c],n(d+=(d?"-":"")+t,o,r,b,p,v);a(b,function(){var n,t,i;for(n=r.length-1;n>-1&&r[n];n--)!0!==(t=o[i=r[n]])&&1!==t||(t=a(p+i+"/"+v)),e(m,t);l(m)})})}}})}()});
|
||||
!function(){"use strict";function o(o,n,e,a,t,r){n[o]&&(e.push(o),!0!==n[o]&&1!==n[o]||a.push(t+o+"/"+r))}function n(o,n,e,a,t){var r=a+n+"/"+t;require._fileExists(o.toUrl(r+".js"))&&e.push(r)}function e(o,n,a){var t;for(t in n)!n.hasOwnProperty(t)||o.hasOwnProperty(t)&&!a?"object"==typeof n[t]&&(!o[t]&&n[t]&&(o[t]={}),e(o[t],n[t],a)):o[t]=n[t]}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define(["module"],function(t){var r=t.config?t.config():{};return{version:"2.0.6",load:function(t,i,l,u){(u=u||{}).locale&&(r.locale=u.locale);var f,s,c,g=a.exec(t),v=g[1],p=g[4],h=g[5],d=p.split("-"),y=[],w={},j="";if(g[5]?f=(v=g[1])+h:(f=t,h=g[4],(p=r.locale)||(p=r.locale="undefined"==typeof navigator?"root":(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage||"root").toLowerCase()),d=p.split("-")),u.isBuild){for(y.push(f),n(i,"root",y,v,h),s=0;s<d.length;s++)c=d[s],n(i,j+=(j?"-":"")+c,y,v,h);i(y,function(){l()})}else i([f],function(n){var a,t=[];for(o("root",n,t,y,v,h),s=0;s<d.length;s++)a=d[s],o(j+=(j?"-":"")+a,n,t,y,v,h);i(y,function(){var o,a,r;for(o=t.length-1;o>-1&&t[o];o--)!0!==(a=n[r=t[o]])&&1!==a||(a=i(v+r+"/"+h)),e(w,a);l(w)})})}}})}();
|
||||
//# sourceMappingURL=../maps/i18n.js.map
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define("utils/localization",[],function(){"use strict";define(["i18n!nls/locale"],function(o){if(o.hasOwnProperty("__root")){var n="undefined"==typeof navigator?"__root":(navigator.language||navigator.userLanguage||"__root").toLowerCase();o=o["__"+n]||o["__"+n.split("-")[0]]||o.__root}var t=function(n){return o[n]||n};return t.cacheNonLocalized=!1,t})});
|
||||
define(["i18n!nls/locale"],function(o){if(o.hasOwnProperty("__root")){var n="undefined"==typeof navigator?"__root":(navigator.language||navigator.userLanguage||"__root").toLowerCase();o=o["__"+n]||o["__"+n.split("-")[0]]||o.__root}var a=function(n){return o[n]||n};return a.cacheNonLocalized=!1,a});
|
||||
//# sourceMappingURL=../../maps/utils/localization.js.map
|
||||
|
||||
Reference in New Issue
Block a user