系统导航

下载中心 imag1

下载中心


多语言内容管理 xlanguage 2.03



 描述:
xlanguage 2.03 bugfix:
1 "input" parse improvement, reported by irmtfan @ xoops.org


xlanguage 2.02 bugfix for XSS vulnerability
Thanks domifara @ dev.xoops.org


xlanguage 2.01 bugfix for non existing language

xlangauge 2.0
An eXtensible Multi-language content and character encoding Management Module+Hack

Multilanguage management handles displaying contents of different languages, like English, French and Chinese

Character encoding management handles contents of different encoding sets for one language, like GB2312 (Chinese Simplified) and BIG5 (Chinese Traditional) for Chinese.


What xlanguage CAN do:
1 displaying content of specified language based on user's dynamic choice
2 converting content from one character encoding set to another


What xlanguage canNOT do:
1 xlanguage does NOT have the ability of translating content from one language to another one. You have to input contents of various languages by yourself
2 xlanguage does NOT work without adding one line to XOOPS/include/common.php (see guide below)
3 xlanguage does NOT have the ability of converting content from one character encoding to another if none of "iconv", "mb_string" or "xconv" is available.


Features:
1 auto-detection of visitor's language on his first visitor
2 memorizing users' langauge preferences
3 switching contents of different languges/encoding sets on-fly
4 supporting M-S-M mode for character encoding handler
5 multilanguage contents can be set anywhere on your site, through XOOPS modules, blocks or even themes


Note:
M-S-M: Multiple encoding input, Single encoding storage, Multiple encoding output.
M-S-M allows one site to fit various users with different language character encoding usages.
For example, a site having xlanguage implemented porperly allows users to input content either with GB2312, with BIG5 or UTF-8 encoding and to store the content into DB with specified encoding, for say GB2312, and to display the content either with GB2312, with BIG5 or with UTF-8 encoding.

User guide:
1 upload "xlanguage" folder to XOOPS/modules/

2 insert one line
	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 and extended languages from xlanguage's module preference page

4 make the block "langauge selection" visible through system=>block

5 if you use the encoding conversion management only, for instance, switching Schinese and Tchinese, congratulations, you have made it!

6 if you use multi-language contents management, add content with corresponding tags to your content management modules:
[languagecode]Content of the language[/languagecode]
languagecode should be the "language code" of each ___base___ language configured in module admin area, can be for one single language or multiple languages, example:
[en]Thank you, XOOPS[/en][fr]Merci, XOOPS[/fr][zh]谢谢你, XOOPS[/zh]

OR:
[en|fr]Thank you, Merci [/en|fr][zh]谢谢你[/zh]

You should not use the tag of "schinese" and "tchinese" together since the content will be converted from one to the other automatically using iconv, mbsting or xconv according to your system configure.

7 xconv module is suggested to Chinese users (module available at http://xoops.org.cn)


Credits:
1 Adi Chiributa - [email protected], language handler
2 wjue - http://www.wjue.org, ziling BIG5-GB2312 conversion
3 GIJOE - http://www.peak.ne.jp, easiest multilanguage hack



"language auto-detection" with xlanguage, adapted from phpmyadmin, allows your XOOPS select a language for a visitor according his browser preferences on his first visit to your site.
For example, the first language I set in my Firefox is S Chinese, then English, French. And you have xlanguage installed and set "french", "english" as basic languages. As a result of language auto-detection, the language to be used is "english" (since my first priority "Schinese" is not available on your site and your first set "french" is with a lower priority in my list).

However, some webmasters do not like the "autodetection" and wanna force $xoopsConfig["language"] as all users' first choice (mowaffa is among such webmasters :=)).
In this case, you need change
xlanguage/api.php
line 38 - 48
if (!empty($_GET[XLANGUAGE_LANG_TAG])) {
	$cookie_path = "/";
	setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0);
	$xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG];
} elseif (isset($_COOKIE[$cookie_var])) {
	$xlanguage["lang"] = $_COOKIE[$cookie_var];
//}elseif($lang = xlanguage_detectLang())	{
//	$xlanguage["lang"] = $lang;
}else{
	$xlanguage["lang"] = $xoopsConfig['language'];
}


提交者: D.J.
发布者: D.J.
提交日期: Tue, 21-Jun-2005

版本: 2.03
下载次数: 1733
文件大小: 49.98 KB
镜像网站: 未指明

评分:   (0 个投票)

点评:  (0)

下载时间估计:
Modem(56k) : 8s
ISDN(64k) : 7s
DSL(768k) : 0.59s
LAN(10M) : 0.05s


 

打印模式描述

价格: 免费 | 支持平台:  | 许可: GNU General Public License (GPL) (v. 2.0) | 限制: 未指明

XOOPS China 用户点评

其他文件: D.J.
XOOPS uploader 安全更新 (Mon, 01-Oct-2007)
Frameworks 1.20 for XOOPS (Mon, 27-Aug-2007)
XOOPS 2.0.17 简体中文版 (Mon, 27-Aug-2007)
phpMyadmin 2.10 (Thu, 12-Apr-2007)
Tag 模块 1.60 发布 (Thu, 04-Jan-2007)
dokuwiki 2.02 发布 (Thu, 04-Jan-2007)
CBB 3.08 论坛模块发布 (Wed, 03-Jan-2007)
Tag 模块 1.50 发布 (Fri, 01-Dec-2006)

多语言内容管理 xlanguage 2.03 © 版权所有 2008 XOOPS China

网友个人意见,不代表本站立场。对于发言内容,由发表者自负责任。
发表者 树状展开
D.J.
发表日期: 06月27日 18:52  更新: 06月27日 18:52
网站管理员
注册日期: 06月25日
来自:
发表总数: 5886
 Re: 多语言内容管理 xlanguage 2.0