[ 'domain' => $domain, 'lang' => get_user_locale(), ] ]; if (! empty($translations->headers['Plural-Forms'])) { $locale[$domain]['']['plural_forms'] = $translations->headers['Plural-Forms']; } foreach ($translations->entries as $msgid => $entry) { $locale[$domain][$msgid] = $entry->translations; } foreach (blocksy_get_json_translation_files('blocksy') as $file_path) { $parsed_json = json_decode( call_user_func( 'file' . '_get_contents', $file_path ), true ); if ( ! $parsed_json || ! isset($parsed_json['locale_data']['messages']) ) { continue; } foreach ($parsed_json['locale_data']['messages'] as $msgid => $entry) { if (empty($msgid)) { continue; } $locale[$domain][$msgid] = $entry; } } return $locale[$domain]; } }