php l10n,国际化 (i18n) 与本地化 (l10n) - PHP 编程之道

本文介绍了国际化(i18n)和本地化(l10n)的概念,前者是使代码能够适应不同语言和地区,通常在项目初期进行;后者涉及界面翻译,随着新语言支持和界面更新而进行。复数化(plurals)则指处理不同语言中复数形式的规则,如英语的单数和复数,以及某些语言的更多复数形式。
摘要由CSDN通过智能技术生成

Disclaimer for newcomers: i18n and l10n are numeronyms, a kind of abbreviation where numbers are used to shorten words – in our case, internationalization becomes i18n and localization, l10n.

首先,我们需要为这两个相似的概念以及相关的概念下定义:

Internationalization is when you organize your code so it can be adapted to different languages or regions without refactorings. This is usually done once – preferably, in the beginning of the project, or else you’ll probably need some huge changes in the source!

Localization happens when you adapt the interface (mainly) by translating contents, based on the i18n work done before. It usually is done every time a new language or region needs support and is updated when new interface pieces are added, as they need to be available in all supported languages.

Pluralization defines the rules needed between different languages to interoperate strings containing numbers and counters. For instance, in English when you have only one item, it’s singular, and anything different from that is called plural; plural in this language is indicated by adding an S after some words, and sometimes changes parts of it. In other languages, such as Russian or Serbian, there are two plural forms in addition to the singular – you may even find languages with a total of four, five or six forms, such as Slovenian, Irish or Arabic.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值