Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Managing Gettext Translations on Shared Hosting
Feb 11, 2014 @ 19:09:19

On the SitePoint PHP blog today Aurelio De Rosa makes some recommendations about handing gettext translations on shared hosting. The problem with shared hosting is the need to reset the web server (Apache) to get it to read the updated translation files. His workarounds uses an external script that can dynamically pull in the latest translations without the restart.`

For serious translations we can use Gettext. This approach enables us to have different files for every targeted language which helps in maintaining separation between the business logic, the presentation layer, and the translations (which we can see as an add-on of the presentation layer). With Gettext, we can parallelize the process because while we’re working on some features of the website, translators can still work on translations using software like gettext functionality to set the current language and extract a "HELLO_WORLD" string. He then moves on to the use of the Audero Shared Gettext library. This library creates a "mirror" of the translation file requested and forces those updates into the current domain. Code examples of its use are included showing a basic pull and merge process.

tagged: gettext tranlsation dynamic loading webserver shared hosting tutorial

Link: http://www.sitepoint.com/managing-gettext-translations-shared-hosting


Trending Topics: