BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 37 forks source link

[BUG] If locales is undefined or empty '_localeswitcher.twig' throws error #152

Closed nestordedios closed 6 years ago

nestordedios commented 7 years ago

Hi @SahAssar ,

As mentioned in https://github.com/BoltTranslate/Translate/issues/143#issuecomment-337230077. Using strict variables will trigger this error: capture

As you said that can be fixed by using {% for key, locale in locales|default([]) %}

Would it be possible to add that to the base '_localeswitcher.twig' so it won't be necessary to create a '_custom_localeswitcher.twig'?

Details