8.4.2 How to get language of default locale?
will give the current locale language. But how do I get the default one, not the active one?
Does the site get translated based on the locale or language?
... unless you know how to use single pages in a multilingual site, and how to use URL::to in this case.
$site = $this->app->make('site')->getSite(); $defaultLocale = $site->getDefaultLocale(); $defaultLocaleCode = $defaultLocale->getLocale();
in order to get the default language code in the view, I'd write this in the controller:
so that in the view, you simply have to use $defaultLocaleCode.
Thank you for that info. But does the site get translated based on the locale or language?
Do you know how single pages and URL::to should be used with multilingual? Or if/else for locales/languages is the only way?
1. if there's a logged in user, concrete5 uses the language specified in the login page
2. if a user visits a multilingual section of the site then goes to a single page, concrete5 uses the language of that multilingual section
3. concrete5 uses the site default language
Translations are always based on locales.
IDE... I've been thinking about Eclipse... but got stuck in kWrite )))