I wrote a website, with several pages, in PHP and now need it translated to a different language.
I’ve been searching ages for how I can just automatically extract all the strings and HTML text in my php source code, manually translate each, and then insert them back in.
I don’t want multi-language support, and I’ve checked translation solutions such as Translate2, but they all seem to require you to manually go in and replace code.
I’d modify the code myself, but I don’t know the language and this needs to be passed on to a translator.
Surely, there’s a ready made solution for this?
If not, can anyone recommend some solid regex for string or HTML text searching?
Thank you
Declare strings like:
PHP Gettext
Extract them to a .po file.
Send them off to a translator, who will translate the strings with Poedit.
Once you get your .po back, put it in an appropriately named directory, such as
/your/file/path/zh_CN/LC_MESSAGES/messages.poChange the locale in PHP: