承接 g4/translate 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

g4/translate

最新稳定版本:1.0.0

Composer 安装命令:

composer require g4/translate

包简介

g4 i18n php library

README 文档

README

  • Configuration of the gettext extension
  • Utlity tool to generate .mo files
  • Utility tool for extracting template strings

Install

Using Composer and Packagist

composer require g4/translate

Resources

Requirements

Usage

Set locale early in the program before rendering any internationalized template.

use G4\Translate\Locale\Locale;
use G4\Translate\Locale\Options;

$options = new Options();
$options
    ->setDomain('myDomain')
    ->setLocale('en_US')
    ->setPath('/path/to/locale/files');
(new Locale($options))->set();

Command line interface

Convert .po files to .mo

./vendor/bin/translate --path /path/to/locale/files

where --path is path to your locale folder

Extract template strings

./vendor/bin/translate-extract -t /path/to/templates -w /path/to/tmp -g /path/to/locale/files -d myDomain

where:

  • -t is path to folder that contains templates
  • -w is path to temp folder
  • -g is path to folder where myDomain.po file with strings will be generated
  • -d domain name

Development

Install dependencies

$ make install

Run tests

$ make test

License

(The MIT License) see LICENSE file for details...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-24