I then came across php-gettext. This can be downloaded from https://launchpad.net/php-gettext/. This has the added bonus of providing a locale even if it isn't installed on your system. Following a bit of testing and jiggery-pokery, I finally got it to work, as follows:
- Unpack the archive and copy the contents somewhere on your system.
- Create a new directory to store the essential files - I placed them in my config folder, shown highlighted.
- Next include the phpgettext.php file, e.g. 1
include
(
'config/phpgettext.php'
);
- The next step is to change your gettext statements to1
echo
_(
"..."
)
It may be easier to do this with a find and replace in your text editor or IDE. For example:1print
T_(
"..."
)
1<?php
print
T_(
"Place text here"
);?>
- If using PoEdit, you can add the 'T_' keyword to the catalogue:
Great acquisition for reputation. They do amazing work and support team is second to none.
ReplyDelete