1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-24 19:33:07 +01:00

Allow translation strings in different case

This commit is contained in:
FreeScout 2019-12-06 01:44:12 -08:00
parent d8d8ea3bd0
commit 4375c1ecd3

View File

@ -248,12 +248,30 @@ class Manager
}
$value = (string) $value;
$translation = Translation::firstOrNew([
'locale' => $locale,
'group' => $group,
'key' => $key,
]);
// $translation = Translation::firstOrNew([
// 'locale' => $locale,
// 'group' => $group,
// 'key' => $key,
// ]);
try {
$translation = Translation::where('locale', $locale)
->where('group', $group)
->where(\DB::raw('BINARY `key`'), $key)
->first();
if (!$translation) {
$translation = new Translation();
$translation->locale = $locale;
$translation->group = $group;
$translation->key = $key;
}
} catch (\Exception $e) {
$translation = Translation::firstOrNew([
'locale' => $locale,
'group' => $group,
'key' => $key,
]);
}
// Check if the database is different then the files
$newStatus = $translation->value === $value ? Translation::STATUS_SAVED : Translation::STATUS_CHANGED;
if ($newStatus !== (int) $translation->status) {