sunfuze / koa-i18next Goto Github PK
View Code? Open in Web Editor NEWA middleware to use i18next in koajs.
A middleware to use i18next in koajs.
If locale header contains 'dash' symbol Accept-Language: fr-CH
the i18next will not work and use fallback language.
i18next.t
to ctx.t
?koa@1
by default. Should we remove option.next
and move this to a branch used to support koa@1
?发布到npm上的0.1.1的lib文件夹没有传
Hi :)
Would you accept a PR with two additional middlewares?
A resourceHandler & a missing keys handler.
Like this : https://github.com/i18next/i18next-express-middleware/blob/796a85b2feb91f6a7d8ee14c34ae52c107be6efd/src/index.js#L62
but for KOA :)
Looks like you use http data to set the language that i18nnext will use.
Is there a way to overwrite it ?
For example after my app initalization, i have an auth middleware, and i'd like to set the i18nnext language function of the authenticated user's language (stored in my database).
Tnanks a lot for your help @sunfuze
Here are two error messages saying i18next-express-middleware:: balabala
.
That's misleading. And if you got some ideas from i18next-express-middleware
, it's a good practice to say that you are inspired by them in your README.
Is there a way to detect the language based on a custom function?
I'd like to get the language of logged user, so I detected the logged user using a token and then I want to change language based on user.lang
is there any other approach to do this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.