-
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
Conversation
…igration away from ZLanguage and ZLocale.
wanted opinions on this approach before proceeding with further refactoring. |
from which it may be obtained. These variables are not defined explicitly in most cases. | ||
|
||
|
||
ZLanguage::getLanguageCode() becomes $container->getParameter('locale') |
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()
and ZLanguage::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.
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
{{ localeApi.language_direction }}
is deprecated then?
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.
not deprecated - removed. broken. see also #3365
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 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Great 😄
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
There is also \Intl::getRegionBundle()->getCountryName($countryCode)
available.
Please also add a pointer to http://symfony.com/doc/current/components/intl.html#accessing-icu-data to the docs. |
I like the direction where this is heading to. |
This is fine I think. |
@Guite please review again. I think this is ready to merge. |
in preparation for migration away from ZLanguage and Locale.
Description
update LocaleApi and remove old metatdata access in preparation for migration away from ZLanguage and ZLocale.
Todos