W
W
wasm2016-12-07 18:25:01
bash
wasm, 2016-12-07 18:25:01

Bash script for searching Russian words?

Good afternoon!
There is a php script with this content

<?php
echo 'Привет'. $testvar . 'мир!';
?>

It is necessary to find the Russian text in quotes in all php files and replace it with a random variable, utf-8 encoding of php scripts. All this must be done with a bash script. Those. should get the following
<?php
echo $kasjdks. $testvar . $asdllk;
?>

and in file 1.txt
$kasjdks= 'Hi';
$asdlk = 'world!';
And there are also php files, just with html, i.e.
<?php
<BR>Пример Мир!<BR>
<a>Тест</a>
?>

Here, too, it is necessary to organize a search and replace the Russian text. All this idiocy is needed to implement the site’s multilingualism, before me the site was made by other people, and all the Russian text was shoved directly into scripts, it’s
not a bunch of scripts to change everything by hand, so I came up with such an idea, I can’t compose a competent regular program, help, please, or maybe someone has already encountered such a situation, maybe there are other solutions, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abcd0x00, 2016-12-08
@abcd0x00

In general, they make the _() function and write all phrases in English like _("hello"). And this function itself already goes where it needs to and takes the phrase in the correct language in accordance with the locale. Thus, the program is translated into any language by editing such files with pairs (English, Chinese).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question