1

I have some question about this:

1) I am reading how .mo files work and i see that the folder of my locale need to be: /locale/de_DE/LC_MESSAGES/domainname.mo

Wordpress and others have different path as: /locale/de_DE.mo /locale/it_IT.mo etc. How can I set the second strategy?

2) in setlocale() can O use something else other than it_IT, de_DE? I want use this. Is it possible?

Kara
  • 6,115
  • 16
  • 50
  • 57
Atomico
  • 453
  • 1
  • 6
  • 26

1 Answers1

1

You cannot. It is internal process of gettext. Gettext was designed for unix applications with localizations at /usr/locale/de_DE/LC_MESSAGES/domain.mo. It made sense that way. On PHP I believe it does not make sense.. And as many people before, I spent time wondering what do I wrong. Because on some platforms, de_DE and it_IT are wrong, on some they are right. See PHP/Gettext Problems or PHP gettext on Windows .

If you will accept my recommendation, I suggest you stick to gettext files, but use other than default PHP gettext backend. Good and simple is https://launchpad.net/php-gettext/. More powerfull might be Zend Translator, but you need big framework for that. I recommend you stay away from PHP gettext module.

Community
  • 1
  • 1
Pihhan
  • 813
  • 5
  • 11