我想在debian上安裝gettext,它在我本地計算機上的Wamp上完美工作,但不在服務器上。我這樣做是爲了安裝:gettext沒有翻譯顯示
apt-get install -V gettext
我推出這個:
# apt-cache search --names-only gettext
libgettext-ant-tasks-java - Java classes for internationalization (i18n) - Ant tasks
gettext-base - GNU Internationalization utilities for the base system
gettext-doc - Documentation for GNU gettext
gettext-el - Emacs po-mode for editing gettext .po files
gettext - GNU Internationalization utilities
libgettext-activerecord-ruby-common - GetText localization for Ruby programs using ActiveRecord
libgettext-activerecord-ruby1.8 - GetText localization for Ruby programs using ActiveRecord
libgettext-activerecord-ruby1.9.1 - GetText localization for Ruby programs using ActiveRecord
libgettext-activerecord-ruby - GetText localization for Ruby programs using ActiveRecord
libgettext-commons-java - Java classes for internationalization (i18n)
libgettext-rails-ruby-doc - Gettext support for Rails 2.3
libgettext-rails-ruby1.8 - Gettext support for Rails >= 2.3
libgettext-rails-ruby - Gettext support for Rails >= 2.3
libgettext-ruby-util - Gettext utilities for ruby (dummy package)
libgettext-ruby1.8 - Gettext for ruby1.8
libgettext-ruby1.9.1 - Gettext for ruby1.9.1
libintl-gettext-ruby1.8 - Gettext wrapper for Ruby 1.8
libintl-gettext-ruby - Gettext wrapper for Ruby
liblocale-gettext-perl - Using libc functions for internationalization in Perl
liblocale-maketext-gettext-perl - Perl module bridging gettext and Maketext localization frameworks
libgettext-ocaml-dev - OCaml internationalization library
libgettext-ocaml - OCaml internationalization shared library
php-gettext - read gettext MO files directly, without requiring anything other than PHP
smarty-gettext - Gettext plugin enabling internationalization in Smarty
我的phpinfo():
GetText Support enabled
我的PHP代碼:
putenv("LANG=nl_NL");
setlocale(LC_ALL, "nl_NL");
bindtextdomain("greetings", "./locale/");
textdomain("greetings");
echo _("Hello World");
問候。 po:
msgid "Hello World"
msgstr "Hallo Wereld"
greetings.mo在:
locale/nl_NL/LC_MESSAGES/
其它信息:
PHP Version 5.3.3-7+squeeze3
我跟很多教程,但他們沒有工作,上一次是http://www.aota.net/forums/showthread.php?threadid=10615
通常它應該輸出「Hallo Wereld」,但它仍然是「Hello World」。 我重新啓動了服務器,並且翻譯已經進行了一段時間,所以它不是緩存問題。
非常感謝。
不:-( – user1040899 2012-01-10 04:40:46
與更新工作另一個想法。 – 2012-01-10 05:00:22
我找到了方法,我回答了我的問題。我給了你+1的答案,即使它沒有幫助我:-)謝謝。 – user1040899 2012-01-10 05:06:32