diff --git a/lib/jquery.i18n/jquery.i18n.emitter.bidi.js b/lib/jquery.i18n/jquery.i18n.emitter.bidi.js index 3a5b6251..51ce01a3 100644 --- a/lib/jquery.i18n/jquery.i18n.emitter.bidi.js +++ b/lib/jquery.i18n/jquery.i18n.emitter.bidi.js @@ -51,7 +51,7 @@ if ( !m ) { return null; } - if ( m[2] === undefined ) { + if ( m[ 2 ] === undefined ) { return 'ltr'; } return 'rtl'; @@ -72,17 +72,17 @@ * direction inference). The latter is cleaner but still not widely supported. */ bidi: function ( nodes ) { - var dir = strongDirFromContent( nodes[0] ); + var dir = strongDirFromContent( nodes[ 0 ] ); if ( dir === 'ltr' ) { // Wrap in LEFT-TO-RIGHT EMBEDDING ... POP DIRECTIONAL FORMATTING - return '\u202A' + nodes[0] + '\u202C'; + return '\u202A' + nodes[ 0 ] + '\u202C'; } if ( dir === 'rtl' ) { // Wrap in RIGHT-TO-LEFT EMBEDDING ... POP DIRECTIONAL FORMATTING - return '\u202B' + nodes[0] + '\u202C'; + return '\u202B' + nodes[ 0 ] + '\u202C'; } // No strong directionality: do not wrap - return nodes[0]; + return nodes[ 0 ]; } } ); }( jQuery ) ); diff --git a/lib/jquery.i18n/jquery.i18n.emitter.js b/lib/jquery.i18n/jquery.i18n.emitter.js index b26f147d..628222b8 100644 --- a/lib/jquery.i18n/jquery.i18n.emitter.js +++ b/lib/jquery.i18n/jquery.i18n.emitter.js @@ -17,7 +17,7 @@ 'use strict'; var MessageParserEmitter = function () { - this.language = $.i18n.languages[String.locale] || $.i18n.languages['default']; + this.language = $.i18n.languages[ String.locale ] || $.i18n.languages[ 'default' ]; }; MessageParserEmitter.prototype = { @@ -48,10 +48,10 @@ return messageParserEmitter.emit( n, replacements ); } ); - operation = node[0].toLowerCase(); + operation = node[ 0 ].toLowerCase(); - if ( typeof messageParserEmitter[operation] === 'function' ) { - ret = messageParserEmitter[operation]( subnodes, replacements ); + if ( typeof messageParserEmitter[ operation ] === 'function' ) { + ret = messageParserEmitter[ operation ]( subnodes, replacements ); } else { throw new Error( 'unknown operation "' + operation + '"' ); } @@ -106,11 +106,11 @@ * @return {string} replacement */ replace: function ( nodes, replacements ) { - var index = parseInt( nodes[0], 10 ); + var index = parseInt( nodes[ 0 ], 10 ); if ( index < replacements.length ) { // replacement is not a string, don't touch! - return replacements[index]; + return replacements[ index ]; } else { // index not found, fallback to displaying variable return '$' + ( index + 1 ); @@ -128,7 +128,7 @@ * language. */ plural: function ( nodes ) { - var count = parseFloat( this.language.convertNumber( nodes[0], 10 ) ), + var count = parseFloat( this.language.convertNumber( nodes[ 0 ], 10 ) ), forms = nodes.slice( 1 ); return forms.length ? this.language.convertPlural( count, forms ) : ''; @@ -142,7 +142,7 @@ * @return {String} selected gender form according to current language */ gender: function ( nodes ) { - var gender = nodes[0], + var gender = nodes[ 0 ], forms = nodes.slice( 1 ); return this.language.gender( gender, forms ); @@ -157,8 +157,8 @@ * language. */ grammar: function ( nodes ) { - var form = nodes[0], - word = nodes[1]; + var form = nodes[ 0 ], + word = nodes[ 1 ]; return word && form && this.language.convertGrammar( word, form ); } diff --git a/lib/jquery.i18n/jquery.i18n.js b/lib/jquery.i18n/jquery.i18n.js index 9236e4e2..ffd30784 100644 --- a/lib/jquery.i18n/jquery.i18n.js +++ b/lib/jquery.i18n/jquery.i18n.js @@ -75,7 +75,7 @@ break; } - locale = ( $.i18n.fallbacks[i18n.locale] && $.i18n.fallbacks[i18n.locale][fallbackIndex] ) || + locale = ( $.i18n.fallbacks[ i18n.locale ] && $.i18n.fallbacks[ i18n.locale ][ fallbackIndex ] ) || i18n.options.fallbackLocale; $.i18n.log( 'Trying fallback locale for ' + i18n.locale + ': ' + locale ); @@ -146,12 +146,12 @@ source.split( '.' ).pop() !== 'json' ) { // Load specified locale then check for fallbacks when directory is specified in load() - sourceMap[locale] = source + '/' + locale + '.json'; - fallbackLocales = ( $.i18n.fallbacks[locale] || [] ) + sourceMap[ locale ] = source + '/' + locale + '.json'; + fallbackLocales = ( $.i18n.fallbacks[ locale ] || [] ) .concat( this.options.fallbackLocale ); for ( locIndex in fallbackLocales ) { - fallbackLocale = fallbackLocales[locIndex]; - sourceMap[fallbackLocale] = source + '/' + fallbackLocale + '.json'; + fallbackLocale = fallbackLocales[ locIndex ]; + sourceMap[ fallbackLocale ] = source + '/' + fallbackLocale + '.json'; } return this.load( sourceMap ); } else { @@ -172,7 +172,7 @@ // FIXME: This changes the state of the I18N object, // should probably not change the 'this.parser' but just // pass it to the parser. - this.parser.language = $.i18n.languages[$.i18n().locale] || $.i18n.languages['default']; + this.parser.language = $.i18n.languages[ $.i18n().locale ] || $.i18n.languages[ 'default' ]; if ( message === '' ) { message = key; } @@ -262,7 +262,7 @@ parse: function ( message, parameters ) { return message.replace( /\$(\d+)/g, function ( str, match ) { var index = parseInt( match, 10 ) - 1; - return parameters[index] !== undefined ? parameters[index] : '$' + match; + return parameters[ index ] !== undefined ? parameters[ index ] : '$' + match; } ); }, emitter: {} diff --git a/lib/jquery.i18n/jquery.i18n.language.js b/lib/jquery.i18n/jquery.i18n.language.js index e596fbc8..c1eaec01 100644 --- a/lib/jquery.i18n/jquery.i18n.language.js +++ b/lib/jquery.i18n/jquery.i18n.language.js @@ -285,13 +285,13 @@ // Handle for Explicit 0= & 1= values for ( index = 0; index < forms.length; index++ ) { - form = forms[index]; + form = forms[ index ]; if ( explicitPluralPattern.test( form ) ) { formCount = parseInt( form.substring( 0, form.indexOf( '=' ) ), 10 ); if ( formCount === count ) { return ( form.substr( form.indexOf( '=' ) + 1 ) ); } - forms[index] = undefined; + forms[ index ] = undefined; } } @@ -301,17 +301,17 @@ } } ); - pluralRules = this.pluralRules[$.i18n().locale]; + pluralRules = this.pluralRules[ $.i18n().locale ]; if ( !pluralRules ) { // default fallback. - return ( count === 1 ) ? forms[0] : forms[1]; + return ( count === 1 ) ? forms[ 0 ] : forms[ 1 ]; } pluralFormIndex = this.getPluralForm( count, pluralRules ); pluralFormIndex = Math.min( pluralFormIndex, forms.length - 1 ); - return forms[pluralFormIndex]; + return forms[ pluralFormIndex ]; }, /** @@ -327,8 +327,8 @@ pluralFormIndex = 0; for ( i = 0; i < pluralForms.length; i++ ) { - if ( pluralRules[pluralForms[i]] ) { - if ( pluralRuleParser( pluralRules[pluralForms[i]], number ) ) { + if ( pluralRules[ pluralForms[ i ] ] ) { + if ( pluralRuleParser( pluralRules[ pluralForms[ i ] ], number ) ) { return pluralFormIndex; } @@ -367,17 +367,17 @@ tmp = []; for ( item in transformTable ) { - tmp[transformTable[item]] = item; + tmp[ transformTable[ item ] ] = item; } transformTable = tmp; } for ( i = 0; i < numberString.length; i++ ) { - if ( transformTable[numberString[i]] ) { - convertedNumber += transformTable[numberString[i]]; + if ( transformTable[ numberString[ i ] ] ) { + convertedNumber += transformTable[ numberString[ i ] ]; } else { - convertedNumber += numberString[i]; + convertedNumber += numberString[ i ]; } } @@ -418,18 +418,18 @@ } while ( forms.length < 2 ) { - forms.push( forms[forms.length - 1] ); + forms.push( forms[ forms.length - 1 ] ); } if ( gender === 'male' ) { - return forms[0]; + return forms[ 0 ]; } if ( gender === 'female' ) { - return forms[1]; + return forms[ 1 ]; } - return ( forms.length === 3 ) ? forms[2] : forms[0]; + return ( forms.length === 3 ) ? forms[ 2 ] : forms[ 0 ]; }, /** @@ -458,11 +458,11 @@ bo: '༠༡༢༣༤༥༦༧༨༩' // FIXME use iso 639 codes }; - if ( !tables[language] ) { + if ( !tables[ language ] ) { return false; } - return tables[language].split( '' ); + return tables[ language ].split( '' ); } }; diff --git a/lib/jquery.i18n/jquery.i18n.messagestore.js b/lib/jquery.i18n/jquery.i18n.messagestore.js index 759295ce..da47f136 100644 --- a/lib/jquery.i18n/jquery.i18n.messagestore.js +++ b/lib/jquery.i18n/jquery.i18n.messagestore.js @@ -74,7 +74,7 @@ locale = key; // No {locale} given, assume data is a group of languages, // call this function again for each language. - deferreds.push( messageStore.load( source[key], locale ) ); + deferreds.push( messageStore.load( source[ key ], locale ) ); } } return $.when.apply( $, deferreds ); @@ -89,10 +89,10 @@ * @param messages */ set: function ( locale, messages ) { - if ( !this.messages[locale] ) { - this.messages[locale] = messages; + if ( !this.messages[ locale ] ) { + this.messages[ locale ] = messages; } else { - this.messages[locale] = $.extend( this.messages[locale], messages ); + this.messages[ locale ] = $.extend( this.messages[ locale ], messages ); } }, @@ -103,7 +103,7 @@ * @returns {Boolean} */ get: function ( locale, messageKey ) { - return this.messages[locale] && this.messages[locale][messageKey]; + return this.messages[ locale ] && this.messages[ locale ][ messageKey ]; } }; diff --git a/lib/jquery.i18n/jquery.i18n.parser.js b/lib/jquery.i18n/jquery.i18n.parser.js index 3dea2842..0b147e01 100644 --- a/lib/jquery.i18n/jquery.i18n.parser.js +++ b/lib/jquery.i18n/jquery.i18n.parser.js @@ -18,7 +18,7 @@ var MessageParser = function ( options ) { this.options = $.extend( {}, $.i18n.parser.defaults, options ); - this.language = $.i18n.languages[String.locale] || $.i18n.languages['default']; + this.language = $.i18n.languages[ String.locale ] || $.i18n.languages[ 'default' ]; this.emitter = $.i18n.parser.emitter; }; @@ -30,7 +30,7 @@ return message.replace( /\$(\d+)/g, function ( str, match ) { var index = parseInt( match, 10 ) - 1; - return parameters[index] !== undefined ? parameters[index] : '$' + match; + return parameters[ index ] !== undefined ? parameters[ index ] : '$' + match; } ); }, @@ -39,8 +39,8 @@ return this.simpleParse( message, replacements ); } - this.emitter.language = $.i18n.languages[$.i18n().locale] || - $.i18n.languages['default']; + this.emitter.language = $.i18n.languages[ $.i18n().locale ] || + $.i18n.languages[ 'default' ]; return this.emitter.emit( this.ast( message ), replacements ); }, @@ -58,7 +58,7 @@ var i, result; for ( i = 0; i < parserSyntax.length; i++ ) { - result = parserSyntax[i](); + result = parserSyntax[ i ](); if ( result !== null ) { return result; @@ -78,7 +78,7 @@ result = []; for ( i = 0; i < parserSyntax.length; i++ ) { - res = parserSyntax[i](); + res = parserSyntax[ i ](); if ( res === null ) { pos = originalPos; @@ -140,9 +140,9 @@ return null; } - pos += matches[0].length; + pos += matches[ 0 ].length; - return matches[0]; + return matches[ 0 ]; }; } @@ -189,7 +189,7 @@ function escapedLiteral() { var result = sequence( [ backslash, anyCharacter ] ); - return result === null ? null : result[1]; + return result === null ? null : result[ 1 ]; } choice( [ escapedLiteral, regularLiteralWithoutSpace ] ); @@ -203,7 +203,7 @@ return null; } - return [ 'REPLACE', parseInt( result[1], 10 ) - 1 ]; + return [ 'REPLACE', parseInt( result[ 1 ], 10 ) - 1 ]; } templateName = transform( @@ -224,23 +224,23 @@ return null; } - expr = result[1]; + expr = result[ 1 ]; // use a "CONCAT" operator if there are multiple nodes, // otherwise return the first node, raw. - return expr.length > 1 ? [ 'CONCAT' ].concat( expr ) : expr[0]; + return expr.length > 1 ? [ 'CONCAT' ].concat( expr ) : expr[ 0 ]; } function templateWithReplacement() { var result = sequence( [ templateName, colon, replacement ] ); - return result === null ? null : [ result[0], result[2] ]; + return result === null ? null : [ result[ 0 ], result[ 2 ] ]; } function templateWithOutReplacement() { var result = sequence( [ templateName, colon, paramExpression ] ); - return result === null ? null : [ result[0], result[2] ]; + return result === null ? null : [ result[ 0 ], result[ 2 ] ]; } templateContents = choice( [ @@ -254,7 +254,7 @@ nOrMore( 0, templateParam ) ] ); - return res === null ? null : res[0].concat( res[1] ); + return res === null ? null : res[ 0 ].concat( res[ 1 ] ); }, function () { var res = sequence( [ templateName, nOrMore( 0, templateParam ) ] ); @@ -263,7 +263,7 @@ return null; } - return [ res[0] ].concat( res[1] ); + return [ res[ 0 ] ].concat( res[ 1 ] ); } ] ); @@ -273,7 +273,7 @@ function template() { var result = sequence( [ openTemplate, templateContents, closeTemplate ] ); - return result === null ? null : result[1]; + return result === null ? null : result[ 1 ]; } expression = choice( [ template, replacement, literal ] ); diff --git a/lib/jquery.i18n/languages/bs.js b/lib/jquery.i18n/languages/bs.js index 5370069e..cd0cca22 100644 --- a/lib/jquery.i18n/languages/bs.js +++ b/lib/jquery.i18n/languages/bs.js @@ -4,7 +4,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.bs = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.bs = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'instrumental': // instrumental diff --git a/lib/jquery.i18n/languages/dsb.js b/lib/jquery.i18n/languages/dsb.js index cc069ebf..a1d33ac2 100644 --- a/lib/jquery.i18n/languages/dsb.js +++ b/lib/jquery.i18n/languages/dsb.js @@ -4,7 +4,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.dsb = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.dsb = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'instrumental': // instrumental diff --git a/lib/jquery.i18n/languages/fi.js b/lib/jquery.i18n/languages/fi.js index d8e9578a..82c56506 100644 --- a/lib/jquery.i18n/languages/fi.js +++ b/lib/jquery.i18n/languages/fi.js @@ -7,7 +7,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.fi = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.fi = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { // vowel harmony flag var aou = word.match( /[aou][^äöy]*$/i ), diff --git a/lib/jquery.i18n/languages/ga.js b/lib/jquery.i18n/languages/ga.js index 1aceab75..ac03a092 100644 --- a/lib/jquery.i18n/languages/ga.js +++ b/lib/jquery.i18n/languages/ga.js @@ -4,7 +4,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.ga = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.ga = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { if ( form === 'ainmlae' ) { switch ( word ) { diff --git a/lib/jquery.i18n/languages/he.js b/lib/jquery.i18n/languages/he.js index cbbe90b9..44d810b4 100644 --- a/lib/jquery.i18n/languages/he.js +++ b/lib/jquery.i18n/languages/he.js @@ -4,7 +4,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.he = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.he = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'prefixed': diff --git a/lib/jquery.i18n/languages/hsb.js b/lib/jquery.i18n/languages/hsb.js index 957616f6..51a3d177 100644 --- a/lib/jquery.i18n/languages/hsb.js +++ b/lib/jquery.i18n/languages/hsb.js @@ -4,7 +4,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.hsb = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.hsb = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'instrumental': // instrumental diff --git a/lib/jquery.i18n/languages/hu.js b/lib/jquery.i18n/languages/hu.js index 1177b850..7f1f7034 100644 --- a/lib/jquery.i18n/languages/hu.js +++ b/lib/jquery.i18n/languages/hu.js @@ -6,7 +6,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.hu = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.hu = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'rol': diff --git a/lib/jquery.i18n/languages/hy.js b/lib/jquery.i18n/languages/hy.js index 9c568992..23bb0213 100644 --- a/lib/jquery.i18n/languages/hy.js +++ b/lib/jquery.i18n/languages/hy.js @@ -5,7 +5,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.hy = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.hy = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { if ( form === 'genitive' ) { // սեռական հոլով if ( word.substr( -1 ) === 'ա' ) { diff --git a/lib/jquery.i18n/languages/la.js b/lib/jquery.i18n/languages/la.js index 11c1122d..fa6b66cf 100644 --- a/lib/jquery.i18n/languages/la.js +++ b/lib/jquery.i18n/languages/la.js @@ -7,7 +7,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.la = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.la = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'genitive': diff --git a/lib/jquery.i18n/languages/ml.js b/lib/jquery.i18n/languages/ml.js index f724b7b2..f3d67886 100644 --- a/lib/jquery.i18n/languages/ml.js +++ b/lib/jquery.i18n/languages/ml.js @@ -7,7 +7,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.ml = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.ml = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { form = form.toLowerCase(); switch ( form ) { diff --git a/lib/jquery.i18n/languages/os.js b/lib/jquery.i18n/languages/os.js index 47443671..fed63aea 100644 --- a/lib/jquery.i18n/languages/os.js +++ b/lib/jquery.i18n/languages/os.js @@ -7,7 +7,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.os = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.os = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { var endAllative, jot, hyphen, ending; diff --git a/lib/jquery.i18n/languages/ru.js b/lib/jquery.i18n/languages/ru.js index 893b2386..684660b6 100644 --- a/lib/jquery.i18n/languages/ru.js +++ b/lib/jquery.i18n/languages/ru.js @@ -5,7 +5,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.ru = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.ru = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { if ( form === 'genitive' ) { // родительный падеж if ( word.substr( -1 ) === 'ь' ) { diff --git a/lib/jquery.i18n/languages/sl.js b/lib/jquery.i18n/languages/sl.js index a3aafc3b..0e14ed5f 100644 --- a/lib/jquery.i18n/languages/sl.js +++ b/lib/jquery.i18n/languages/sl.js @@ -5,7 +5,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.sl = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.sl = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { // locative diff --git a/lib/jquery.i18n/languages/uk.js b/lib/jquery.i18n/languages/uk.js index 8e69efcd..bb99073e 100644 --- a/lib/jquery.i18n/languages/uk.js +++ b/lib/jquery.i18n/languages/uk.js @@ -5,7 +5,7 @@ ( function ( $ ) { 'use strict'; - $.i18n.languages.uk = $.extend( {}, $.i18n.languages['default'], { + $.i18n.languages.uk = $.extend( {}, $.i18n.languages[ 'default' ], { convertGrammar: function ( word, form ) { switch ( form ) { case 'genitive': // родовий відмінок