b26dedd Jan 16, 2017
@jamuhl @svetlyak40wt
461 lines (360 sloc) 19.1 KB


  • Nested keys should not be escaped by default #854
  • Make sure i18next.init() runs for i18next.cloneInstance() #860


  • adds i18next.isInitialized when isInitialized
  • triggers backend loaded event before initialized

4.1.3 / 4.1.4

  • smaller changes suggested to still inofficial support ie8 #852


  • fixes same interpolation object with multiple getFixedT() in different locales yields wrong translation #851
  • updated all build deps


  • remove subs array from logger - no longer keep changing debug flag on subs if changing on main


  • Custom escape function, single-quotes in nested #843


  • [BREAKING; only webpack2-beta users] will add module entry point used by webpack2, this might break your current build with webpack2-beta if configured incorrectly, see: #836


  • remove the module entry point again will be added in 4.0.0


  • fix build output add a test file to test the generated build


  • Setting options on individual translations override, rather than merge global configs #832
  • Create an new translator when cloning i18next instance #834
  • allows fallbackLng to be an string, an array or an object defining fallbacks for lng, lng-region plus default, eg

    fallbackLng: { 'de-CH': ['fr', 'it', 'en'], 'de': ['fr', 'en'], 'zh-Hans': ['zh-Hant', 'en'], 'zh-Hant': ['zh-Hans', 'en'], 'default': ['en'] }


  • Fix Interpolator.escapeValue defaulting to undefined in some cases #826


  • Fix Interpolator formatter exception error propagation due to not reset RegExp indices #820


  • assert dir function does not crash if no language available


  • fix issue with format containing formatSeparator for interpolation formatting


  • adds formatting 'format this: {{var, formatRule}}' having a function on options.interpolation.format: function(value, format, lng) { return value } like suggested here #774


  • fixed an issue with several unescaped key in the interpolation string #746


  • allows option nonExplicitWhitelist on init #741


  • adds api function i18next.reloadResources(), i18next.reloadResources(lngs, ns) to trigger a reload of translations


  • emits missingKey always (like console.log) even if saveMissing is of -> use missingKeyHandler if you only want the trigger only on saveMissing: true


  • [BREAKING] per default i18next uses now the same index as used in gettext for plurals. eg. for arabic suffixes are 0,1,2,3,4,5 instead of 0,1,2,3,11,100. You can enforce old behaviour by setting compatibilityJSON = 'v2' on i18next init.
  • [BREAKING] AMD export will be unnamed now
  • don't call saveMissing if no lng


  • fixes rtl support #656


  • allow null or empty string as defaultValue
  • init option initImmediate (default: true) to init without immediate


  • if passing resources don't immediate loading fixes #636


  • support now language code variants with scripts and other exotic forms: zh-Hans-MO, sgn-BE-fr, de-AT-1996,...
  • trigger of changeLanguage, load of data with a setTimeout to allow other operations meanwhile


  • Only add language to preload array when new #613



  • add index to make export compatible again


  • build /dist/es with included babelhelpers


  • change build chain to use rollup...allows 'js:next' and reduces build from 45kb to 33kb minified (/lib --> /dist/commonjs folder, new /dist/es for rollup,...)
  • fixes detection when using both context and pluralization and context not found. #851


  • return instance after init for further chaning
  • make init optional on backend, cache
  • package.json entry points now to /lib not to mangled version...this might be the better solution for most use cases (build chains built on npm, webpack, browserify, node,...)


  • allow keySeparator, nsSeparator = false to turn that off


  • extended emitted arguments on 'added' event


  • fixes unneeded reload of resources that failed to load


  • fixes returnObjects in case of multiple namespaces


  • add options for context, pluralSeparator


  • clear done load request in backendConnector


  • pass full options to detectors as third arg


  • do not callback err in backendConnector if no backend is specified


  • check for fallbackLng exist


  • adds cimode to options.whitelist if set
  • emits failedLoading on load error


  • adds addResource to i18next API
  • fix init of i18next without options, callback


  • avoid loading of resources for lng=cimode


  • enhance callback on load from backend...wait for pendings


  • fixing build chain
  • do not post process on nested translation resolve


  • fixing allow nesting on interpolated nesting vars


  • don't log lng changed if no lng was detected
  • extend result on arrayJoins


  • assert defaults are arrays where needed
  • assert calling lngUtils.toResolveHierarchy does not add undefined as code if called without code param


  • complete rewrite of i18next codebase


  • replace forEach loop to support IE8 PR 461


  • fixes issue in nesting using multiple namespaces and lookups in fallback namespaces
  • Fix use of sprintf as shortcutFunction when first argument falsey PR 453


  • Add nsseparator and keyseparator as options to translation function PR 446
  • Resolves issue #448 - TypeScript errors PR 449
  • Fixing _deepExtend to handle keys deep existing in source and target PR 444
  • resource to resources in addResources function PR 440
  • Runs multiple post processes for missing translations PR 438
  • Add support to override Ajax HTTP headers PR 431
  • Fixed mnk plural definition PR 427
  • Add dir function to return directionality of current language, closes… PR 413


  • fixes issue where lng get fixed on data-i18n-options
  • [SECURITY] merges Reimplement XSS-vulnerable sequential replacement code PR 443


  • streamline callback(err, t) for case where resStore is passed in


  • fixes Adds jquery like functionality without the jquery plugin. PR 403 by adding it to output


  • [BREAKING] new callbacks will be node.js conform function(err, t) | Forward the error from sync fetch methods to the init callback function PR 402
  • fix fallback lng option during translations PR 399
  • Adds jquery like functionality without the jquery plugin. PR 403


  • fix fallback lng option during translations PR 399
  • Adds jquery like functionality without the jquery plugin. PR 403


  • i18n.noConflict() PR 371
  • fix fallback to default namepsace when namespace passed as an option PR 375
  • cache option for ajax requests PR 376
  • option to show key on value is empty string PR 379
  • Add isInitialized method PR 380
  • Null check for detectLngFromLocalStorage PR 384
  • support for adding timeout in configuration for ajax request PR 387


  • fixes build of commonjs with jquery file


  • [BREAKING] adds custom build for commonjs with jquery...default will be without require for jquery
  • fixes issue issue 360
  • expose applyReplacement on api
  • save resources to localStorage when useLocaleStore is true
  • add support on key is a number
  • added getResourceBundle to API
  • allow multiple post-processors
  • fallback to singular if no plural is found fixes issue issue 356
  • access localstorage always with try catch fixes issue issue 353


  • fixes issue with stack overflow on t(lng, count)
  • fixes empty value fallback when processing secondary ns


  • fixes lng detection (i18next-client on npm)


  • adds option to define defaultOptions, which gets merged into t(options) issue 307
  • optimization of size added by plural rules
  • handle error on json parse when using internal xhr
  • fixes plural/singular on count if going on fallbacks eg. fr --> en
  • fixes global leak of sync in amd versions
  • apply options.lowerCaseLng to fallbackLng too
  • added hasResourceBundle(lng, ns) to check if bundle exists
  • added experimental i18n.sync.reload --> resets resStore and reloads resources
  • catch issues with localStorage quota
  • changes detectlanguage to support whitelist entries


  • add resource bundle gets deep extend flag i18n.addResourceBundle(lng, ns, { 'deep': { 'key2': 'value2' }}, true);
  • new functions to add one key value or multiple i18n.addResource(lng, ns, key, value);, i18n.addResources(lng, ns, {'key1': 'value1', 'deep.key2': 'value2'});
  • lngWhitelist merged
  • override postMissing function
  • allow floats for count
  • added indefinite functionality for plurals
  • optional set replacing vars to replace member to avoid collision with other options
  • experimental optional detectLngFromLocalStorage
  • fix for norwegian language


  • solves issue with ie8 not providing .trim function on string -> added to shim
  • set data using $(selector).i18n() on data-i18n='[data-someDataAttr]key'
  • more bullet proof state handling on failed file load
  • corrected latvian plurals based on issue 231
  • allow array of fallback languages
  • allow int in values passed to shortcut sprintf
  • setLng to 'cimode' will trigger a CI mode returning 'key' instead of translation


  • introducing option fallbackOnEmpty -> empty string will fallback
  • added function removeResourceBundle(lng, ns) -> removes a resource set
  • fixed issue with no option passed to setLng
  • added ability to prepend, append content with data-i18n attributes
  • introducing objectTreeKeyHandler
  • fixes issue with i18n.t(null), i18n.t(undefined) throwing exception
  • returnObjectTrees does not mangle arrays, functions, and regexps
  • optimized structure for bower support


  • fixed some typo
  • allow translate to take an array of keys - take first found
  • allow numbers in object trees


  • test if initialisation finished before allowing calling t function
  • setting option fixLng=true will return t function on init or setLng with the lng fixed for every subsequent call to t
  • grab key from content if attr data-i18n has no value
  • setting shortcutFunction to 'defaultValue' allows calling i18n.t(key, defaultValue)
  • empty string in defaultValue is now valid no longer displaying key
  • allow option cookieDomain
  • fixes issue #115 out of stack exception in IE8 by recursing _translate in objectTrees


  • option to parse key if missing
  • fixes issue where plural don't get translated if language is passed in t options
  • fixes issue where key or defaultValue aren't postProcessed with itself as value
  • fixes issue with fallbackLng = false in combination with sendMissingTo = fallback
  • fixes namespace fallback loop to only loop if array has really a ns in it


  • fixes some var typo
  • fixes sendMissing to correct namespace
  • fixes sendMissing in combination with fallbackNS


  • PR #106 optionally un/escape interpolated content
  • PR #101 automatic gettext like sprintf syntax detection + postprocess injection
  • customload will get called on dynamicLoad too
  • fixes namespace array settings if loaded resourcebundle or additional namespaces
  • lookup of not existend resouces can be fallbacked to other namespaces - see option fallbackNS (array or string if one ns to fallback to)
  • defaultValues get postProcessed
  • BREAKING: per default null values in resources get translated to fallback. This can be changed by setting option fallbackOnNull to false
  • PR #81 added support for passing options to nested resources
  • PR #88 added an exists method to check for the existence of a key in the resource store
  • fixed issue with null value throws in applyReplacement function
  • fixed issue #80 empty string lookup ends in fallback instead of returning result in language
  • fixed issue with null value in resources not returning expected value
  • optimized tests to use on server (nodejs) too
  • allow zepto as drop in replacement for $
  • using testacular as runner
  • upgraded to grunt 0.4.0
  • fixed optional interpolation prefix/suffix not used in plural translation cases
  • optimized check if there are multiple keys for the data-i18n attribute to parse


  • option to specify target to set attributes with jquery function by using 'data-i18n-target attribute'
  • function to set new options for nesting functionality
  • function to add resources after init
  • option to lookup in default namespace if value is not found in given namespace
  • option to change interpolation prefix and suffix via translation options
  • fixed issue with using ns/keyseparator on plurals, context,...
  • fixed issue with posting missing when not using jquery
  • post missing in correct lng if lng is given in translation options
  • proper usage of deferred object in init function
  • fixed issue replacing values in objectTree


  • BREAKING: fixed plural rules for languages with extended plural forms (more than 2 forms)
  • merged pull #61 - custom loader (enables jsonp or other loading custom loading strategies)
  • escaping interpolation prefix/suffix for proper regex replace


  • functions to load additional namespaces after init and to set default namespace to something else
  • set if you don't want to read defaultValues from content while using jquery fc
  • set dataAttribute to different value
  • set cookieName to different value
  • some smallbugfixes
  • typesafe use of console if in debug mode


  • disable cookie usage by setting init option useCookie to false
  • accept empty string as translation value
  • fixed bug in own ajax implementation not using proper sendType
  • fixed bug for returning objTree in combination with namespace
  • fixed bug in plurals of romanic lngs


  • pass namespace in t() options
  • interpolation nesting
  • changable querystring param to look language up from


  • typesafe check for window, document existance
  • runnable under rhino
  • seperated amd builds with/without jquery


  • BREAKING added all plurals: suffixes will new be same as in gettext usage (number indexes key_plural_0|2|3|4|5|7|8|10|11|20|100), additional if needed signature of addRule has changed
  • added sprintf as postprocessor -> postProcess = 'sprintf' and sprintf = obj or array
  • set default postProcessor on init
  • redone build process with grunt
  • drop in replacement for jquery each, extend, ajax
  • setting fallbackLng to false will stop loading and looking it up
  • option to load only current or unspecific language files


  • pass options to sync._fetchOne, use options for fetching
  • support for i18next-webtranslate


  • post processor
  • BREAKING: localStorage defaults to false
  • added localStorageExpirationTime for better caching control
  • few bug fixes


  • preload multiple languages
  • translate key to other language than current
  • fixed issue with namespace usage in combination with context and plurals
  • more options to send missing values
  • better amd support


  • set type of ajax request to GET (options sendType: default POST)
  • set cookie expiration (options cookieExpirationTime: in minutes)
  • read / cache translation options (context, count, ...) in data-attribute (options useDataAttrOptions: default false)


  • optional return an objectTree from translation
  • use jquery promises or callback in initialisation
  • rewrote all tests with mocha.js


  • options to init i18next sync (options -> getAsync = false)
  • replace all occurence of replacement string



  • fix for IE8


  • added indexOf for non ECMA-262 standard compliant browsers (IE < 9)
  • calling i28n() on element with data-i18n attribute will localize it now (i18n now not only works on container elements child)


  • extended detectLng: switch via qs setLng= or cookie i18next
  • assert county in locale will be uppercased en-us -> en-US
  • provide option to have locale always lowercased option lowerCaseLng
  • set lng cookie when set in init function


  • support for translation context
  • fixed zero count in plurals
  • init without options, callback


  • support for multiple plural forms
  • common.js enabled (for node.js serverside)
  • changes to be less dependent on jquery (override it's functions, add to root if no jquery)
  • enable it on serverside with node.js i18next-node


  • support for other attribute translation via data-i18n attribute
  • bug fixes
  • tests with qunit and sinon


  • multi-namespace support
  • loading static files or dynamic route
  • jquery function for data-i18n attibute
  • post missing translations to the server
  • graceful fallback en-US -> en -> fallbackLng
  • localstorage support
  • support for pluralized strings
  • insertion of variables into translations
  • translation nesting