This PR was merged into the 5.3-dev branch.
Discussion
----------
[Translation] Added Lokalise Provider
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/15310
To follow up on https://github.com/symfony/symfony/pull/38475, this PR adds [Lokalise](https://lokalise.com/) Provider.
The todo list to make it ready is:
- [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface)
- [x] Add LokaliseProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file
- [x] Add Lokalise case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException`
- [x] Move `LokaliseProvider` and `LokaliseProviderFactory` from `Symfony\Component\Translation\Bridge\Lokalise\Provider` to `Symfony\Component\Translation\Bridge\Lokalise` namespace
- [x] Write integration tests by mocking HTTP Responses
The major part of the remaining work concerns tests, I will make it done before the beginning of May.
Commits
-------
022d8285f3 Added Lokalise Provider
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Translation] Added PoEditor Provider
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/15310
To follow up on https://github.com/symfony/symfony/pull/38475, this PR adds [PoEditor](https://poeditor.com/) Provider.
The todo list to make it ready is:
- [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface)
- [x] Add PoEditorProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file
- [x] Add PoEditor case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException`
- [x] Write integration tests by mocking HTTP Responses
The major part of the remaining work concerns tests, I will make it done before the beginning of May.
Commits
-------
240ac22f70 Added PoEditor Provider
This PR was merged into the 5.3-dev branch.
Discussion
----------
Fix style of changelogs/readmes
| Q | A
| ------------- | ---
| Branch? | 5.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
a964554538 Fix style of changelogs/readmes
This PR was merged into the 5.2 branch.
Discussion
----------
[Security] Translation count argument for TooManyLoginAttemptsAuthenticationException
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
Added `%count%` argument to leverage translator's pluralization functionality as discussed in https://github.com/symfony/symfony/pull/41097
Commits
-------
2bf0b485f9 Provide count argument for TooManyLoginAttemptsAuthenticationException to be able to translate in plural way
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[Translation] Added Crowdin Translation Provider
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | <!-- required for new features -->
To follow up on #38475, this PR adds [Crowdin](https://crowdin.com/) Provider.
This provider was removed a few weeks ago from the Translation Providers feature by `@welcoMattic`.
We discussed all the recent changes made on `ProviderInterface`, `TranslatorBagInterface`, and others and I already applied these changes to Crowdin Provider.
Also, this Provider is adapted to work with both [Crowdin](https://crowdin.com/) and [Crowdin Enterprise](https://crowdin.com/enterprise).
The todo list to make it ready is:
- [x] Write integration tests by mocking HTTP Responses
I will make it done before the beginning of May.
Commits
-------
d7fda16262 [Translation] Added Crowdin Translation Provider
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Translation] Refactored LocoProvider
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I've refactored the LocoProviderTest class to use properly `MockResponse` instead and creating mock of `ResponseInterface` and make useless assertions.
I've also refactored the Provider itself to get benefit of HttpClient concurrency.
It allows me to find 2 bugs, which are fixed. They concerns the usage of internal unique ids provided by Loco to update/delete translations, instead of translation files keys (which are not unique across a Symfony application).
Finally I've added a test for the `delete` method.
Ready for first review
Commits
-------
40041db7cb Refactored LocoProviderTest
This PR was merged into the 5.3-dev branch.
Discussion
----------
[DependencyInjection] Better exception when a configurator is not type hinted
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This would help with such BC break:
https://github.com/markitosgv/JWTRefreshTokenBundle/pull/241
Commits
-------
25813e3804 [DependencyInjection] Better exception when a configurator is not type hinted
This PR was merged into the 5.2 branch.
Discussion
----------
[Security] NullToken signature
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
The signature of `TokenInterface::getUser` does not allow returning null. But `NullToken` returns `null`.
0f96ac7484/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php (L49-L56)
This PR update `NullToken::getUser` to return an empty string instead of null.
I wonder if the fix shouldn't be to change the return type in the interface, but that would be a BC break, right?
Commits
-------
9ad3720efc [security] NullToken signature
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Fix/Rewrite .gitignore regex builder
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | fix#39257
| License | MIT
| Doc PR | no
This PR fixes `.gitignore` with exclude wildcard ignore rules like `!a/*/b` were failing with `preg_match(): Compilation failed: lookbehind assertion is not fixed length at offset` PHP error.
Functionality/performance was verified against large `.gitignore` files:
- https://github.com/PrestaShop/PrestaShop/blob/1.7.7.3/.gitignore
- https://github.com/dotnet/installer/blob/v5.0.202/.gitignore
- https://github.com/dotnet/runtime/blob/v5.0.5/.gitignore
This PR also improves the testing cases.
Commits
-------
83f9fd3adf Fix/Rewrite .gitignore regex builder
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Runtime] don't display the shebang on the CLI
| Q | A
| ------------- | ---
| Branch? | 5.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40949
| License | MIT
| Doc PR | -
Commits
-------
463b2db51b [Runtime] dont display the shebang on the CLI
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[WebProfilerBundle] Add simple backoff strategy on 404
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix https://github.com/symfony/symfony/issues/41112
| License | MIT
Instead of just retrying every second 5 times, this PR implements a very basic backoff strategy where it waits 1, 1, 2, 3, 5 seconds between the respective requests instead which amounts to a total wait of 12 seconds instead of 5.
Commits
-------
f1b9684ebd [WebProfilerBundle] Add simple backoff strategy on 404
* 5.2: (23 commits)
[Console] Fix Windows code page support
[SecurityBundle] Allow ips parameter in access_control accept comma-separated string
[Form] Add TranslatableMessage support to choice_label option of ChoiceType
Remove code that deals with legacy behavior of PHP_Incomplete_Class
[Config][DependencyInjection] Uniformize trailing slash handling
[PropertyInfo] Make ReflectionExtractor correctly extract nullability
[PropertyInfo] fix attribute namespace with recursive traits
[PhpUnitBridge] Fix tests with `@doesNotPerformAssertions` annotations
Check redis extension version
[Security] Update Russian translations
[Notifier] Fix return SentMessage then Messenger not used
[VarExporter] Add support of PHP enumerations
[Security] Added missing Japanese translations
[Security] Added missing Polish translations
[Security] Add missing Italian translations #41051
[Security] Missing translations pt_BR
getProtocolVersion may return null
Fix return type on isAllowedProperty method
Make FailoverTransport always pick the first transport
[TwigBridge] Fix HTML for translatable custom-file label in Bootstrap 4 theme
...
This PR was submitted for the 5.x branch but it was squashed and merged into the 5.2 branch instead.
Discussion
----------
[Console] Fix Windows code page support
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37385, Fix#35842, Fix#36324, Fix#37495, Fix#37278
| License | MIT
Corrects previous fixes that dealt with the mojibake problem on Windows where an OEM code page was applied to an input string and then messed with PHP.internal_encoding setting used by the script. This caused strings with different encodings to be displayed on the console output.
Commits
-------
be68682fd1 [Console] Fix Windows code page support
This PR was merged into the 5.2 branch.
Discussion
----------
[Security] Allow ips parameter in access_control to accept comma-separated string
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #40881, #40864, #40865
| License | MIT
PR #38149 introduced a new feature to accept a comma-separated string in ip adresses setting in `access_control` configuration section of security bundle.
However the feature works in inconsistent manner: comma-separated string can be successfully passed via environment variable, but can not be passed as plain string. This PR changes this inconsistent behavior by allowing validation pass if comma-separated list of ip addresses is given in plain string.
More detailed explanation about the inconsistent behavior can be found [here](https://github.com/symfony/symfony/issues/40881#issuecomment-823906622)
Commits
-------
8947482342 [SecurityBundle] Allow ips parameter in access_control accept comma-separated string
This PR was merged into the 5.2 branch.
Discussion
----------
[TwigBridge] Fix HTML for translatable custom-file label in Bootstrap 4 theme
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Bootstrap allows to translate/change the label of the upload button of a `custom-file` input via SCSS, see [Bootstrap docs](https://getbootstrap.com/docs/4.6/components/forms/#translating-or-customizing-the-strings-with-scss):
~~~scss
$custom-file-text: (
en: "Browse",
es: "Elegir"
);
~~~
This works by generating the following CSS which depends on the `lang` attribute of the input:
~~~css
.custom-file-input:lang(es) ~ .custom-file-label::after {
content: "Elegir";
}
~~~
This however currently does not work with the HTML generated by the theme since the resulting HTML is of the form (redacted here to the relevant parts):
~~~html
<div class="custom-file">
<input type="file" id="..." class="custom-file-input">
<label for="..." lang="es" class="custom-file-label"></label>
</div>
~~~
while it should be of the form
~~~html
<div class="custom-file">
<input type="file" id="..." lang="es" class="custom-file-input">
<label for="..." class="custom-file-label"></label>
</div>
~~~
i.e. the `lang` was placed on the `label` instead of the `input`.
This PR fixes this to be compatible with Bootstrap 4.
Commits
-------
a95bbaaaef [TwigBridge] Fix HTML for translatable custom-file label in Bootstrap 4 theme
This PR was merged into the 5.2 branch.
Discussion
----------
[Notifier] [Bridge] Fix missed messageId for SendMessage object in slack notifier
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | -
| Tickets | -
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
There are missed messageId property for SendMessage object in slack notifier.
Regarding slack's documentation: https://api.slack.com/messaging/sending#publishing
> One very important piece of information in this response is the `ts` value, which is essentially the ID of the message,
Commits
-------
838f36b09f [Notifier] [Bridge] Store message id for slack transport's SendMessage
This PR was merged into the 5.2 branch.
Discussion
----------
[Form] Add missing TranslatableMessage support to choice_label option of ChoiceType
It leads to loss of information because it'll use `__toString` to cast, which is incompatible with newly added `TranslatableMessage`, for example.
| Q | A
| ------------- | ---
| Branch? | 5.2 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#40622 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | _none_
So this one's a bit tricky in my mind. I didn't want to check if `$dynamicLabel instanceof TranslatableMessage`, because of course it doesn't belong to the same component.
Aside, it would sound so strange to me to add `|object` to `$label` here: bb1e1e58ae/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php (L40)
But maybe that's the way to go? Requiring your help here. I'm fully open to your ideas, as we're loosing a big feature here by losing `TranslatableMessage` translation parameters.
If the passed object doesn't implement `__toString`, it'll lead to an exception during template rendering, as expected.
Commits
-------
c2873aaf0e [Form] Add TranslatableMessage support to choice_label option of ChoiceType
This PR was merged into the 5.2 branch.
Discussion
----------
Remove code that deals with legacy behavior of PHP_Incomplete_Class
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
c5a4f7d8f9 Remove code that deals with legacy behavior of PHP_Incomplete_Class