473,472 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Freebsd locales (gettext)

Hi,

I have problems implementing i18n on my site hosted on a FreeBSD
server. While it was hosted on a Linux server, there were no problems,
but once I transferred it to FreeBSD, gettext() doesn't translate
anything. Here's my directory structure:

public_html
|-- index.php
`-- locale
|-- en_US.ISO8859-1
| `-- LC_MESSAGES
| |-- OOModelProvider.mo
| `-- OOModelProvider.po
`-- sr_YU.ISO8859-2
`-- LC_MESSAGES
|-- OOModelProvider.mo
`-- OOModelProvider.po

And here's the function that calls php locale-related functions:
/* domain is "OOModelProvider", language is "en_US.ISO8859-2"
*/
function setLocale( $language, $domain )
{
@bindtextdomain( $domain, "/home/darko/public_html/
locale/" );
@bind_textdomain_codeset( $domain, "utf-8" );

if ( ! @setlocale( LC_MESSAGES, $language ) )
throw new Exception( "setlocale" );
textdomain( $domain );
}

This worked perfectly on Linux, but it doesn't work with FreeBSD. I
read somewhere that libintl needs to be installed for LC_MESSAGES, but
1. it is installed 2. LC_ALL instead of LC_MESSAGES doesn't work
neither.

Another important note: LC_DATE works, i.e. sprintf and strftime
(which are locale-aware) work as expected, that is, they print the
strings in expected languages.

Also, after I do setlocale(LC_MESSAGES, $language), I call it with "0"
as the second argument and it returns the correct locale set.

Please, if you have any ideas, post them here.

Thanks.

Oct 26 '07 #1
0 1986

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Daniel CAUSSE | last post by:
Hello, I'm testing gettext on my website but it doesn't work. phpinfo returns correct informations: configure command => '--with-gettext=/usr' GetText Support => enabled I have no problem...
1
by: Dave Patton | last post by:
Can someone point me to a definitive source for the answers to the following two questions: 1) In an environment with Redhat Linux 2.4.21-27.0.1, Apache 1.3.31, PHP 4.3.10, and GNU gettext...
14
by: Pierre Rouleau | last post by:
I have a problem writing self-testable modules using doctest when these modules have internationalized strings using gettext _('...'). - The main module of an application (say app.py) calls...
1
by: Terry Hancock | last post by:
I'm looking at the gettext module for the first time and learning how to write internationalized code in Python. Naturally, I also looked at the original Gnu gettext manual, which mentions that...
13
by: cantabile | last post by:
Hi, I'm failing to make it work but can't find out what's wrong. Here's what I do : ================ test.py import gettext gettext.install('')
2
by: Darko | last post by:
Hi, by definition, strftime() uses the previous setlocale() calls to determine which language to use in returning strings such as week days or month names, depending on the given format. Now,...
1
by: James T. Dennis | last post by:
You'd think that using things like gettext would be easy. Superficially it seems well documented in the Library Reference(*). However, it can be surprisingly difficult to get the external details...
6
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
I've encountered a problem using gettext with properties while using a Python interpreter. Here's a simple program that illustrate the problem. ============== # i18n_test.py: test of gettext &...
2
by: paolob | last post by:
Hi to all, I'm running php 5.2.5 on Debian etch, with apache 2.0.56. I need to include, in php.ini, gettext.so library but I didn't find anything. I've already install: apt-get install gettext...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.