Re: PHP extension 'gettext' doesn't work?


Daniel Mikusa
 

OK, so really sorry this took me so long to investigate, but I think I've
found the issue. Ubuntu has these "language packs" and in order for
gettext to work the system has to have that language pack installed.

https://help.ubuntu.com/community/Locale

You can see what language packs are installed on your system by running
`locale -a`. I was testing this on an Ubuntu docker image and the only way
I could make it work was to install the language pack. As soon as I did
that and restarted Apache HTTPD, I started to get my translations.

Running `locale -a` on the `cflinuxfs2` docker image shows that only these
language packs are installed.

```
$ locale -a
C
C.UTF-8
POSIX
en_US.utf8
```

When I setup a test app and run it on CF, I get the same results. Only
`en_US.utf8` works.

Unfortunately, I'm not sure how you could go about installing more language
packs into the stack for CF. It seems that you have to install them via
`apt-get` and that simply won't work, since there's no root access in the
container. If anyone has any ideas about how to install more language
packs, let me know.

My only suggestion would be to use the intl extension instead of gettext.
I believe it offers similar functionality, although it's not something I've
done myself.

Hope that helps!

Dan

On Fri, Oct 9, 2015 at 4:47 AM, Hiroaki Ukaji <dt3snow.w(a)gmail.com> wrote:

Hi.
Thanks for your confirmation.
I'm glad that it seems like my intention is being conveyed.
(I'm sorry about my poor English...)

I'm looking forward to hearing a second look from you.


Thanks.

Hiroaki UKAJI



--
View this message in context:
http://cf-dev.70369.x6.nabble.com/cf-dev-PHP-extension-gettext-doesn-t-work-tp1984p2178.html
Sent from the CF Dev mailing list archive at Nabble.com.

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.