Skip to content

Instantly share code, notes, and snippets.

View hdlopes's full-sized avatar

Hugo Lopes hdlopes

View GitHub Profile
@ruionwriting
ruionwriting / PHP_I18N_basics.md
Last active December 20, 2015 13:29
Basics for setting up localized PHP applications using gettext functions.

Overview

Localizing/internationalizing any PHP application is easy through gettext functions. Basically you'll have a set of localization files (*.po) that have a binary format version (*.mo) across a simple and standard directory structure. Then gettext functions will use existing binary files based on current language locale.

Directory structure and localization files

locale/
├── en_US
│   └── LC_MESSAGES