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
Remove calls to old CLDR #12999
Remove calls to old CLDR #12999
Conversation
0cf74fe
to
0a0cdaa
Compare
98a4990
to
6731d77
Compare
src/PrestaShopBundle/Resources/config/services/core/grid/doctrine_query_builder.yml
Outdated
Show resolved
Hide resolved
src/PrestaShopBundle/Resources/config/services/adapter/data_provider.yml
Outdated
Show resolved
Hide resolved
b840f5a
to
719c77d
Compare
@@ -158,7 +158,7 @@ services: | |||
prestashop.core.form.choice_provider.currency_name_by_iso_code: | |||
class: 'PrestaShop\PrestaShop\Core\Form\ChoiceProvider\CurrencyNameByIsoCodeChoiceProvider' | |||
arguments: | |||
- '@=service("prestashop.core.cldr.repository").getAllCurrencies()' | |||
- '@=service("prestashop.core.localization.cldr.locale_repository").getLocale(service("prestashop.adapter.legacy.context").getContext().language.getLocale()).getAllCurrencies()' |
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.
wow!! 🤪
I get the logic but it's quite a long expression, do you think there might a service that could do this more easily? Although I don't have the solution, it's a question? ^^
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.
Well, I also thought about a dedicated service, but I wonder if it's a good idea.
As we rely on a context attribute (language), I do not want to see a service initialized too early and see it empty.
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.
Yes I see the problem, maybe we would need a service with the legacy context, which would have getContextLocale
getContextCurrency
(rough idea..) which would be resolved on the fly
But anyway it's not the purpose of this PR
fcd0b9d
to
aa49f04
Compare
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @eternoendless, @jolelievre, and @PierreRambaud)
src/Core/Localization/Specification/Number.php, line 332 at r10 (raw file):
Previously, eternoendless (Pablo Borowicz) wrote…
Why not add it in its constructor then?
that's was before, it makes CLDR reference and prestahop currency coupled. I think it is better to get price spec from the reference THEN override the precision.
Else we have to pass a not-required precision to construct the spec
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.
Reviewed 1 of 1 files at r15.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolelievre and @PierreRambaud)
@mbadrani Could you launch CLDR E2E tests ? |
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.
Reviewed 5 of 25 files at r16, 3 of 8 files at r17, 5 of 9 files at r18, 5 of 6 files at r19, 4 of 4 files at r20, 1 of 3 files at r22, 1 of 1 files at r23, 1 of 1 files at r24.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolelievre, @mbadrani, and @PierreRambaud)
🎉 Thank you @Quetzacoalt91 and @tomlev! |
Tools::getCldr()
, and all classes inPrestaShop\PrestaShop\Core\Cldr
This change is