Add function twig *_name for intl
Hi,
I add language_names, script_names, country_names, locale_names, currency_names, timezone_names.
It allows us to have a list but on the Twig side and to use them in filters for example.
issue #3741
Can you add the related docs?
Can you add the related docs?
I just added them.
maybe some utest (coverage) could be added for the new code?
maybe some utest (coverage) could be added for the new code?
I don't know how to do it.
maybe some utest (coverage) could be added for the new code?
I don't know how to do it.
You can add test files in extra/intl-extra/Tests/Fixtures and run the test command:
cd extra/intl-extra
composer install
vendor/bin/simple-phpunit
maybe some utest (coverage) could be added for the new code?
I don't know how to do it.
You can add test files in
extra/intl-extra/Tests/Fixturesand run the test command:cd extra/intl-extra composer install vendor/bin/simple-phpunit
I just added them.
It looks like tests are broken.
The fabbot issue is wrong.
You are right but I did not touch this part of the code. fabpot.io offers me the following code:
public function formatDateTime(Environment $env, $date, ?string $dateFormat = 'medium', ?string $timeFormat = 'medium', string $pattern = '', $timezone = null, string $calendar = 'gregorian', string $locale = null): string
{
- $date = \twig_date_converter($env, $date, $timezone);
+ $date = twig_date_converter($env, $date, $timezone);
$formatter = $this->createDateFormatter($locale, $dateFormat, $timeFormat, $pattern, $date->getTimezone(), $calendar);
if (false === $ret = $formatter->format($date))
Otherwise, this is the link: https://fabbot.io/patch/twigphp/Twig/3742/cf584f042bf16324db8b8a7a74e067d2e41f03e8/cs.diff
It looks like tests are broken.
Tests fail due to line break (\r, \r\n) I don't see how I could do better to pass the tests.
@seb-jean Thank you fo all the changes. I'm going to take over the tests changes before merging the PR (I'd like to have it for the next versions that I'm going to release soon).
Thank you @seb-jean.
Thanks to the people who helped me build this PR.