maciejkrol/wikidiki 问题修复 & 功能扩展

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

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

maciejkrol/wikidiki

Composer 安装命令:

composer require maciejkrol/wikidiki

包简介

WikiDiki lets you translate words (mostly nouns) across multiple languages based on wikipedia.org

README 文档

README

WikiDiki uses Wikipedia to translate words across multiple languages.

Installation

Total Downloads

You can install the library using composer.

composer require maciejkrol/wikidiki

Basic usage

WikiDiki usage is super simple.

//instantiate
$wikidiki = new \maciejkrol\wikidiki\wikidiki ();

When translating you must tell WikiDiki what is the base language. English in this case. WikiDiki uses ISO two letter language codes.

This way you will get all the available translations as an associative array with the language codes as keys.

$word       =   'Tea';
$language   =   'en';

$translated = $wikidiki->translate($word, $language);   //array

You can also provide a third argument, a string with a single language code to get a single translated string.

$word       =   'Tea';
$language   =   'en';
$to         =   'pl';

$translated = $wikidiki->translate($word, $language, $to);   //string

or an array to retrieve an array of translations.

$word       =   'Tea';
$language   =   'en';
$to         =   ['pl', 'it'];

$translated = $wikidiki->translate($word, $language, $to);   //array

In case WikiDiki can't find a translation null will be returned;

From now on you can get search suggestions:

$word       =   'Tea';
$language   =   'en';

$translated = $wikidiki->suggest($word, $language, $to);   //array

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固