15.22. i18n 国际化

15.22.1. 数组方式

这种方式流行于PHP语言,下面是一个例子

例 15.1. php language package

				
<?php
	$language['hello_world'] = 'hello world !!!'
?>
				
				

15.22.2. 数据库方式

数据库方式包括

  1. 其他非关系型收据库 (Berkeley DB)

  2. 对象/关系型收据库 ORDBMS (mysql)

Berkeley DB 是一个不错的选择,而且相对关系型数据库比较有优势。因为关系型数据库子并发数有限,连接资源很宝贵。

例 15.2. sql table language package

				
select id,key,value from language where country = 'zh-cn' and key = 'hello_world';
				
				

15.22.3. 文件文件

例如.ini文件

			
news=新闻
top10=前十位
			
			

15.22.4. Gettext

The gettext functions implement an NLS (Native Language Support) API which can be used to internationalize your PHP applications. Please see the gettext documentation for your system for a thorough explanation of these functions or view the docs at » http://www.gnu.org/software/gettext/manual/gettext.html.

15.22.5. 数据结构

数据结构方式主要包括

  1. 哈希表 hash table

  2. 类 class

  3. 字典 dict

  4. 图 map

[提示]提示

可能会用到序列化

Please enable JavaScript to view the &lt;a href="https://disqus.com/?ref_noscript"&gt;comments powered by Disqus.&lt;/a&gt;





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值