Skip to content

Commit

Permalink
Merge remote-tracking branch 'scandipwa/ts-migration' into ts-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
matesich committed Sep 30, 2022
2 parents a6108c5 + 623ea9f commit c36b973
Show file tree
Hide file tree
Showing 17 changed files with 474 additions and 494 deletions.
2 changes: 0 additions & 2 deletions build-packages/webpack-i18n-runtime/src/plugin/App.plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import I18nComponent from '../component/I18n';

import '../util/propTypesFix';

/** Ensure full application remount on locale change */
const render = (args, callback) => (
<I18nComponent>
Expand Down
17 changes: 1 addition & 16 deletions build-packages/webpack-i18n-runtime/src/util/__.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ function getTranslatedStringWithInjectedValues(string, values) {
return injectValues(translateString(string), ...values);
}

export class TranslatedValue extends String {
// Translate and inject values during the initialization
constructor(value, args = []) {
super(getTranslatedStringWithInjectedValues(value, args));

this.value = value;
this.injectables = args;
}

// Reload the translation each time toString() is called
toString() {
return getTranslatedStringWithInjectedValues(this.value, this.injectables);
}
}

export default function __(string, ...values) {
return new TranslatedValue(string, values);
return getTranslatedStringWithInjectedValues(string, values);
}
19 changes: 0 additions & 19 deletions build-packages/webpack-i18n-runtime/src/util/propTypesFix.js

This file was deleted.

Loading

0 comments on commit c36b973

Please sign in to comment.