Comments (7)
@pedrodurek interesting... also others are looking for it 😉
from i18next-vue.
from i18next-vue.
The type definitions used by react-i18next are quite lengthy and complex, and that's not something I'd like to duplicate and maintain separately for i18next-vue.
There seem to be efforts of extracting the types to the core library, see i18next/i18next#1504.
When that works out, I think using (and possibly slightly augmenting) the types sounds like a good idea.
from i18next-vue.
It looks like the linked issue has been merged; is this something that could be re-evaluated at this point?
from i18next-vue.
I look into this in the near future and see how to integrate the types best.
We'll probably not publish a new version with this right away, but wait a bit for the "dust to settle". As @adrai's linked ticket shows, there are still quite some type-related changes and fixes going on in i18next itself.
from i18next-vue.
We plan to include this in i18next-vue v3. In fact, you can try it in the alpha version already: https://github.com/i18next/i18next-vue/releases/tag/v3.0.0-alpha.0
The syntax is like in your example
const { t } = useTranslation('settings');
This should work as good as the types for i18next.getFixedT()
.
See #16 for other changes planned for version 3.
from i18next-vue.
As outlined above, this is implemented in v3.
from i18next-vue.
Related Issues (16)
- Update GitHub workflows to match the new organization HOT 5
- Unable to install via npm? HOT 2
- how to access this.$i18next in composition api setup HOT 2
- The `i18next` object returned from the `useTranslation()` is not reactive. HOT 3
- Limit the scope of a SFC component to some namespace and key prefix. HOT 7
- Implement <i18next> component. HOT 17
- support v-t directive HOT 1
- support esm export
- importing i18next-vue breaks type checking a basic nuxt app HOT 4
- Please update for i18next > v22.5.0 HOT 2
- Changes for `i18next-vue` v3 HOT 1
- test HOT 1
- [Typescript Error] useTranslation - Type instantiation is excessively deep and possibly infinite HOT 2
- Vue 2 compatible TranslationComponent not working as expected HOT 2
- dont work lazy loading file HOT 2
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 i18next-vue.