Example where we download via api and parse translations. In multiple language export there is only one format "I18NEXT_MULTILINGUAL_JSON". That format does cut phrase ids using "." as a separator. In this example we create simple language based .json files. Where keys and values are all in a flat structure.
Source code viewer
require_once ROOT . 'vendor/autoload.php'; use Onesky\Api\Client; $files = ['en', 'et', 'ru', 'lv']; $client = new Client(); $client->setApiKey(ONESKY_PUBLIC_KEY)->setSecret(ONESKY_SECRET_KEY); 'project_id' => ONESKY_PROJECT_ID, 'source_file_name' => 'Manually input', 'file_format' => 'I18NEXT_MULTILINGUAL_JSON', ]), TRUE); function recursion($input_key, $input_value, &$array) { foreach ($input_value as $key => $value) { recursion($input_key . '.' . $key, $value, $array); } } else { $array[$input_key] = $input_value; } } foreach ($files as $file) { $array = []; foreach ($response[$file]['translation'] as $key => $value) { recursion($key, $value, $array); } }Programming Language: PHP