Comments (4)
Dropped in a PR for changes that make this behave the way I expected it to. I tried some other things to see if it broke anything, and didn't find any issues, but of course didn't try every possible combination of settings. Notably I'm not set up to easily test that I didn't mess up subdirectory-based translation redirection, somehow, though I think I've not done anything that should affect that. Didn't see any automated tests to run so I just poked at things I thought might have been messed up by these changes, and didn't find anything.
from nlingual.
Will take a look; been juggling a few too many rush projects at work.
It is indeed an issue but it's also arguably a limitation that should be expressed better by the settings. I don't want to prevent someone who's browser language is, say, french, from being able to view the site in english for whatever reason. This could always be overwritten with a GET arg on the URLs of course. I may have even fixed this partially on one of the other branches I've yet to merge (recent development has been a bit... chaotic).
Until I'm able to publish a semi-thorough patch, you should be able to use the available hooks to make the changes you want.
from nlingual.
Cool, thanks for the response! More details about the exact issue in the PR, let me know if you have any questions about it. Meanwhile, I'll look at a hook-based workaround, as suggested.
from nlingual.
Hey, finally had some time to look at this in detail, working on a patch soon that should solve this sanely.
Basically, I've rewritten the handling of skip_default_l10n
to not apply when the browser's language matches a non-default supported language. This allows, for example, a french visitor to be redirected to the french page (unless post_language_override
is set, it takes precedence), but if they want to they can view the english pages by visting URLs with /en/ specified (or en.* in the case of subdomain handling... which come to think of it I almost never test).
I'm not sure that made sense so here's an outline of scenarios for an english/french site:
Visitor Language | Requested URL | Redirected URL |
---|---|---|
English | / | / |
French | / | /fr/ |
English | /en/ | / |
French | /en/ | /en/ |
English | /about/ | /about/ |
French | /about/ | /fr/a-propos/ |
English | /en/about/ | /about/ |
French | /en/about/ | /en/about/ |
I've gotta test it on a few dev sites to make sure first. Should have this ironed out into a proper update next week, provided a certain project doesn't spontaneously return from limbo.
from nlingual.
Related Issues (9)
- Breaks menus with Hueman theme HOT 11
- why i can't add a language switcher ? HOT 4
- Some page URL lookups behaving strangely HOT 12
- Function undefined error HOT 3
- Option to link existing translation HOT 5
- author archive url gets mangled HOT 1
- Multi-page post are broken HOT 1
- Default language works only for English HOT 5
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 nlingual.