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


Mike Dalessio
 

I'm actually open to adding commonly-used locales to the rootfs; though
that wouldn't help anyone until they're able to upgrade.

I'd like to propose that we install the debian package `locales`, which
looks like it includes support for 311 locales and 232 charmaps. It's only
about 10MB installed (according to http://packages.ubuntu.com/trusty/locales
).

Objections? Tracker story is here:
https://www.pivotaltracker.com/story/show/106641954

On Fri, Oct 23, 2015 at 8:44 PM, Daniel Mikusa <dmikusa(a)pivotal.io> wrote:

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.