a2lix / TranslationFormBundle

Ease translations with some dedicated Symfony form types
https://a2lix.fr/bundles/translation-form
MIT License
330 stars 138 forks source link

To give possibility to change delimiter of locales when it's a string (replace comma by PIPE) #376

Open gundesli opened 2 years ago

gundesli commented 2 years ago

In configuration of a2lix_translation_form is it possible to give the possibility to change the delimiter of locales if it's a string ?

Currently the delimiter of the locales when is a string is the comma.

When providing the list of locales to the Router of Symfony, only a string delimited by a "PIPE" is accepted (e.g. en|fr)

When defining locales in a2lix_translation_form.locales, you can either specify an array of locales (e.g. [en, fr]) or a comma delimited string (e.g. en,fr). It is not possible to use a string separated by a "PIPE" (e.g. en|fr)

You have declare the locales twice, once for the router (en|fr) and once for a2lix_translation_form ([en, fr] or en,fr)

We should give the possibility to use the PIPE as a delimiter, that would be really great or even replace the comma by the PIPE simply in the file src/DependencyInjection/Configuration.php :

return preg_split('/\s*|\s*/', $v);

Thank you for your response.