@transifex/native 7.1.0 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transifex/native",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
4
4
  "description": "i18n framework using Transifex Native",
5
5
  "keywords": [
6
6
  "transifex",
package/src/TxNative.js CHANGED
@@ -151,7 +151,7 @@ export default class TxNative {
151
151
  }
152
152
 
153
153
  if (isMissing && locale) {
154
- translation = this.missingPolicy.handle(translation, locale);
154
+ translation = this.missingPolicy.handle(translation, locale, params);
155
155
  }
156
156
 
157
157
  if (!isString(translation)) translation = `${translation}`;
package/src/index.d.ts CHANGED
@@ -46,7 +46,7 @@ declare module '@transifex/native' {
46
46
  }
47
47
 
48
48
  interface ITranslationPolicy {
49
- handle(sourceString: string, localeCode: string): string;
49
+ handle(sourceString: string, localeCode: string, params: ITranslateParams): string;
50
50
  }
51
51
 
52
52
  interface IErrorPolicy {
@@ -124,7 +124,7 @@ declare module '@transifex/native' {
124
124
  }
125
125
 
126
126
  export class PseudoTranslationPolicy implements ITranslationPolicy {
127
- handle(sourceString: string, _localeCode: string): string;
127
+ handle(sourceString: string, _localeCode: string, _params: ITranslateParams): string;
128
128
  }
129
129
 
130
130
  export class SourceErrorPolicy implements IErrorPolicy {
@@ -132,7 +132,7 @@ declare module '@transifex/native' {
132
132
  }
133
133
 
134
134
  export class SourceStringPolicy implements ITranslationPolicy {
135
- handle(sourceString: string, _localeCode: string): string;
135
+ handle(sourceString: string, _localeCode: string, _params: ITranslateParams): string;
136
136
  }
137
137
 
138
138
  export class ThrowErrorPolicy implements IErrorPolicy {
@@ -62,7 +62,7 @@ const MAP = {
62
62
  * @class PseudoTranslationPolicy
63
63
  */
64
64
  export default class PseudoTranslationPolicy {
65
- handle(sourceString, localeCode) {
65
+ handle(sourceString, localeCode, params) {
66
66
  return sourceString
67
67
  .split(/__txnative__/)
68
68
  .map((group) => {
@@ -7,7 +7,7 @@
7
7
  * @class SourceStringPolicy
8
8
  */
9
9
  export default class SourceStringPolicy {
10
- handle(sourceString, localeCode) {
10
+ handle(sourceString, localeCode, params) {
11
11
  return sourceString;
12
12
  }
13
13
  }