I've got a translation library in my project and I am trying to show some translations but I cannot seem to get gettext to work.
Current structure looks like this:
Project
test.php
translations
iso-3166-1
ja.po
So inside Project/translations/iso-3166-1 all the .po files are stored.
In test.php I've got:
<?php
$locale = "ja";
$dir = "translations";
putenv("LANGUAGE=$locale");
bindtextdomain("iso-3166-1", $dir);
textdomain("iso-3166-1");
echo gettext("Australia")."\n";
But no matter what I try it doesn't seem to show me any translation. Using this method shouldn't it be able to look for the translation in the path that I have provided.. I've gone through the docs a few times but I can't seem to find any fix.