symfony-bundle icon indicating copy to clipboard operation
symfony-bundle copied to clipboard

Profiler: Fallback locale in missing translations

Open toooni opened this issue 8 years ago • 5 comments

When having country specific translations there are locales like de_CH and fr_FR. In my opinion the "Missing" tab in the profiler should only offer the possibility to translate the non country specific versions de and fr by default. If the current locale setting is de_CH and there wasn't a fallback to de available (then it would be in the "Fallback" tab) a new created translation should always be de (if de is also in the supported locales) - this is also the symfony default behaviour.

toooni avatar Mar 26 '17 06:03 toooni

I think the same should be in AutoAddMissingTranslations. There it could be very easy. Just substr the locale in Translation\Bundle\EventListener\AutoAddMissingTranslations.

toooni avatar Mar 27 '17 06:03 toooni

The tabs are all from Symfony. They are using the Symfony translation data collector.

But isn't this a feature? You can have all "normal" translations in de and if there are some that are country specific you add then in de_CH and de_AU. That would keep de_CH and de_AU small and de is the large one. That would reduce the number of strings you translate, right? Or am I missing something?

Nyholm avatar Mar 27 '17 06:03 Nyholm

@Nyholm That's actually what we do. We do have all our translations in de but only a few in de_CH. But in the "Missing" tab are only translations which do not have a Fallback to de (country unspecific). image

Those two translations in the screenshot are not available in de but the translation will be added as de_CH anyway. I am sure that using the country unspecific locale might be the only thing what's needed (in the "Missing" tab).

toooni avatar Mar 27 '17 06:03 toooni

@Nyholm we have the same problem. The AutoAddMissingTranslations will always create messages in the most specific way. If you use fallback-logic, this is a rare case. It seem's not easy how to determine if it should created de or de_CH as @toooni pointed out, if there a fallback-catalogue, it normally makes sence to write into it.

Gladhon avatar Mar 20 '18 17:03 Gladhon

Interesting. I'll have a look

Nyholm avatar Mar 20 '18 17:03 Nyholm