Coder Social home page Coder Social logo

Comments (9)

rstoenescu avatar rstoenescu commented on August 26, 2024 1

Hi,

Yes, this is the way to do it. Would you be so kind to create a PR for it? If you'd be so kind, a docs update would be good too.

Thank you!

  • Razvan

from quasar-starter-kit.

fansanelli avatar fansanelli commented on August 26, 2024

Humble ping, gents. Could someone confirm this will be ok for SSR too?

from quasar-starter-kit.

nothingismagick avatar nothingismagick commented on August 26, 2024

Hi - well, I have used a slightly different approach in

export default ({ app, Vue, ssrContext, router }) => {

the secret sauce is here:

app.i18n.setLocaleMessage(locale, require(`src/i18n/locales/${locale}.json`))

from quasar-starter-kit.

nothingismagick avatar nothingismagick commented on August 26, 2024

But I am really trying to get the best of ALL worlds for SSR that goes the following steps:

  • zero: guard against "inappropriate / unavailable" locale names in cookie / browser pref / route
  • first: cookie preference
  • next: browser pref / setting
  • last: route based :locale token

For extra credit, I also switch the $q.i18n with the same hook and am exporting a watcher and loader via a global mixin.

I am using a lazy loading (one locale at a time) approach, because for huge projects you just do not want to load 15 locales with several hundred strings at a time ... Just, no.

from quasar-starter-kit.

fansanelli avatar fansanelli commented on August 26, 2024

Tbh, I don't have to do SSR in my projects, but I found that the store plugin was broken for me after latest changes... So I thought that this commit could lead to the breakage of the SSR context. If it works for you, please consider merging the patch

from quasar-starter-kit.

nothingismagick avatar nothingismagick commented on August 26, 2024

I'll have to test it, but won't get to it until the end of next week. SRY

from quasar-starter-kit.

fansanelli avatar fansanelli commented on August 26, 2024

gentle ping. Is this patch ok as is?

from quasar-starter-kit.

yusufkandemir avatar yusufkandemir commented on August 26, 2024

It is now possible to do so. It's implemented in this commit by @rstoenescu using @fansanelli's suggestions.

from quasar-starter-kit.

rstoenescu avatar rstoenescu commented on August 26, 2024

Yep. Closing.
Not only the new approach is better, it is recommended.

from quasar-starter-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.