diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-24 19:39:09 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-24 19:39:09 +0530 |
commit | 0e88ef9bd2ea76e5b44cc0d4459b9a2e553b8d24 (patch) | |
tree | badf53269fb0775b11fc0160ab5b5c0d66903dd1 /packages/taler-wallet-core/src/i18n | |
parent | 69c495076252a22bda341f58d7976e55078bd78c (diff) | |
download | wallet-core-0e88ef9bd2ea76e5b44cc0d4459b9a2e553b8d24.tar.xz |
implement fulfillment_message and make fulfillment_url optional
Diffstat (limited to 'packages/taler-wallet-core/src/i18n')
-rw-r--r-- | packages/taler-wallet-core/src/i18n/index.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/i18n/index.ts b/packages/taler-wallet-core/src/i18n/index.ts index c5b70b1fd..b8788115c 100644 --- a/packages/taler-wallet-core/src/i18n/index.ts +++ b/packages/taler-wallet-core/src/i18n/index.ts @@ -79,3 +79,12 @@ export function str(stringSeq: TemplateStringsArray, ...values: any[]): string { .fetch(...values); return tr; } + +/** + * Get an internationalized string (based on the globally set, current language) + * from a JSON object. Fall back to the default language of the JSON object + * if no match exists. + */ +export function getJsonI18n<K extends string>(obj: Record<K, string>, key: K): string { + return obj[key]; +}
\ No newline at end of file |