Comments (12)
Hey there @Demivan! Wondering if support for Nuxt is underway. I'm trying to introduce Nuxt for one of our projects here and having Fluent support would be grande.
from fluent-vue.
I will be starting on it tomorrow. I was busy with my main job, so didn't have time to work on it before.
@reemhamz Are you planning to use Nuxt 2 or 3?
from fluent-vue.
@Demivan no worries! Thanks for taking the time to work on this. Currently just Nuxt2 since Nuxt3 is still in Beta, but once that version is stable and up to par, I'd be happy to migrate to Nuxt3, but that's a later problem.
from fluent-vue.
I have added a simple Nuxt 2 example: https://github.com/fluent-vue/examples/tree/main/nuxt-2
Implementing something like https://github.com/nuxt-community/i18n-module will take much more time. I'd rather work on making v-t
directive compatible with SSR for now. When Nuxt 3 is stable I should be able to use nuxt-kit to implement analog of i18n-module that is Nuxt 2 and Nuxt 3 compatible.
from fluent-vue.
SSR support wasn't that bad. :) I have merged it to that example.
I will extract Nuxt build module to a separate package later.
from fluent-vue.
Reimplement @nuxtjs/i18n for fluent-vue. Probably when @nuxt/i18n is updated to Nuxt 3
@Demivan is the Nuxt 3 module still worked on?
The pluralisation syntax of vue-i18n
and @nuxtjs/i18n
is terrible and has zero flexibility compared to Fluent or even MessageFormat.
I would love to switch to a future @nuxtjs/fluent
or @fluent-vue/nuxt
when it will become available.
from fluent-vue.
@0xMANFRE @nuxtjs/i18n
is huge and has lots of features. It will be few times bigger than fluent-vue
itself. I don't have time to reimplement everything.
But basic integration of fluent-vue
into Nuxt
is easy. You add unplugin-fluent-vue
Vite plugin and create a custom Nuxt
plugin that initializes fluent-vue
. Code is SSR compatible already.
from fluent-vue.
By the way, I plan to support MessageFormat 4 when the syntax is finalized.
from fluent-vue.
But basic integration of
fluent-vue
intoNuxt
is easy. You addunplugin-fluent-vue
Vite plugin and create a customNuxt
plugin that initializesfluent-vue
. Code is SSR compatible already.
The documentation provides only a Vite config file.
Is there a working Vue 3 example that has external locale files and a locale switcher? I can't seem to find it.
from fluent-vue.
There is no Nuxt
3 example. I will create it and link it here.
from fluent-vue.
Added Nuxt 3 example https://github.com/fluent-vue/examples/tree/main/nuxt-3. Check the plugins
and modules
folders for implementation. You still need some way of selecting the current locale on the server, but that really depends on your site (is it per domain, path or read from cookie)
What is not working is SSR for the v-t
directive. I almost never use it, but I will work on the SSR implementation this week.
from fluent-vue.
Nuxt 3 integration is done. Docs can be found here: https://fluent-vue.demivan.me/integrations/nuxt
from fluent-vue.
Related Issues (20)
- Add examples with more build configurations
- Public facing website link described in the docs is broken HOT 6
- Eslint plugin
- Wrong resolution to Vue 2 when in Vue 3 project HOT 3
- html tags in i18n component HOT 2
- Easier way to set attribute directly? HOT 7
- Feature request, missing translations checker? HOT 2
- Vue 2 project: Getting an error related to the vue-composition-api and vue-demi HOT 5
- custom warn function HOT 4
- Vue devtools integration
- Don't create wrapper element in i18n component on Vue 3
- How to assess `$t` in setup script? HOT 2
- Remove bom from files HOT 1
- Migration path from vue-i18n to fluent-vue HOT 4
- Typing error with app.use() HOT 3
- Help with Fluent Bundles HOT 3
- Lazyloading .flt files HOT 4
- Missing type checking and intellisense for i18n component
- How to disable BiDi in fluent? 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 fluent-vue.