PHP - GetText not working -
i'm trying add translations webpage. unfortunately translation isn't being read.
however, 1 translation read (even though ask different one).
my php code looks this:
$language = "en_us"; //hardcoded debugging purposes define("folder_specification", "./locale/"); define("domain", "messages"); define("code_set", "utf-8"); putenv("lang=" . $language); setlocale(lc_all, $language); bindtextdomain(domain, folder_specification); bind_textdomain_codeset(domain, code_set); textdomain(domain);
my folder structure looks this:
root > locale > en_us > lc_messages > messages.mo messages.po nl_nl > lc_messages > messages.mo messages.po
if change $language
variable en_us
or nl_nl
still grabs translation nl_nl
, if remove nl_nl
folder doesnt translate @ all, means 1 thing: en_us translation isn't being read.
both messages.po contain headers , such , both valid (i loaded them in poedit).
my question is: why grab nl_nl though never told code grab it, , why isn't other translation (en_us) being read?
both .po files (the 'language' tag in headers different):
msgid "" msgstr "" "project-id-version: project\n" "pot-creation-date: 2014-08-05 13:32+0100\n" "po-revision-date: 2016-04-19 10:43+0200\n" "last-translator: \n" "language-team: <s.omeone@something.com> \n" "mime-version: 1.0\n" "content-type: text/plain; charset=utf-8\n" "content-transfer-encoding: 8bit\n" "x-generator: poedit 1.8.7\n" "x-poedit-basepath: .\n" "plural-forms: nplurals=2; plural=(n != 1);\n" "language: nl_ul\n" "x-poedit-sourcecharset: utf-8\n" msgid "banaan" msgstr "banana" msgid "appel" msgstr "apple"
Comments
Post a Comment