A bit older of a multi-lingual setup guide, but the principals are the same.
The information below is over a year old, circa mid-2008. Some of the techniques and settings may have changed for TYPO3 4.2 and TYPO3 4.3. I’ll release an update to this in early 2010.
- Website Language Creation
- On the TYPO3 Global page via List mode, add a new Website Language. Take note of the uid of that language. To do so, hover over the Website Language icon after saving and closing to see the uid. You’ll need this for the sys_language_uid setting later on.
- TypoScript Localization by URL or L Parameter
- If you do not have the cbstarter extension installed, put Section A into your main website TypoScript template Setup area. Otherwise, put Section A into your main website TypoScript template Constants area.
- Put Section B into your main website TypoScript template Setup area, below Section A.
- Based upon the URLs or domain names specific to your website and website languages, edit the Section A and Section B config.baseURL and sys_language_uid entries.
- config.locale_all
- Configures the locale which influences how some values from PHP is formated in the output, eg. dates formatted using strftime() which will then output month/day names in that language.
- Refer to the ICU User guide to format the locale_all entry.
- Refer to the ISO 639-2 Code List for the language code.
- Refer to ISO 3166 for the country code.
- config.language
- Configures the system “language key” to be used for the language. This is used to select labels from llXML (locallang-XML) files. Setting this should make frontend plugins respond by showing labels from the correct language (requires installation of the corresponding language packs).
- config.htmlTag_langKey
- Changes “xml:lang” and “lang” attributes in the <html> element.
- UTF-8 Configuration
- If you do not have extension cbstarter installed, put Section C into your main website TypoScript template Setup area. Otherwise, put Section C into your main website TypoScript template Constants area.
- Put Section D into your typo3conf/localconf.php file.
- RealURL Configuration
- Edit your realurl configuration to include a preVars > getVars > L entry.
- See Section E for a sample.
- Click “Clear all caches” for your TYPO3 installation.
- Create localized content
- Basic process
- Create alternative page language record
- Via Web > Page (TemplaVoila), click the “Create localized version” link on each content element you desire localization of.
- Via Web > Page, click the create new content icon, and set the language drop-down.
- Refer to the references for creating content in detail.
- Basic process
Section A – TypoScript Localization by URL
config.baseURL = www.cannonbose.com
# SSL is for cannonbose.com
[globalString = _SERVER|HTTPS=on]
config.baseURL = https://www.cannonbose.com/
[end]
Section B – TypoScript Localization by URL or L Parameter
config {
linkVars = L
uniqueLinkVars = L
sys_language_mode = content_fallback
sys_language_overlay = 1
sys_language_softMergeIfNotBlank = tt_content:image, tt_content:header
sys_language_uid = 0
locale_all = en_US
language = en
htmlTag_langKey = en-us
}
# French
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.locale_all = fr_FR
config.language = fr
config.htmlTag_langKey = fr
# Chinese (Simplified)
[globalVar = GP:L = 2] || [globalString = _SERVER|HTTP_HOST= *.cn]
config.sys_language_uid = 2
config.locale_all = zh_CN
config.language = cn
config.htmlTag_langKey = zh-cn
config.baseURL = www.cannonbose.cn
# Chinese (Traditional)
[globalVar = GP:L = 3] || [globalString = _SERVER|HTTP_HOST= *.tw]
config.sys_language_uid = 3
config.locale_all = zh_TW
config.language = tw
config.htmlTag_langKey = zh-tw
config.baseURL = www.cannonbose.com.tw
[end]
Section C – TypoScript UTF-8 Configuration
config.renderCharset = utf-8
config.metaCharset = utf-8
Section D – localconf.php UTF-8 Configuration
$TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
Section E – realurl.php Sample Configuration
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['preVars'] = array(
array(
'GETvar' => 'L',
'valueMap' => array(
// 'english'
'en' => '0',
// 'french'
'fr' => '1',
// chinese simplified
'cn' => '2',
// 'chinese traditional
'tw' => '3',
),
'noMatch' => 'bypass',
),
);
http://www.acqal.com/blog/a/article/configure-typo3-for-localized-websites/