aboutsummaryrefslogtreecommitdiffstats
path: root/ui/i18n-helper.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-10-17 02:01:54 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-10-17 02:01:54 +0800
commit13820b6cc1801a420f39cdfecd7ccb5309dc597b (patch)
treec79832d7077ab03e0afe0c322cb32b204865d8b5 /ui/i18n-helper.js
parenteeecee01540fbad50c4c463a3b1a54142a63f168 (diff)
parent07ab613d4c647e3fe554bc06eab8cfb833315a88 (diff)
downloadtangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.gz
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.bz2
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.lz
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.xz
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.zst
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.zip
fix conflicts
Diffstat (limited to 'ui/i18n-helper.js')
-rw-r--r--ui/i18n-helper.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/i18n-helper.js b/ui/i18n-helper.js
index bc927ee65..c6a7d0bf1 100644
--- a/ui/i18n-helper.js
+++ b/ui/i18n-helper.js
@@ -20,10 +20,10 @@ const getMessage = (locale, key, substitutions) => {
let phrase = entry.message
// perform substitutions
if (substitutions && substitutions.length) {
- phrase = phrase.replace(/\$1/g, substitutions[0])
- if (substitutions.length > 1) {
- phrase = phrase.replace(/\$2/g, substitutions[1])
- }
+ substitutions.forEach((substitution, index) => {
+ const regex = new RegExp(`\\$${index + 1}`, 'g')
+ phrase = phrase.replace(regex, substitution)
+ })
}
return phrase
}