Skip to content

Commit

Permalink
feat: translations for CookieBar and notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaswolf committed Nov 18, 2020
1 parent ece55ef commit 104d705
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/default-theme/src/components/gdpr/SwCookieBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>
<template #right>
<SwButton class="button" data-cy="accept-cookies" @click="acceptCookies">
Got it!
{{ $t("Got it!") }}
</SwButton>
</template>
</SfTopBar>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="cookie-description">
<p>
This site uses cookies. Read our cookies policy.
{{ $t("This site uses cookies. Read our cookies policy.") }}

<!-- <SfLink class="link" :link="$i18n.path()">
cookies policy.
Expand Down
5 changes: 4 additions & 1 deletion packages/default-theme/src/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,8 @@
"Enter promo code": "Rabattcode eingeben",
"Applied promo codes:": "Angewandte Rabattcodes:",
"Promotion code added successfully": "Rabattcode wurde erfolgreich angewendet",
"Promotion code does not exist": "Rabattcode existiert nicht"
"Promotion code does not exist": "Rabattcode existiert nicht",
"{productName} has been added to cart.": "{productName} wurde dem Warenkorb hinzugefügt.",
"Got it!": "Verstanden!",
"This site uses cookies. Read our cookies policy.": "Diese Seite verwendet Cookies. Lesen Sie unsere Cookie Richtlinie."
}
5 changes: 4 additions & 1 deletion packages/default-theme/src/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,8 @@
"Enter promo code": "Enter promo code",
"Applied promo codes:": "Applied promo codes:",
"Promotion code added successfully": "Promotion code added successfully",
"Promotion code does not exist": "Promotion code does not exist"
"Promotion code does not exist": "Promotion code does not exist",
"{productName} has been added to cart.": "{productName} has been added to cart.",
"Got it!": "Got it!",
"This site uses cookies. Read our cookies policy.": "This site uses cookies. Read our cookies policy."
}
4 changes: 3 additions & 1 deletion packages/default-theme/src/plugins/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default async ({ app }) => {
const { pushSuccess, pushError } = useNotifications(app)
intercept(INTERCEPTOR_KEYS.ADD_TO_CART, function ({ product }) {
pushSuccess(
`${product?.translated?.name || product?.name} has been added to cart.`
app.i18n.t("{productName} has been added to cart.", {
productName: product?.translated?.name || product?.name,
})
)
})

Expand Down

0 comments on commit 104d705

Please sign in to comment.