Skip to content

Commit dff88ba

Browse files
committed
fix: link interpolation for translations
Links did not show anymore, as `template tag name` beginning with `_` did not work anymore.
1 parent 76c2ede commit dff88ba

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

frontend/components/bc/BcTranslation.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ defineProps<{
1313
*
1414
* @example
1515
*
16-
* Translation key has to be under `${keypath}._link`
16+
* Translation key has to be under `${keypath}.link`
1717
*
1818
* // en.json
1919
* {
2020
* "notifications": {
21-
* "template": "For further information {_link}"
22-
* "_link": "Click here"
21+
* "template": "For further information {link}"
22+
* "link": "Click here"
2323
* }
2424
*/
2525
to?: string,
@@ -32,16 +32,16 @@ defineProps<{
3232
scope="global"
3333
:tag="tag || 'span'"
3434
>
35-
<template #_bold>
35+
<template #bold>
3636
<span
3737
v-if="boldpath"
3838
class="bc-translation-bold"
3939
>{{ $t(boldpath) }}</span>
4040
</template>
41-
<template #_link>
41+
<template #link>
4242
<slot
4343
v-if="to && linkpath"
44-
name="_link"
44+
name="link"
4545
>
4646
<BcLink
4747
class="link"
@@ -52,9 +52,9 @@ defineProps<{
5252
</BcLink>
5353
</slot>
5454
</template>
55-
<template #_list>
55+
<template #list>
5656
<slot
57-
name="_list"
57+
name="list"
5858
:listpath
5959
>
6060
<ul v-if="listpath">

frontend/components/bc/CookieModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const visible = computed(() => cookiePreference.value === undefined)
2929
<BcTranslation
3030
class="text-container"
3131
keypath="cookies.text.template"
32-
linkpath="cookies.text._link"
32+
linkpath="cookies.text.link"
3333
to="https://storage.googleapis.com/legal.beaconcha.in/privacy.pdf"
3434
/>
3535
<div class="button-container">

frontend/components/notifications/NotificationsOverview.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ const emit = defineEmits<{
7373
>
7474
<BcTranslation
7575
keypath="notifications.overview.notifications_activate_premium.template"
76-
linkpath="notifications.overview.notifications_activate_premium._link"
76+
linkpath="notifications.overview.notifications_activate_premium.link"
7777
to="https://discord.com/developers/docs/resources/webhook"
7878
>
79-
<template #_link>
79+
<template #link>
8080
<BcButtonText
8181
class="link"
8282
:aria-label="$t('notifications.overview.email_activate')"
8383
@click="emit('openDialog')"
8484
>
85-
{{ $t('notifications.overview.notifications_activate_premium._link') }}
85+
{{ $t('notifications.overview.notifications_activate_premium.link') }}
8686
</BcButtonText>
8787
</template>
8888
</BcTranslation>
@@ -101,7 +101,7 @@ const emit = defineEmits<{
101101
>
102102
<BcTranslation
103103
keypath="notifications.overview.notifications_download_app.template"
104-
linkpath="notifications.overview.notifications_download_app._link"
104+
linkpath="notifications.overview.notifications_download_app.link"
105105
to="/mobile"
106106
/>
107107
</div>

frontend/components/notifications/management/NotificationsManagementPairedDevicesModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const handleToggleNotifications = ({
5757
class="link"
5858
to="/mobile"
5959
>
60-
{{ $t('notifications.general.paired_devices.info_empty._link') }}
60+
{{ $t('notifications.general.paired_devices.info_empty.link') }}
6161
</BcLink>
6262
</BcText>
6363
</div>

frontend/components/notifications/management/NotificationsManagementSubscriptionDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const { hasRocketPool } = useNetworkStore()
106106
<template #info>
107107
<BcTranslation
108108
keypath="notifications.subscriptions.validators.validator_is_offline.info.template"
109-
listpath="notifications.subscriptions.validators.validator_is_offline.info._list"
109+
listpath="notifications.subscriptions.validators.validator_is_offline.info.list"
110110
/>
111111
</template>
112112
</BcSettingsRow>

frontend/components/notifications/management/modal/NotificationsManagementModalWebhook.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const id = useId()
144144
<template #tooltip>
145145
<BcTranslation
146146
keypath="notifications.dashboards.dialog.info_send_via_discord.template"
147-
linkpath="notifications.dashboards.dialog.info_send_via_discord._link"
147+
linkpath="notifications.dashboards.dialog.info_send_via_discord.link"
148148
to="https://discord.com/developers/docs/resources/webhook"
149149
/>
150150
</template>

frontend/components/pricing/PremiumAddonBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const handleSubmitPurchase = async () => {
258258
<BcTranslation
259259
v-if="isQuantityLimitReached"
260260
keypath="pricing.addons.contact_support.template"
261-
linkpath="pricing.addons.contact_support._link"
261+
linkpath="pricing.addons.contact_support.link"
262262
to="https://dsc.gg/beaconchain"
263263
/>
264264
</span>

frontend/i18n/locales/en.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@
148148
"accept_all": "Accept All",
149149
"only_necessary": "Only Necessary",
150150
"text": {
151-
"_link": "cookies",
152-
"template": "By using our site you agree to our use of {_link} to deliver a better user experience."
151+
"link": "cookies",
152+
"template": "By using our site you agree to our use of {link} to deliver a better user experience."
153153
}
154154
},
155155
"currency": {
@@ -255,8 +255,8 @@
255255
"text": "Create your own dashboard to get the most out of beaconcha.in"
256256
},
257257
"subsciprion_limit_reached": {
258-
"_link": "Learn more about our subscription plans and dashboard addon-ons on our pricing page.",
259-
"template": "This dashboard exceeds the stake limit so no more validators can be added. {_link}"
258+
"link": "Learn more about our subscription plans and dashboard addon-ons on our pricing page.",
259+
"template": "This dashboard exceeds the stake limit so no more validators can be added. {link}"
260260
},
261261
"subsciprion_limit_reached_title": "Maximum stake exceeded",
262262
"table": {
@@ -267,8 +267,8 @@
267267
},
268268
"title": "Dashboard",
269269
"truncated_validators": {
270-
"_link": "Learn more about how to upgrade and unlock full validator insights and premium features on our pricing page.",
271-
"template": "This dashboard displays a truncated list of validators, as their total stake exceeds the free plan limit. {_link}"
270+
"link": "Learn more about how to upgrade and unlock full validator insights and premium features on our pricing page.",
271+
"template": "This dashboard displays a truncated list of validators, as their total stake exceeds the free plan limit. {link}"
272272
},
273273
"validator": {
274274
"blocks": {
@@ -782,8 +782,8 @@
782782
},
783783
"heading_webhook": "Edit Webhook",
784784
"info_send_via_discord": {
785-
"_link": "Discord webhook",
786-
"template": "Enable this to receive notifications via Discord. Ensure you have a {_link} set up."
785+
"link": "Discord webhook",
786+
"template": "Enable this to receive notifications via Discord. Ensure you have a {link} set up."
787787
},
788788
"label_send_via_discord": "Send via Discord",
789789
"label_webhook_url": "Webhook URL",
@@ -867,7 +867,7 @@
867867
"paired_devices": {
868868
"device": "Device",
869869
"info_empty":{
870-
"_link": "Click here to pair a device",
870+
"link": "Click here to pair a device",
871871
"template": "Currently there are no devices paired."
872872
},
873873
"mobile_notifications": "Mobile notifications",
@@ -938,12 +938,12 @@
938938
"validator_groups": "Most notified validator groups"
939939
},
940940
"notifications_activate_premium": {
941-
"_link": "here",
942-
"template": "Click {_link} to activate"
941+
"link": "here",
942+
"template": "Click {link} to activate"
943943
},
944944
"notifications_download_app": {
945-
"_link": "mobile app",
946-
"template": "Download the {_link} to activate"
945+
"link": "mobile app",
946+
"template": "Download the {link} to activate"
947947
},
948948
"push": "Push"
949949
},
@@ -1017,8 +1017,8 @@
10171017
},
10181018
"validator_is_offline": {
10191019
"info": {
1020-
"_list": "Once the validator has been offline for 3 epochs\nOnce you are back online again",
1021-
"template": "We will trigger a notification: {_list}"
1020+
"list": "Once the validator has been offline for 3 epochs\nOnce you are back online again",
1021+
"template": "We will trigger a notification: {list}"
10221022
},
10231023
"label": "Validator is offline"
10241024
},
@@ -1051,8 +1051,8 @@
10511051
"select_addon": "Select Add-On"
10521052
},
10531053
"contact_support":{
1054-
"_link": "support",
1055-
"template": "Contact our {_link} for a higher limit"
1054+
"link": "support",
1055+
"template": "Contact our {link} for a higher limit"
10561056
},
10571057
"currently_active": "Currently active: {amount}",
10581058
"effective_balance": "+{amount} Max Stake per Dashboard",

frontend/pages/dashboard/[[id]]/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ const isTruncated = computed(() => 'isTruncated' in route.query)
428428
>
429429
<BcTranslation
430430
keypath="dashboard.subsciprion_limit_reached.template"
431-
linkpath="dashboard.subsciprion_limit_reached._link"
431+
linkpath="dashboard.subsciprion_limit_reached.link"
432432
to="/premium"
433433
/>
434434
</BcNotificationBanner>
@@ -438,7 +438,7 @@ const isTruncated = computed(() => 'isTruncated' in route.query)
438438
>
439439
<LazyBcTranslation
440440
keypath="dashboard.truncated_validators.template"
441-
linkpath="dashboard.truncated_validators._link"
441+
linkpath="dashboard.truncated_validators.link"
442442
to="/premium"
443443
/>
444444
</BcNotificationBanner>

0 commit comments

Comments
 (0)