Add new directory structure. Tags will contain current and past releases, and stable will contain any bug fixes to the current stable release so users won't have to get the potentially broken trunk build to fix a screwup in stable.
Trunk updated to 0.9 git-svn-id: http://kusabax.cultnet.net/svn/repo/stable@176 73d99b7e-4f53-4972-b7b7-2ecd3c4d89ee
This commit is contained in:
commit
88bacfad9c
316 files changed
+79806
No files matched your search
@@ -0,0 +1 @@
|
||||
Gettext=function(a){this.domain='messages';this.locale_data=undefined;var b=["domain","locale_data"];if(this.isValidObject(a)){for(var i in a){for(var j=0;j<b.length;j++){if(i==b[j]){if(this.isValidObject(a[i]))this[i]=a[i]}}}}this.try_load_lang();return this};Gettext.context_glue="\004";Gettext._locale_data={};Gettext.prototype.try_load_lang=function(){if(typeof(this.locale_data)!='undefined'){var a=this.locale_data;this.locale_data=undefined;this.parse_locale_data(a);if(typeof(Gettext._locale_data[this.domain])=='undefined'){throw new Error("Error: Gettext 'locale_data' does not contain the domain '"+this.domain+"'");}}var b=this.get_lang_refs();if(typeof(b)=='object'&&b.length>0){for(var i=0;i<b.length;i++){var c=b[i];if(c.type=='application/json'){if(!this.try_load_lang_json(c.href)){throw new Error("Error: Gettext 'try_load_lang_json' failed. Unable to exec xmlhttprequest for link ["+c.href+"]");}}else if(c.type=='application/x-po'){if(!this.try_load_lang_po(c.href)){throw new Error("Error: Gettext 'try_load_lang_po' failed. Unable to exec xmlhttprequest for link ["+c.href+"]");}}else{throw new Error("TODO: link type ["+c.type+"] found, and support is planned, but not implemented at this time.");}}}};Gettext.prototype.parse_locale_data=function(a){if(typeof(Gettext._locale_data)=='undefined'){Gettext._locale_data={}}for(var b in a){if((!a.hasOwnProperty(b))||(!this.isValidObject(a[b])))continue;var c=false;for(var d in a[b]){c=true;break}if(!c)continue;var e=a[b];if(b=="")b="messages";if(!this.isValidObject(Gettext._locale_data[b]))Gettext._locale_data[b]={};if(!this.isValidObject(Gettext._locale_data[b].head))Gettext._locale_data[b].head={};if(!this.isValidObject(Gettext._locale_data[b].msgs))Gettext._locale_data[b].msgs={};for(var f in e){if(f==""){var g=e[f];for(var i in g){var h=i.toLowerCase();Gettext._locale_data[b].head[h]=g[i]}}else{Gettext._locale_data[b].msgs[f]=e[f]}}}for(var b in Gettext._locale_data){if(this.isValidObject(Gettext._locale_data[b].head['plural-forms'])&&typeof(Gettext._locale_data[b].head.plural_func)=='undefined'){var j=Gettext._locale_data[b].head['plural-forms'];var k=new RegExp('^(\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;a-zA-Z0-9_\(\)])+)','m');if(k.test(j)){var l=Gettext._locale_data[b].head['plural-forms'];if(!/;\s*$/.test(l))l=l.concat(';');var m='var plural; var nplurals; '+l+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };';Gettext._locale_data[b].head.plural_func=new Function("n",m)}else{throw new Error("Syntax error in language file. Plural-Forms header is invalid ["+j+"]");}}else if(typeof(Gettext._locale_data[b].head.plural_func)=='undefined'){Gettext._locale_data[b].head.plural_func=function(n){var p=(n!=1)?1:0;return{'nplural':2,'plural':p}}}}return};Gettext.prototype.try_load_lang_po=function(a){var b=this.sjax(a);if(!b)return;var c=this.uri_basename(a);var d=this.parse_po(b);var e={};if(d){if(!d[""])d[""]={};if(!d[""]["domain"])d[""]["domain"]=c;c=d[""]["domain"];e[c]=d;this.parse_locale_data(e)}return 1};Gettext.prototype.uri_basename=function(a){var b;if(b=a.match(/^(.*\/)?(.*)/)){var c;if(c=b[2].match(/^(.*)\..+$/))return c[1];else return b[2]}else{return""}};Gettext.prototype.parse_po=function(a){var b={};var c={};var d="";var e=[];var f=a.split("\n");for(var i=0;i<f.length;i++){f[i]=f[i].replace(/(\n|\r)+$/,'');var g;if(/^$/.test(f[i])){if(typeof(c['msgid'])!='undefined'){var h=(typeof(c['msgctxt'])!='undefined'&&c['msgctxt'].length)?c['msgctxt']+Gettext.context_glue+c['msgid']:c['msgid'];var j=(typeof(c['msgid_plural'])!='undefined'&&c['msgid_plural'].length)?c['msgid_plural']:null;var k=[];for(var l in c){var g;if(g=l.match(/^msgstr_(\d+)/))k[parseInt(g[1])]=c[l]}k.unshift(j);if(k.length>1)b[h]=k;c={};d=""}}else if(/^#/.test(f[i])){continue}else if(g=f[i].match(/^msgctxt\s+(.*)/)){d='msgctxt';c[d]=this.parse_po_dequote(g[1])}else if(g=f[i].match(/^msgid\s+(.*)/)){d='msgid';c[d]=this.parse_po_dequote(g[1])}else if(g=f[i].match(/^msgid_plural\s+(.*)/)){d='msgid_plural';c[d]=this.parse_po_dequote(g[1])}else if(g=f[i].match(/^msgstr\s+(.*)/)){d='msgstr_0';c[d]=this.parse_po_dequote(g[1])}else if(g=f[i].match(/^msgstr\[0\]\s+(.*)/)){d='msgstr_0';c[d]=this.parse_po_dequote(g[1])}else if(g=f[i].match(/^msgstr\[(\d+)\]\s+(.*)/)){d='msgstr_'+g[1];c[d]=this.parse_po_dequote(g[2])}else if(/^"/.test(f[i])){c[d]+=this.parse_po_dequote(f[i])}else{e.push("Strange line ["+i+"] : "+f[i])}}if(typeof(c['msgid'])!='undefined'){var h=(typeof(c['msgctxt'])!='undefined'&&c['msgctxt'].length)?c['msgctxt']+Gettext.context_glue+c['msgid']:c['msgid'];var j=(typeof(c['msgid_plural'])!='undefined'&&c['msgid_plural'].length)?c['msgid_plural']:null;var k=[];for(var l in c){var g;if(g=l.match(/^msgstr_(\d+)/))k[parseInt(g[1])]=c[l]}k.unshift(j);if(k.length>1)b[h]=k;c={};d=""}if(b[""]&&b[""][1]){var m={};var n=b[""][1].split(/\\n/);for(var i=0;i<n.length;i++){if(!n.length)continue;var o=n[i].indexOf(':',0Line truncated
|
||||
Reference in new issue
Block a user