Comments (9)
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.
Humble ping, gents. Could someone confirm this will be ok for SSR too?
from quasar-starter-kit.
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.
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.
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.
I'll have to test it, but won't get to it until the end of next week. SRY
from quasar-starter-kit.
gentle ping. Is this patch ok as is?
from quasar-starter-kit.
It is now possible to do so. It's implemented in this commit by @rstoenescu using @fansanelli's suggestions.
from quasar-starter-kit.
Yep. Closing.
Not only the new approach is better, it is recommended.
from quasar-starter-kit.
Related Issues (20)
- Composition API not instantiated fast enough to be used outside of components HOT 11
- Outdated dependency warnings HOT 1
- Starter Kits Capacitor iOS builds in simulator but times out on device HOT 2
- Including module-example in store prevents SSR from rendering HOT 1
- Quasar Create Issue in Windows HOT 2
- EssentialLink does not use openURL HOT 1
- Relative module not found on i18n - branch next HOT 1
- Feature: command line option to re-apply templates HOT 1
- i18n: auto-detect locale HOT 2
- SSR mode use axios cross-request state pollution HOT 5
- Setup fails with lint error with airbnb config HOT 3
- `quasar dev` fails on a new, clean project HOT 1
- ESLint Standard - PropType not found in ‘vue‘ (and other types) HOT 2
- Vue Class Component - Project Inactivity and HMR Failure HOT 4
- readme has incorrect quasar create HOT 3
- SSR + vue-i18n starter kit issue (memory leak) HOT 8
- ESLint 8 support HOT 1
- Failed to Download Starter Kit when Creating Quasar Project HOT 2
- Support TS properly for other ESLint presets and/or make Prettier the recommended TS preset HOT 1
- Browserlist is too inclusive HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quasar-starter-kit.