Refactoring function for translation works

Is there a function or workaround which can help during application translation in PHP Storm when not using Symfony's Translation component but Zend Framework.

For example:

Mark the string and refactor

<h1>Hello World</h1>

Dialog: Set an variable name 'hello_world' and replace string to self defined code block

<h1><?=$this->translate('hello_world')?></h1>

Put the Element in defined file: de_DE.php

return [
'hello_world'=>'Hallo Welt',
'...' => '...',
];

 

1 comment

No, unlikely.

Probably a custom live template would work. The one that would take a selection, then would transform a selection into lower case + snake case (see https://www.jetbrains.com/help/phpstorm/template-variables.html#predefined_functions ) & add PHP-related bits.

0

Please sign in to leave a comment.