Comments (9)
What is the default language configured in your browser? Also check the Yii logs for trace messages of the extension (YII_DEBUG
must be true
).
from yii2-localeurls.
"language configured in your browser" <-- my browser language setting is Thai (it's can change yii default language settings )?
and in app.log after clean and enter website again, it's not appear anything.
Thanks,
from yii2-localeurls.
Make sure, that YII_DEBUG
is really enabled and that you use the latest version. You should see messages like:
Level | Category | Message |
---|---|---|
trace | codemix\localeurls\UrlManager::processLocaleUrl | Language code found in URL. Setting application language to 'de'. |
trace | codemix\localeurls\UrlManager::processLocaleUrl | Persisting language 'de' in session. |
trace | codemix\localeurls\UrlManager::processLocaleUrl | Persisting language 'de' in cookie. |
Also make sure, that you check all previous requests. You should see redirect messages there
Level | Category | Message |
---|---|---|
trace | codemix\localeurls\UrlManager::redirectToLanguage | Redirecting to /de. |
from yii2-localeurls.
8 12:05:28.466 trace yii\base\Application::bootstrap Bootstrap with yii\gii\Module::bootstrap()
9 12:05:28.467 trace codemix\localeurls\UrlManager::processLocaleUrl Language code found in URL. Setting application language to 'en-US'.
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (271)
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (165)
10 12:05:28.469 info yii\web\Session::open Session started
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (273)
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (165)
11 12:05:28.469 trace codemix\localeurls\UrlManager::processLocaleUrl Persisting language 'en-US' in session.
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (274)
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (165)
12 12:05:28.472 trace codemix\localeurls\UrlManager::processLocaleUrl Persisting language 'en-US' in cookie.
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (286)
C:\xampp\htdocs\dusitthanicollege.local\vendor\codemix\yii2-localeurls\UrlManager.php (165)
from yii2-localeurls.
This is not the first request, because there is obviously already a language code in the URL:
9 12:05:28.467 trace codemix\localeurls\UrlManager::processLocaleUrl Language code found in URL. Setting application language to 'en-US'.
You should check the previous request.
from yii2-localeurls.
Hi,
Before enter site I did as step below:
- Clean browser cookie
- Close all browser
- remove Yii runtime/cache, runtime/HTML
- Restart Apache
- Open browser again, then open new browser in private mode and enter site.
Thanks
from yii2-localeurls.
Again: You need to check the log files for each and every request and try to understand what each message means. When you go to the /
URL of your website, the extension will detect a language and then redirect. So a second request is made. You should read the log messages from the first request to /
.
from yii2-localeurls.
Thanks, I will check and tell you again.
from yii2-localeurls.
Hi,
I found solution (by debug your code lol...), and solve by
'enableLanguageDetection' => false,
'enableDefaultLanguageUrlCode' => true,
Many Thanks for your support.
from yii2-localeurls.
Related Issues (20)
- Problem with default language HOT 3
- Redirect from https to http HOT 1
- Ajax also redirects when enableLanguagePersistence is turned on HOT 2
- Regular expression trouble HOT 5
- Using GeoIp as primary language detection method HOT 2
- Support for different domains HOT 2
- The page keeps redirecting HOT 1
- index.php is shown in browser url HOT 1
- How can i change language position in url HOT 2
- Please fix this define HOT 3
- Url::to with rules HOT 1
- One language for all EU locales HOT 1
- Problem with change language under Windows HOT 3
- Some issues with yii2-localeurls
- using Yii functionality HOT 2
- Bug in tests HOT 1
- The configuration for the "localeUrls" component must contain a "class" element. HOT 1
- Generating URL with custom urlRule HOT 2
- Help me please. Error with route. HOT 3
- Redirect for specific languages 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 yii2-localeurls.