Skip to content

feat: add i18n module#124

Merged
Patryk Tomczyk (patzick) merged 25 commits intomainfrom
feat/GH-118
May 16, 2023
Merged

feat: add i18n module#124
Patryk Tomczyk (patzick) merged 25 commits intomainfrom
feat/GH-118

Conversation

@mdanilowicz
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontends-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2023 10:14am
shopware-frontends-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2023 10:14am

Comment thread packages/cms-base/helpers/getTranslations.ts Outdated
Copy link
Copy Markdown
Contributor

@mkucmus Maciek Kucmus (mkucmus) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is huuuuge :O
I left few questions and asked for formatting json files and vue components ;p

Comment thread templates/vue-demo-store/i18n/pl-PL/form.json
Comment thread templates/vue-demo-store/pages/account/index.vue
Comment thread templates/vue-demo-store/pages/register.vue Outdated
"noProducts": "No products found 😔",
}
}
const globalTranslations = getTranslations()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have one global file for cms-base translations that can be replaced by a configuration in cms-base nuxt module parameters passed in nuxt.config.ts? we could use it in getTranslations instead of adding them in every component 🤔 just asking if it's not a better idea

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, you will repeat phrases for the app and CMS. Also, it can be less clear in case of building applications that are not using Nuxt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use cms-base prefix in the whole translation file as a root prop there 🤔
and the package is actually a nuxt3 module and won't be used outside I guess, at this moment.

data-testid="add-to-cart-button"
>
🛍 Add to cart
🛍 {{ translations.product.addToCart }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add 🛍 sign to the translation phrase in case someone would not need it ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this icon is not related to the translations. Visibility of it should be handled by props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add i18n module to demo store

3 participants