Comments (4)
Hmm that's strange... I'll try and reproduce it. Would be great if you could look into it as well if you have the time that is :)
Btw: which version of LanguagePrefix and Translatable are you using?
from silverstripe-languageprefix.
I'm sorry, I couldn't reproduce this problem.
Below is what I did. I also added the settings I used - which are almost the same as yours, the only thing different is en_AU in the prefix map instead of en_CA, because I had created Australian translations instead of Canadian :)
I did the following:
- composer create-project silverstripe/installer www
- composer require silverstripe/translatable 2.2.0
- composer require martimiz/silverstripe-languageprefix v3.0.0
- add the _config.php settings
- dev/build?flush
- add the config.yml settings
- ?flush=all
- created en_AU translations
- tested homepage www/mysite.dev/ and www/mysite.dev/au/ -> both found == ok
- tested www/mysite.dev/en_GB/ -> not found == ok
- tested other translations -> ok
i18n::set_locale('en_GB');
Translatable::set_default_locale('en_GB');
i18n:
common_locales:
en_CA:
name: 'English (Canada)'
native: 'English (Canada)'
en_AU:
name: 'English (Australia)'
native: 'English (Australia)'
Translatable:
enforce_global_unique_urls: false
---
Name: languageprefix-config
---
prefixconfig:
locale_prefix_map:
# 'en_GB': uk
'en_US': us
'en_AU': au
enable_duplicate_urlsegments: true
disable_prefix_for_default_lang: true
from silverstripe-languageprefix.
I think I figured it out. I set up the other English versions before I enabled 'enable_duplicate_urlsegments' so the default en-GB urlSegment was home, while the the en-US was home-en-us.
For some reason when going to the home page it was trying to find home-en-us with a Locale of en-GB. Once I switch the en-US sefment to home it worked. I'm not sure if it was a browser setting making it lok for the US version or somethin else.
from silverstripe-languageprefix.
That's a bit too complex to duplicate... :)
Anyway: the URLSegment link in the CMS should always tell you how the link for each page is constructed, and clicking it should lead you to the right page...
If you ever find a situation where that link is incorrect or doesn't lead to the right page or isn't equal to the link that is constructed on the frontend, let me know, including settings and urls.
For now I'll close this issue.
from silverstripe-languageprefix.
Related Issues (17)
- Inserting Link with HTML Editor HOT 3
- after change Translatable::set_default_locale from EN to LT home page not found HOT 3
- 404 error if multibyte URL's are allowed. HOT 8
- How to hide the main language prefix HOT 1
- Prevent Translatable appending locale to a URL HOT 1
- release tagged versions HOT 6
- Fatal error: Call to a member function getURLPrefix() on null in /var/www/html/languageprefix/code/LanguagePrefix.php on line 203 HOT 8
- enable_duplicate_urlsegments HOT 1
- SS4 Compatible Version HOT 1
- Silverstripe 4 Namespacing & Compatibility HOT 5
- cannot call action on homepage HOT 1
- Language prefix not used in CMS split view HOT 19
- URLSegment same on various languages -> another solution? HOT 5
- Use default locale without language prefix HOT 42
- Multi-byte character strings immediately after language prefix cause a 404 HOT 3
- How to handle SS- built-in routes/controllers HOT 1
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 silverstripe-languageprefix.