I'm writing a project in french (default) and english (India).
When configured with the locales : fr(default) and en:
My entity has no english translation : I can get it when visiting with _locale=fr or _locale=en
but
When configured with the locales : fr(default) and en_IN:
My entity has no english translation : I can get it when visiting with _locale=fr but there's an error when _locale=en_IN (return null value).
I fix that changing code in knplabs\doctrine-behaviors\src\Provider\LocaleProvider.php > provideCurrentLocale
$currentLocale = $currentRequest->getLocale();
if ($currentLocale !== '') {
return $currentLocale;
}
to
$currentLocale = $currentRequest->getLocale();
if ($currentLocale !== '') {
return substr($currentLocale,0,2);
}
It forces only 2 digit for $currentLocale instead of 4
I'm writing a project in french (default) and english (India). When configured with the locales : fr(default) and en: My entity has no english translation : I can get it when visiting with _locale=fr or _locale=en but When configured with the locales : fr(default) and en_IN: My entity has no english translation : I can get it when visiting with _locale=fr but there's an error when _locale=en_IN (return null value).
I fix that changing code in knplabs\doctrine-behaviors\src\Provider\LocaleProvider.php > provideCurrentLocale
It forces only 2 digit for $currentLocale instead of 4