Does anyone knows where i can get a tutorial to learn how to create a multilingual site?
Thank you.
Selecting a Language in a Site
Moderator: General Moderators
-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Have a look at gettext php extension there are tutorials about that and at least one on, the excellent, sitepoint. There are many other issues concerning multi language sites. I believe PEAR and the Zend Framework have a bunch of tools for managing other issues such as those to do with dates and times. UTF-8 support for all unicode characters is quite useful but a bit of a hassle in PHP.
If you are only serving static pages Apache's content negotiation may be of interest, you can probably recreate it's behaviour in pretty easily PHP.
Final note: we tend to be more helpful on specific issues.
If you are only serving static pages Apache's content negotiation may be of interest, you can probably recreate it's behaviour in pretty easily PHP.
Final note: we tend to be more helpful on specific issues.
language files
i just read a little on gettext and I jave no idea of what it does. I know I have done site with spanish and english in a very simple manner.
I created a directory called languages. There I have en.php and spa.php
inside you will see something like
In every page you will use the variable defined on the language files instead of the word
Use a session to keep track of which language the user wants.
Simple but effective.
I created a directory called languages. There I have en.php and spa.php
inside you will see something like
Code: Select all
en.php
$dog_la = 'dog';
$cat_la = 'cat';
spa.php
$cat_la = 'gato';
$dog_la = 'perro';
you get the idea.Use a session to keep track of which language the user wants.
Code: Select all
include 'languages/' . $_SESSION['language'] . '.php';-
matteoraggi
- Forum Newbie
- Posts: 2
- Joined: Sun Feb 03, 2008 3:42 pm
- Location: Italy
- Contact:
Re: Selecting a Language in a Site
what about if someone want to translate not only simple text but categories and subcategories, for example here:
http://www.hotel-supplies.biz
I desire to translate it also in italian language: http://www.forniture-alberghiere.net and german: http://hotelbedarf.biz
which is the best way to do this work for me?
I just not have any multi-language script in this moment installed..
http://www.hotel-supplies.biz
I desire to translate it also in italian language: http://www.forniture-alberghiere.net and german: http://hotelbedarf.biz
which is the best way to do this work for me?
I just not have any multi-language script in this moment installed..