MOBILE-3068 lang: Remove warning when adding new strings

main
Pau Ferrer Ocaña 2019-08-23 15:29:32 +02:00
parent 789eb299b0
commit 4053d5bea4
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ function save_key($key, $value, $path) {
$file = file_get_contents($filePath);
$file = (array) json_decode($file);
$value = html_entity_decode($value);
if ($file[$key] != $value) {
if (!isset($file[$key]) || $file[$key] != $value) {
$file[$key] = $value;
ksort($file);
file_put_contents($filePath, str_replace('\/', '/', json_encode($file, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)));