Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language switches from english to the selected language #162

Open
JonasCykelgear opened this issue Jan 11, 2024 · 2 comments
Open

Language switches from english to the selected language #162

JonasCykelgear opened this issue Jan 11, 2024 · 2 comments

Comments

@JonasCykelgear
Copy link

Im having this problem where my language starts at english then switches to danish a moment after.
It happens when i run in ssr mode.

You can see it happen here - Look at the "Mærker" text, then refresh the page:
https://www.cykelgear.dk/

ssr.js:

.use(i18nVue, {
    lang: 'da',
    resolve: lang => {
        const langs = import.meta.glob('../../lang/*.json', { eager: true });
        return langs[`../../lang/${lang}.json`].default;
    },
})

app.js:

.use(i18nVue, {
    lang: 'da',
    resolve: lang => {
        const langs = import.meta.glob('../../lang/*.json', { eager: true });
        return langs[`../../lang/${lang}.json`].default;
    },
})

Let me know if any information is needed

@xiCO2k
Copy link
Owner

xiCO2k commented Jan 11, 2024

Thanks for the report, I did check your view-source: and looks like the only work not translating on the ssr is the "Brands" all the rest looks good.

any hints?

@JonasCykelgear
Copy link
Author

Yeah. Some of the texts are from the DB which doesnt get translated if that makes sense.

This only happens to texts that gets translated in vue files using the $t function. Also only in ssr mode. When i run the project locally everything works fine.

Here might be a better example, if you look at the product pricing and stock information:
https://www.cykelgear.dk/tilbehor/olie-fedt-vedligehold/kaedeolie-og-voks/muc-off-dry-lube-120ml

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

No branches or pull requests

2 participants