N
N
Neusser2018-08-27 12:28:09
PHP
Neusser, 2018-08-27 12:28:09

Is there a localization management tool (PHP)?

There is a samopisny project on PHP. Localizations are stored in text files in the following format:
English:

<?php
$global_hello = 'Hello';
$global_today = 'Today';
$global_save = 'Save';

Russian:
<?php
$global_hello = 'Привет';
$global_today = 'Сегодня';
$global_save = 'Сохранить';

The Russian language was not studied for several years, now it fell to me to put it in order. Problems:
  • In these few years the English file has grown by about a thousand lines.
  • The Russian file contains variables that have already been removed from the English one.
  • Even matching variables very often go in a different order (differences start already from the third line, not counting the comments).

Is there any utility that can open two files and show matches and differences in existing variables? To make it clear - this line is translated, this line is not translated, this line is added and is not in the translation.
Something similar to the Translations Editor in Android Studio.
5b83c019252ed668548309.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-08-27
@webinar

Is there any utility that can open two files and it will show the matches and differences

1. excel
2. write a php script that will process 2 files as you need
Help: php.net/manual/ru/function.get-defined-vars.php
3. Since you have php files and variables are created there, then you can stick the logic into this very file, get a list of variables, sort through and write to the database by calling this file. Check if everything is recorded, delete the files and then work calmly with the tables, making selections and checking for the presence of certain keys, comparing, etc.
PS: they usually create an array and pull the translation by key, and do not produce variables

M
metallix, 2018-08-27
@metallix

Perhaps Meld Diff Viewer will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question