Re: Multi Lingual Sites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am currently working on a multilingual app, so i thaught i could share
some of the knowledge i have accumulated on the subject in the last months,

After a lot of searching and testing i ended up using the following
configuration:

A full unicode (UTF-8) environment


PHP 5 OOP + a template engine -->always seperate html from coding,

- use the mb_string extension (best way is to overload string functions with
mb in php_ini with mbstring.func_overload = 7) set internal encoding to
utf-8
- disable automatic sending of content-type header from php (php.ini)
- in your html templates add this meta <meta http-equiv="Content-Type"
content="text/html; charset=UTF-8"> and whatever attribute you need to your
<html> element (lang, dir)
- add "accept-charset=utf-8" attribute to your <form> elements to make them
only accept utf-8 text

- One important thing to remember, is that php has no problem manipulating
Multibyte strings (like utf-8) through mb_string but php scripts have to be
written in latin1 --> always pay attention to strings you might use in your
scripts (EX: translate Error messages to their html equivalent, or load them
from a file...)

- seperating html from php: this is particularly usefull when it comes to
developing stuff for many possible languages, To introduce a new language,
all you need to do is to customize a set of plain html template files to the
new language et voila!

Finally, use the new mysqli extention to connect to mysql 4.1




Mysql 4.1 --> configured with --default-character-set=utf8, when you connect
to the server always send this query first : "SET names=UTF8" to make php's
mysqli extention use UTF8 for connection

------------------------------------------------

Using this approach gives you all the advantages of unicode (language
independance....) and mysql ( fulltext searching....) and the flexibily of
php


Hope it helps


Regards;

Hassan El Forkani
http://www.InfoChallenge.com


----- Original Message -----
From: "Jeff Bennett" <JBennett@Earthling.net>
To: <php-objects@yahoogroups.com>
Sent: Wednesday, October 13, 2004 12:21 AM
Subject: Re:  Multi Lingual Sites


>
> >Do I need to make any other considerations?
>
>
> Money, date, and number formats if there are any variables that display
> these things.
>
> good luck.
>
> -jmb
>
>
>
>
> PHP Data object relational mapping generator -
http://www.meta-language.net/
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux