定制 kasseler/gettext 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kasseler/gettext

最新稳定版本:1.0.1

Composer 安装命令:

composer require kasseler/gettext

包简介

Gettext library

README 文档

README

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

Gettext *.mo files reader for PHP. Original package https://launchpad.net/php-gettext

Requirements

  • PHP >= 5.3

Installation

$ composer require kasseler/config

Introduction

How many times did you look for a good translation tool, and found out that gettext is best for the job? Many times. How many times did you try to use gettext in PHP, but failed miserably, because either your hosting provider didn't support it, or the server didn't have adequate locale? Many times. Well, this is a solution to your needs. It allows using gettext tools for managing translations, yet it doesn't require gettext library at all. It parses generated MO files directly, and thus might be a bit slower than the (maybe provided) gettext library. PHP-gettext is a simple reader for GNU gettext MO files. Those are binary containers for translations, produced by GNU msgfmt.

Usage

To force the use of the class, you must install define:

define('GETTEXT_CLASS', true);

You must use the initialization function:

//                    filename   locale   charset
init_translate_domain('message', 'fr',    'UTF-8',  'path_to_locales_dir');

Native

echo gettext('Add');
echo ngettext('Minute', 'Minutes', 2);

Usage class

echo _gettext('Add');
echo _ngettext('Minute', 'Minutes', 2);

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL
  • 更新时间: 2015-03-25