tboronczyk / localization-middleware Goto Github PK
View Code? Open in Web Editor NEWPSR-15 middleware to assist primarily with language-based content negotiation and various other localization tasks
PSR-15 middleware to assist primarily with language-based content negotiation and various other localization tasks
I really like the idea of this implementation, but I'm struggling a bit with incorporating it into my system. What I'd like to be able to do with it is:
As far as I can tell, this can only be accomplished with a combination of:
So, my question is, is there a clean way to do what I'm thinking of already and I'm just missing it? If not, does some of this sound generally useful if I were to do a PR?
This middleware currently requires Slim 3 because concrete type are used. The Slim types should be replaced with their PSR-7 interfaces to allow the middleware to be used with other frameworks.
An error occurs when there is locale set (via params, cookies, etc.) and no Accept-Language header present. The expected behavior in this case is the default locale is returned.
The method LocalizationMiddleware::__invoke()
uses MessageInterface::withHeader()
method and overrides the http headers set before. Probably MessageInterface::withAddedHeader()
should be considered to use instead?
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.