redcatphp/localize 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

redcatphp/localize

最新稳定版本:v1.5

Composer 安装命令:

composer require redcatphp/localize

包简介

Localize - Internationalization Toolbox with Gettext wrapper, Extractors, Unicode Common Locale Data Repository

README 文档

README

No longer actively maintained. I work now with NodeJS and I recommand you to take a look at globalize

Localize

Localize is an internationalization toolbox with Gettext wrapper, Extractors, Unicode CLDR.
and some internationalization ISO codes.

Gettext wrapper

Translator and GettextEmulator are RedCat's OOP adapation of php-gettext library.
This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.
The structure of locales is $projectHome/langs/$lang/LC_MESSAGES/messages.mo, eg: www/langs/fr/LC_MESSAGES/messages.mo. It support cache regeneration without restart apache by dint of use a copy of MO file named with timestamp suffix. To enable look for last message.$time.mo set dev to true. You'll have to create this file manualy or with other i18n tool.

Translator::getInstance()->dev = true;  
            

You can include "__.php" to use procedural function based on RedCat\Localize\Translator static current instance.

echo \_\_($msgid);  
echo n\_\_($singular,$plural,$number);  
            

CLDR - Punic

Punic - PHP translation and localization made easy. It contain internationalization data for language, calendar, territory, number, unit, phone, currency, plural and misc. Punic is a third party CLDR. library. See the official Punic documentation.

统计信息

  • 总下载量: 745
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-11-04