Permalink
Browse files

fixed #851

  • Loading branch information...
1 parent 85be08f commit f5ae6800e8d807207fddb7b79568d2a651cf089d @jamuhl jamuhl committed Dec 22, 2016
Showing with 31 additions and 24 deletions.
  1. +2 −1 .babelrc
  2. +4 −0 CHANGELOG.md
  3. +4 −2 i18next.js
  4. +1 −1 i18next.min.js
  5. +16 −16 package.json
  6. +2 −2 rollup.config.js
  7. +2 −2 src/i18next.js
View
@@ -8,8 +8,9 @@
]
},
"rollup": {
- "presets": [ "es2015-rollup", "stage-0" ],
+ "presets": [ ["es2015", { "modules": false }], "stage-0" ],
"plugins": [
+ "external-helpers",
["transform-es2015-classes", { "loose": true }],
"transform-proto-to-assign"
]
View
@@ -1,3 +1,7 @@
+### 4.1.2
+- fixes same interpolation object with multiple getFixedT() in different locales yields wrong translation [#851](https://github.com/i18next/i18next/issues/851)
+- updated all build deps
+
### 4.1.1
- remove subs array from logger - no longer keep changing debug flag on subs if changing on main
View
@@ -2162,8 +2162,10 @@ var I18n = function (_EventEmitter) {
I18n.prototype.getFixedT = function getFixedT(lng, ns) {
var _this5 = this;
- var fixedT = function fixedT(key, options) {
- options = options || {};
+ var fixedT = function fixedT(key) {
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ var options = _extends({}, opts);
options.lng = options.lng || fixedT.lng;
options.ns = options.ns || fixedT.ns;
return _this5.t(key, options);
View
Oops, something went wrong.
View
@@ -24,23 +24,23 @@
"dependencies": {},
"devDependencies": {
"babel-cli": "6.18.0",
- "babel-core": "6.18.2",
- "babel-eslint": "7.1.0",
+ "babel-core": "6.21.0",
+ "babel-eslint": "7.1.1",
+ "babel-plugin-external-helpers": "6.18.0",
"babel-plugin-transform-es2015-classes": "6.18.0",
"babel-plugin-transform-proto-to-assign": "6.9.0",
"babel-preset-es2015": "6.18.0",
- "babel-preset-es2015-rollup": "1.2.0",
"babel-preset-stage-0": "6.16.0",
"babelify": "7.3.0",
"browserify": "13.1.1",
"browserify-istanbul": "2.0.0",
"chai": "3.5.0",
- "coveralls": "2.11.14",
- "eslint": "3.9.1",
+ "coveralls": "2.11.15",
+ "eslint": "3.12.2",
"eslint-config-airbnb": "13.0.0",
- "eslint-plugin-import": "^2.2.0",
- "eslint-plugin-jsx-a11y": "^3.0.1",
- "eslint-plugin-react": "^6.6.0",
+ "eslint-plugin-import": "2.2.0",
+ "eslint-plugin-jsx-a11y": "3.0.2",
+ "eslint-plugin-react": "6.8.0",
"i18next-browser-languagedetector": "1.0.1",
"i18next-localstorage-cache": "0.3.0",
"i18next-sprintf-postprocessor": "0.2.2",
@@ -54,22 +54,22 @@
"karma-coverage": "douglasduteil/karma-coverage#next",
"karma-coveralls": "1.1.2",
"karma-expect": "1.1.3",
- "karma-mocha": "1.2.0",
+ "karma-mocha": "1.3.0",
"karma-phantomjs-launcher": "1.0.2",
- "karma-rollup-preprocessor": "2.0.2",
+ "karma-rollup-preprocessor": "3.0.1",
"karma-sinon": "1.0.5",
"karma-spec-reporter": "0.0.26",
"mkdirp": "0.5.1",
- "mocha": "3.1.2",
- "phantomjs-prebuilt": "2.1.13",
+ "mocha": "3.2.0",
+ "phantomjs-prebuilt": "2.1.14",
"rimraf": "2.5.4",
- "rollup": "0.36.3",
- "rollup-plugin-babel": "2.6.1",
+ "rollup": "0.38.0",
+ "rollup-plugin-babel": "2.7.1",
"rollup-plugin-node-resolve": "2.0.0",
"rollup-plugin-uglify": "1.0.1",
"sinon": "1.17.6",
- "watchify": "3.7.0",
- "yargs": "6.3.0"
+ "watchify": "3.8.0",
+ "yargs": "6.5.0"
},
"scripts": {
"test": "npm run test:new && npm run test:compat",
View
@@ -8,8 +8,8 @@ const compress = argv.uglify;
const babelOptions = {
exclude: 'node_modules/**',
- presets: ['es2015-rollup', 'stage-0'],
- plugins: [['transform-es2015-classes', { loose: true }], 'transform-proto-to-assign'],
+ presets: [['es2015', { modules: false }], 'stage-0'],
+ plugins: ['external-helpers', ['transform-es2015-classes', { loose: true }], 'transform-proto-to-assign'],
babelrc: false
};
View
@@ -209,8 +209,8 @@ class I18n extends EventEmitter {
}
getFixedT(lng, ns) {
- let fixedT = (key, options) => {
- options = options || {};
+ let fixedT = (key, opts = {}) => {
+ const options = { ...opts };
options.lng = options.lng || fixedT.lng;
options.ns = options.ns || fixedT.ns;
return this.t(key, options);

0 comments on commit f5ae680

Please sign in to comment.