Answer the question
In order to leave comments, you need to log in
What is your action on keyboard shortcuts?
Hello. We have our own CMS and periodically receive tasks to add multilingualism. Each time you have to go into the templates to look for words in Russian and instead of them in the next file add a variable to the array and its value. It began to take a lot of time, and therefore it would not be bad to do something like this:
When selecting text, press a certain combination of keys and the selected text is automatically replaced with the name of a variable that phpstorm would create in an adjacent file. But is it possible to somehow implement this without writing a plugin?
An example of a file with translations:
class lang {
public function langData() {
$lang = array(
'homePage'=>'Home Page',
'message' => 'Message',
'send' => 'Send',
'tel' => 'Telephone',
'email' => 'E-mail',
//дописывал бы сюда
);
return $lang;
}
}
Answer the question
In order to leave comments, you need to log in
In Laravel, for example, to implement this, people write tools that generate or edit lang files.
Web admin: https://github.com/barryvdh/laravel-translation-manager
Console: https://github.com/PhiloNL/laravel-translate
I think you need to do something like this for yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question