Answer the question
In order to leave comments, you need to log in
Accepted practices for project internationalization (IDE, Phpstorm), how do you write templates?
Can you please tell me how it is customary to translate websites into different languages? As far as I understand, there are 2 approaches to building templates (example on twig):
Answer the question
In order to leave comments, you need to log in
If you use adequate id in id_string, then everything works very well and easily.
Adequate id, for example:
error_no_user_found
error_wrong_password
success_user_registered
And so it is clear what is written there, but how it will be in the final text is usually not so important.
Translations in the IDE(phpStorm) with autocomplete are a big problem, because the IDE does not see the array keys of the dictionary
On one project I named it like this
File message.model.php
return [
'NAME_ATTR' => 'Name',
'NAME_PLACEHOLDER' => 'Enter your name '
];
+ A bunch of dictionary files were from View models
and the other interface separately, I didn’t throw everything into one pile.
Where there was no translation, there was a stupid text output in the NAME_PLACEHOLDER style, which was immediately evident.
Translations are still that butt-pain.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question