Thanks for all the feedback, javascript isn't really my first language.
I'll fix these things and get back.

10 feb 2014 kl. 02:33 skrev Aurimas Vinckevicius <notifications@github.com>:

In BibLaTeX.js:

>  			if (item.language) {
> -				var lang = languageMap[item.language.slice(0, 2)]
> -				if (typeof lang == 'string' || lang instanceof String) {
> -					//if there are no variants for this language
> -					writeField("langid", lang);
> -				} else if (typeof lang == 'object') {
> -					var variant = lang[item.language.slice(3, 5)];
> -					if (variant) {
> -						writeField("langid", variant);
> -					} else {
> -						writeField("langid", lang[""]); //use default variant
> +				var langcode = item.language.match(/^([a-z]{2,3})(?:[^a-z](.+))?$/i); //not too strict
> +				if(langcode && typeof langcode[1] !== 'undefined'){
> +					var lang = babelLanguageMap[langcode[1]];
> +					if (typeof lang == 'string' || lang instanceof String) {

Given the map above, I don't see how lang instanceof String can ever be
true.

--
Reply to this email directly or view it on
GitHub<https://github.com/zotero/translators/pull/674/files#r9572566>
.