承接 devture/silex-translation-bundle 相关项目开发

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

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

devture/silex-translation-bundle

Composer 安装命令:

composer require devture/silex-translation-bundle

包简介

Silex bundle that allows .json files to be translated between multiple languages.

README 文档

README

Finds all {sourceLanguage}.json files (example: en.json) in a given base directory (base_path) and allows these files to be translated to all given languages (locales).

A {targetLanguage}.json file is generated and saved next to {sourceLanguage}.json for each locale, whenever the translations for it are saved.

A {targetLanguage}.json.hash file is also saved in the same directory. It contains "hints" telling the translation system which source translation string a given translation is derived from. This is so that a translation can be considered outdated if the source translation string changes. At this moment, such outdated translations are considered new and untranslated.

Installation

Permissions

Since the translation system needs to save translation files in the project, we need to grant file-writing privileges to the web server user.

Example:

$ find /srv/http/my-project/src -type d -name translations | xargs chown :http
$ find /srv/http/my-project/src -type d -name translations | xargs chmod g+w

Configuration

TranslationBundle config:

"TranslationBundle": {
	"source_language_locale_key": "en",
	"base_path": "%app_base_path%",
	"locales": "%locales%"
}

TranslationBundle config example:

"TranslationBundle": {
	"source_language_locale_key": "en",
	"base_path": "/srv/http/my-project/src",
	"locales": {
		"en": {"key": "en", "name": "English"},
		"bg": {"key": "bg", "name": "Bulgarian"},
		"ja": {"key": "ja", "name": "Japanese"}
	}
}

Initialization

Only set-up during debug to protect the production environment:

if ($app['debug']) {
	$app->register(new \Devture\Bundle\TranslationBundle\ServicesProvider('devture_translation', $app['config']['TranslationBundle']));
	$app->mount('/admin/{locale}/translation/', $app['devture_translation.controllers_provider.management']);
	$app['devture_user.access_control']->requireRoleForRoutePrefix('devture_translation.', 'devture_translation');
}

The main route would be devture_translation.manage (assuming the devture_translation namespace was used, as done above).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD
  • 更新时间: 2017-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固