mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-01 09:19:09 -04:00
Fix for fetching l10n plural messages. Need to cast from stdclass to array(), as I18n expects all messages to be either string or array.
This commit is contained in:
@@ -123,7 +123,12 @@ class l10n_client_Core {
|
||||
$key = $message_data->key;
|
||||
$locale = $message_data->locale;
|
||||
$revision = $message_data->rev;
|
||||
$translation = serialize(json_decode($message_data->translation));
|
||||
$translation = json_decode($message_data->translation);
|
||||
if (!is_string($translation)) {
|
||||
// Normalize stdclass to array
|
||||
$translation = (array) $translation;
|
||||
}
|
||||
$translation = serialize($translation);
|
||||
|
||||
// @todo Should we normalize the incoming_translations table into messages(id, key, message)
|
||||
// and incoming_translations(id, translation, locale, revision)? Or just allow
|
||||
|
||||
Reference in New Issue
Block a user