yamsafer/name-translation 问题修复 & 功能扩展

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

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

yamsafer/name-translation

Composer 安装命令:

composer require yamsafer/name-translation

包简介

package to translate names with one of the two ways 1.Rosette 2.Google Translate

README 文档

README

Transliterate the names in your content, don’t translate.

Getting Started

This package is constructed to allow users to translate names from a source language to a target language with two possible connections (Rosette ,Google Translate).

After downloading the package, you need to set your API KEYs for the previously mentioned connections in the configuration file (config/name-translation.php).

Also, you need to assign them in the test file (tests/NameTranslation/TranslatioTest) if you want to run the used tests in the package.

By default,the translation will be held with the Rosette Connection from English to Arabic.

You can use the main method translate($name, $source, $target), which take three parameters as $name => The given name that you want to translate (must be given) $source => The source language (optional _default = arabic); $target => The source language (optional _default = english).

Prerequisites

The requirements for this package are:

    php: ">=5.6.4",
    illuminate/support: "~5.0"

Also for the tests,you need to have the following in the require-dev:

    "phpunit/phpunit": "5.0.*"

Also, the test configuration includes the code coverage which can be enabled if you have Xdebug in your system. Xdebug can be installed via brew install:

brew install < php-version >-xdebug

eg.

brew install php56-xdebug

Installing

Install the package via composer:

     composer require yamsafer/name-translation

Register the ServiceProvider in config/app.php

    'providers' => [
	// [...]
            NameTranslation\TranslationServiceProvider::class,
    ],

You may also register the NameTranslation Facade:

    'aliases' => [
	// [...]
            'NameTranslation' => NameTranslation\Facades\NameTranslationFacade::class,
    ],

Within your laravel project, when you execute Laravel's vendor:publish command, the configuration will be published.

Run Tests

You can run the tests using the following command under the previously mentioned specifications:

  vendor/bin/phpunit tests/NameTranslation/TranslationTest.php

Within your project you must assign the right directory as:

  vendor/bin/phpunit yamsafer/name-translation/tests/NameTranslation/TranslationTest.php

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 23
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-08-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固