-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update LocaleApi and remove old metatdata access #3366
Changes from 1 commit
d68ba36
5b747a9
20f97ce
4cb1ff0
821bec6
e88109c
04a72b1
bacc2ce
f84b552
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Replacing ZLanguage | ||
=================== | ||
|
||
In the examples below, the provided variable (e.g. $container, $kernel, etc) must be adjusted to match the environment | ||
from which it may be obtained. These variables are not defined explicitly in most cases. | ||
|
||
|
||
ZLanguage::getLanguageCode() becomes $container->getParameter('locale') | ||
|
||
ZLanguage::getModuleDomain('AcmeFooModule') becomes $kernel->getModule('AcmeFooModule')->getTranslationDomain() | ||
|
||
ZLanguage::getDirection() becomes use `dir=auto` in the template instead | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not deprecated - removed. broken. see also #3365 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose we could provide some BC |
||
|
||
ZLanguage::getLanguageName($code) becomes \Intl::getLanguageBundle()->getLanguageName($locale) | ||
|
||
ZLanguage::getInstalledLanguages() becomes $localeApi->getSupportedLocales() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great 😄 |
||
|
||
ZLanguage::getInstalledLanguageNames() becomes $localeApi->getSupportedLocaleNames() | ||
|
||
ZLanguage::setLocale('en') becomes depends on the need. probably set in the Request $request->setLocale('en') | ||
maybe need to set the parameter in the container or in config.yml (or both) | ||
|
||
ZLanguage::getLocale() becomes $request->getLocale() | ||
|
||
ZLanguage::bind*Domain('AcmeFooModule') becomes no longer needed with symfony translator | ||
|
||
ZLanguage::getEncoding() becomes $kernel->getCharset() | ||
|
||
ZLanguage::isRequiredLangParam() is handled automatically by the router | ||
|
||
ZLanguage::countryMap() becomes \Intl::getRegionBundle()->getCountryNames() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is also |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
$request->getLocale()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw
getLocale()
below.What is the difference between
ZLanguage::getLanguageCode()
andZLanguage::getLocale()
?What is the difference between
$container->getParameter('locale')
and$request->getLocale()
?The first is the default and the second one the current request's value only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose so. not sure.