Modules: Xlanguage 2.04 - Xoops Multilingual Content and Encoding Management

Posted by: phpppOn 2005/7/25 14:44:39 15345 reads
xlanguage, eXtensible Xoops Multilingual Content and Encoding Management, is the easiest but most powerful XOOPS multilingual content management plugin

Download & DOC
--------------
https://xoops.org.cn/modules/wfdownloads/singlefile.php?lid=314&cid=8


Applicable
---------
Any version of XOOPS and any version of any MODULE with any THEME

Easy to use
-----------
1 All you need do is to insert ONLY ONE LINE into common.php and install "xlanguage"
2 Do NOT need to modify/hack any other XOOPS core files or any module


Powerful enough to meet your requirements
-----------------------------------------
1 Could handle as many languages of content as you want
2 Could handle different charset of a selected language
3 Could handle multilingual content anywhere on your site, in a module, a php file, an html page or a theme's hardcoded content
4 Compatible with content cache
5 Automatic detection of user browser's language preference




User guide
----------
1 install "xlanguage" as a regular module

2 insert one line
Quote:

include_once XOOPS_ROOT_PATH.'/modules/xlanguage/api.php';

into XOOPS/include/common.php
RIGHT BEFORE
// #################### Include site-wide lang file ##################
if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php") ) {
include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php";
} else {
include_once XOOPS_ROOT_PATH."/language/english/global.php";
}


3 add basic langauges (from an available language list) and extended languages(of a selected basic language) from module admin page
Quote:

base 1: name: english; description(optional): English; charset: iso-8859-1; code: en (or anyother like "xen", not a true language code, just the tag for indicating English content)

base 2: name: schinese; description(optional): Simplified Chinese; charset: gb2312; code: zh (or anyother like "sc", not a true language code, just the tag for indicating Chinese content)

extended lang of schinese 1: name: tchinese; description(optional): Traditional Chinese; charset: big5 code: zh-TW (the true language code of Traditional Chinese)

extended lang of schinese 2: name: utf8; description(optional): Simplified Chinese UTF-8; charset: utf-8 code: zh-CN (the true language code of Simplified Chinese)


4 make the block "language selection" visible

5 add multilingual content with according tags sepcified for each base language (in step 3) [Skip this step if you do not use multi-language content display but only use charset encoding]:
Quote:

wrap content of each language with respective tag specified in step 3:

[langcode1]Content of the language1[/langcode1] [langcode2]Content of the language2[/langcode2] [langcode3]Content of the language3[/langcode3] ...

if two or more languages have same content, you do not need add them one by one but use delimiter "|":
[langcode1|langcode2]Content shared by language1&2[/langcode1|langcode2] [langcode3]Content of the language3[/langcode3] ...

a true example (suppose the lang_codes specified in step 3 are: English-en; French-fr; SimplifiedChiense-sc):

[en]My XOOPS[/en][fr]Moi XOOPS[/fr][sc]我的XOOPS[/sc]

OR:
[en|fr]This is my content in English and French[/en|fr][sc]中文内容[/sc]


6 automatic conversion of content from one charset(extended language) to another [Actually on action needed in this step]


Credits
-------
1 Adi Chiributa - webmaster@artistic.ro, language handler
2 wjue - http://www.wjue.org, ziling BIG5-GB2312 conversion
3 GIJOE - http://www.peak.ne.jp, easiest multilanguage hack

Author
------
D.J. (phppp)
https://xoops.org.cn