Merge pull request #34001 from lloiser/ll-counterpart

[counterpart] add translate method
This commit is contained in:
Sheetal Nandi
2019-03-19 11:08:43 -07:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ import * as counterpart from 'counterpart';
counterpart('translation.to.be.used');
counterpart(['translation', 'to', 'be', 'used']);
counterpart.translate('translation.to.be.used');
counterpart.translate(['translation', 'to', 'be', 'used']);
counterpart.setSeparator('*');

View File

@@ -9,6 +9,7 @@ type LocaleChangeHandler = (newLocale: string, oldLocale: string) => void;
interface Counterpart {
(key: string|string[], options?: object): string;
translate(key: string|string[], options?: object): string;
setSeparator(value: string): string;
onTranslationNotFound(callback: NotFoundHandler): void;