Multilingual Websites with PHP - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Multilingual Websites with PHP

Description:

There are more than 6800 spoken languages in the world. More than 90% of these are spoken by less than 1 lac, 537 are ... PEAR has a handful of classes for I18N ... – PowerPoint PPT presentation

Number of Views:114
Avg rating:3.0/5.0
Slides: 27
Provided by: foss
Category:

less

Transcript and Presenter's Notes

Title: Multilingual Websites with PHP


1
???????
  • Multilingual Websites with PHP
  • Nirav Mehta
  • Linux Bangalore 2004

2
Session Plan
  • Language basics
  • Unicode and pre-Unicode
  • PHP and Unicode
  • Different Solutions
  • Example Experiences
  • Resources

3
There are more than 6800 spoken languages in the
world
  • More than 90 of these are spoken by less than 1
    lac, 537 are spoken only by 50 people.
  • There are 46 languages that are spoken only by 1
    person.
  • In India alone, we are have more than 20 official
    languages.

4
English is predominant on the Internet, yet a
large demand exists for solutions in other
languages
5
People came up with many interesting solutions to
represent their languages in the computer
ASCII, ISCII
6
Unicode provides globally accepted standards for
encoding all languages / characters
7
Unicode fonts display the actual characters.
8
UTF-8 is a standard to encode Unicode characters
in numbers.
9
PHP does not natively support Unicode, but works
well with UTF-8
10
Approach 1 - Create static websites using UTF-8
encoding in HTML
11
Approach 2 array of strings used in your
application dynamic text display
12
Approach 3 Using tables to store translated text
13
Many permutations of the approaches exist
14
Approach 4 Using gettext method similar to
GNOME
15
PO files are structured text files containing a
msgid and msgstr for the strings in your
application
16
Displaying text is very easy. Using the
underscore function - _(string)
17
How does this work in real life?
  • Gettext example

18
PEAR has a handful of classes for I18N
19
You can detect what languages are supported by
the browser and send appropriate version of
content
20
Accepting input in different languages is easy
21
MySQL can easily support UTF-8 data
22
PHP5 makes it very easy to work with UTF-8
23
There are many Open Source PHP packages with
multilingual support
24
We have used most of these approaches, but find
gettext the best
25
Resources
  • Articles
  • Ready Packages

26
Queries?
  • Thanks!
  • Contact
  • Nirav Mehta
  • nirav_at_magnet-i.com
Write a Comment
User Comments (0)
About PowerShow.com