承接 panda/l10n 相关项目开发

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

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

panda/l10n

Composer 安装命令:

composer require panda/l10n

包简介

The Panda Localization Package.

README 文档

README

This is the localization package of the Panda Platform. It provides a simple translation structure and process for your code.

StyleCI

Installation

This package is part of the Panda Framework but it's also available as a single package.

Through the composer

Add the following line to your composer.json file:

"panda/l10n": "^2.0"

Usage

The Translation class works using a given FileProcessor for the translation files. It uses the FileProcessor as a getter to get translations.

Each Processor can have its own implementation of handling files based on locale and packages.

Translator

The Translator interface can be used across the entire application. You have to define the application's FileProcessor first and then you can load your translations freely.

Example:

use Panda\Localization\Translation\JsonProcessor;
use Panda\Localization\Translator;

// Initialize the desired processor
$processor = new JsonProcessor('your_base_directory_for_translations');

// Initialize the Translator
$translator = new Translator($processor);

// Get a desired translation
$translation = $translator->translate('translation-key', 'package-name', 'en_US', 'default-translation-value-if-empty');

JsonProcessor

When using the JsonProcessor, the translation files should be in the given structure:

BASE_DIRECTORY/{locale}/{package}.json

If no package name is given (or an empty package name), the 'default' package will be used (default.json).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固