Create a Localized Web Page with PHP | Linux Today

Create a Localized Web Page with PHP

Written By
Web Webster
Web Webster
Oct 22, 2010

“The process of making your applications/websites usable in many
different locales is called internationalization, While customizing
your code for different locales is called localization.
Localization is the process of making your applications or websites
local to where it is being viewed. For example, you can make a
website more local to a particular place by converting its text to
the predominate language of that location and by displaying the
local time (e.g. German for people living in Germany or French for
people living in France).

“Yahoo and Google have examples of localized sites: Google.com
(US), Google.co.uk (UK), Yahoo.jp (Japan) and so forth. Creating a
Web site that is useful to speakers of different languages is a
breeze using PHP. In this article, we look at how to create a
localized welcome page that uses PHP to enable a user to select a
target language and then receive the appropriate text. An example
of externalizing the strings used in this script — one of the
characteristics of internationalization — will also be
provided.

“The Structure of a Localized Web Page

“In this example, the user will choose one of three languages
and the website will then display a welcome message in the chosen
language. Because we want the welcome page to be locale specific,
we need to find a way to send information to the welcome page that
will tell it what language to use and how to render the text. Thus,
we need three things:”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.