You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Last month or so, I began to try to understand how to generate .po file from twig strings since the last update of .po files lacks several new strings. The script i18n_extract.php only works well when all of the templates are cached and not so much ideal for a development environment due to constantly cleaning the cache or just using with debug or auto reload on.
Then I started searching for alternatives to generate .po files from the strings in the twig itself, POEdit Free is not suitable because the Twig parser is behind the PRO license and all of the parsers that I tried failed to extract all strings. So after a little searching I made a script to compile all templates, put them in a folder then scan the project folder with POEdit. It works very well and I was able to translating all of the strings.
I'm bringing this here to explore more alternatives to this problem, suggestions and etc.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Last month or so, I began to try to understand how to generate .po file from twig strings since the last update of .po files lacks several new strings. The script
i18n_extract.php
only works well when all of the templates are cached and not so much ideal for a development environment due to constantly cleaning the cache or just using with debug or auto reload on.Then I started searching for alternatives to generate .po files from the strings in the twig itself, POEdit Free is not suitable because the Twig parser is behind the PRO license and all of the parsers that I tried failed to extract all strings. So after a little searching I made a script to compile all templates, put them in a folder then scan the project folder with POEdit. It works very well and I was able to translating all of the strings.
I'm bringing this here to explore more alternatives to this problem, suggestions and etc.
Link to the script: https://gist.github.com/perdedora/eb4b5891e5d2499416bc9e21ddb96932
Just save in the
tools
folder and run from the cli.Beta Was this translation helpful? Give feedback.
All reactions