我的文件夾lang中有一個文件dk.po
和dk.mo
在我的webdir中。如何在php中使用gettext?
我該如何使用這個文件?我嘗試了所有,但我無法讓它工作。
// Lang
putenv('LC_ALL=dk');
setlocale(LC_ALL, 'dk');
// Specify location of translation tables
bindtextdomain("dk", ROOT .'lang');
// Choose domain
textdomain("dk");
我想知道是否有必要在調用setlocale之前調用putenv('...')? – Leto 2012-09-26 10:40:51
@Leto據我所知,putenv調用是爲了兼容Windows。 – Merijn 2013-08-05 09:14:03