Skip to content

Commit b8b48d8

Browse files
committed
TrackingConsent: Add i18n
1 parent 0d51277 commit b8b48d8

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

src/components/TrackingConsent.vue

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:class="[ theme, safariFix ]"
55
v-if="uiRequired && uiAllowed"
66
>
7-
{{ text.main }} ❤️
7+
{{ text.main }}
88
<div class="button-group">
99
<button
1010
class="nq-button-pill light-blue"
@@ -26,6 +26,7 @@
2626

2727
<script lang="ts">
2828
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
29+
import I18nMixin from '../i18n/I18nMixin';
2930
3031
interface Consent {
3132
allowsBrowserData?: boolean;
@@ -37,17 +38,22 @@ class TrackingConsent extends Vue {
3738
@Prop({
3839
type: Object,
3940
default: () => ({
40-
main: 'Help Nimiq improve by sharing anonymized usage data. Thank you!',
41-
yes: 'Yes',
42-
no: 'No',
41+
get main() {
42+
return I18nMixin.$t(
43+
'TrackingConsent',
44+
'Help Nimiq improve by sharing anonymized usage data. Thank you! ❤️',
45+
);
46+
},
47+
get yes() { return I18nMixin.$t('TrackingConsent', 'Yes'); },
48+
get no() { return I18nMixin.$t('TrackingConsent', 'No'); },
4349
browserOnly: 'Browser-info only',
4450
}),
45-
validator: (value) => (
46-
value && typeof value === 'object' &&
47-
value.no && typeof value.no === 'string' && value.no.length &&
48-
value.yes && typeof value.yes === 'string' && value.yes.length &&
49-
value.main && typeof value.main === 'string' && value.main.length &&
50-
value.browserOnly && typeof value.browserOnly === 'string' && value.browserOnly.length
51+
validator: (text) => (
52+
text && typeof text === 'object' &&
53+
text.no && typeof text.no === 'string' && text.no.length &&
54+
text.yes && typeof text.yes === 'string' && text.yes.length &&
55+
text.main && typeof text.main === 'string' && text.main.length &&
56+
text.browserOnly && typeof text.browserOnly === 'string' && text.browserOnly.length
5157
),
5258
})
5359
public text: {

src/i18n/en.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ msgstr ""
103103
msgid "Grant camera access when asked."
104104
msgstr ""
105105

106+
#: src/components/TrackingConsent.vue:42
107+
msgid "Help Nimiq improve by sharing anonymized usage data. Thank you! ❤️"
108+
msgstr ""
109+
106110
#: src/components/Timer.vue:93
107111
msgid "hour"
108112
msgstr ""
@@ -157,6 +161,10 @@ msgstr ""
157161
msgid "Nimiq provides this service free of charge."
158162
msgstr ""
159163

164+
#: src/components/TrackingConsent.vue:48
165+
msgid "No"
166+
msgstr ""
167+
160168
#: src/components/SendTx.vue:108
161169
msgid "Open settings"
162170
msgstr ""
@@ -254,6 +262,10 @@ msgstr ""
254262
msgid "Vendor crypto markup"
255263
msgstr ""
256264

265+
#: src/components/TrackingConsent.vue:47
266+
msgid "Yes"
267+
msgstr ""
268+
257269
#: src/components/PaymentInfoLine.vue:280
258270
msgid "You are paying approx. {formattedRateDeviation} less than at the current market rate (coingecko.com)."
259271
msgstr ""

src/i18n/fr.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ msgstr "Retour"
120120
msgid "Grant camera access when asked."
121121
msgstr "Accordez l'accès à la caméra lorsque cela vous est demandé."
122122

123+
#: src/components/TrackingConsent.vue:42
124+
msgid "Help Nimiq improve by sharing anonymized usage data. Thank you! ❤️"
125+
msgstr ""
126+
123127
#: src/components/Timer.vue:93
124128
msgid "hour"
125129
msgstr "heure"
@@ -172,6 +176,10 @@ msgstr "frais de réseau"
172176
msgid "Nimiq provides this service free of charge."
173177
msgstr "Nimiq fournit ce service gratuitement."
174178

179+
#: src/components/TrackingConsent.vue:48
180+
msgid "No"
181+
msgstr ""
182+
175183
#: src/components/SendTx.vue:108
176184
msgid "Open settings"
177185
msgstr "Ouvrir les réglages"
@@ -268,6 +276,10 @@ msgstr "Crypto-remise"
268276
msgid "Vendor crypto markup"
269277
msgstr "Crypto-premium"
270278

279+
#: src/components/TrackingConsent.vue:47
280+
msgid "Yes"
281+
msgstr ""
282+
271283
#: src/components/PaymentInfoLine.vue:280
272284
msgid ""
273285
"You are paying approx. {formattedRateDeviation} less than at the current "

0 commit comments

Comments
 (0)