php-i18n Digest 28 Nov 2003 02:38:11 -0000 Issue 205
Topics (messages 636 through 640):
Multiple Languages
636 by: David Kendal
Re: Japanese katakana "SO" in SJIS gives problems.
637 by: Moriyoshi Koizumi
cant get gettext to work with php
638 by: Merlin
639 by: Christophe Chisogne
new to intenationalization programming
640 by: Ligaya Turmelle
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I am making a WebForum with Multiple Language Support and I'm wondering if
the best way to Store them would be by Variables ($xxxxx = "yyyyy") or
Functions (xxxxx( "yyyy" )).
David
--- End Message ---
--- Begin Message ---
Hi,
Turning off magic_quotes_gpc in your php.ini will fix that problem.
When doing this, be sure to escape any incoming strings that will be
get through to the database as SQL with a function provided by the
extension with which you actually make connection to the database
(e.g. mysql_real_escape_string() or pg_escape_string()) instead of
addslashes(), whose usage is by no means recommended when it comes
to multibyte string. Please refer to the archive for detailed
information about SJIS weirdness, as I already posted something to
the thread of a relevant topic.
Moriyoshi
On 2003/11/19, at 19:27, Jean-Christian IMbeault wrote:
> I'm having trouble with POST form data being passed to me in Japanese.
> The incoming data is in SJIS and if someone enters the japanese
> katakana
> "SO" it somehow ends up being turned up in to "SO\".
>
> Here is an example:
>
> User enters "ソ"
>
> PHP says the POST values is:
>
> POST['name'] = ソ\
>
> Where did that last character come from? This is a big problem for me
> if
> people enter words in katakana containing the character "SO". For
> example "software" gets an extra backslash inserted after the so ...
>
> Does anyone have a safe solution to this problem?
--- End Message ---
--- Begin Message ---
Hi there,
I am trying to get I18n support working on my site. To do this I have
isntalled gettext.
Somehow the translation does not work. I did everything the examples
explained, but I do stillg get en text.
Here is what I did.
1. I creaed a test file:
<?php
// I18N support information here
$language = 'de';
putenv("LANG=$language");
setlocale(LC_ALL, $language);
// Set the text domain as 'messages'
$domain = 'messages';
bindtextdomain($domain, "/home/www/mydocs/x_dev/sprachen/gettext/locale");
textdomain($domain);
echo gettext("A string to be translated would go here");
?>
2. I extracted the text via command line:
xgettext -a test.php
3. I translated it and created a mo file with poedit (editor)
4. I moved the files into a de directory
/locale
/de
/LC_MESSAGES
messages.po
When I load the php file in the browser it still gives me the entlish
language.
Has anybody an idea on what I am doing wrong?
Thank you for any help on that,
Merlin
--- End Message ---
--- Begin Message ---
Your question has been answered, but on the php-general list.
Look at that list archives and below (for a Unix/Linux/BSD srv)
Merlin wrote:
$language = 'de';
Better $language = 'de_DE'; // see php manual
putenv("LANG=$language");
> setlocale(LC_ALL, $language);
This should work better:
putenv("LANG=de_DE");
putenv("LANGUAGE=de_DE"); // better to be paranoid, works for me
putenv("LC_ALL=de_DE");
setlocale(LC_ALL, "de_DE", "german");
(see some user comments in php manual)
When I load the php file in the browser it still gives me the entlish
language.
Then you can try to reload the apache webserver
(because of the gettext cache, which could hide modifications).
"/etc/init.d/apache reload" on a Debian GNU/Linux system.
"/etc/rc.d/httpd reload" on RedHat likes
PS: another possibility is the german locales arent installed correctly
on the unix server. (on a Debian Linux: dpkg-reconfigure locales)
Christophe
--- End Message ---
--- Begin Message ---
Hi I am just starting a project that will have to handle English, Japanese
and Korean characters. I have never programmed for an international group
before and am unsure how to begin. I will be using a HTML(UTF8)/PHP front
end with a MySQL DB in the back. I have read over the information about
multi-byte string functions for PHP on PHP.net and still am very confused
about what I have to do to start using these functions. Also I am confused
about what (if anything) I have to do with the MySQL DB. This seems to be
the only place to go to ask questions. I'm sorry if I ask silly or stupid
questions in the future and ask for your patience.
Can anyone tell me where to go to get information, possibly view code
snippets, or a forum I could join. Where is a good place to start?
--- End Message ---