Skip to content

Translation module for Kohana framework 3.3. Auto translate, detect language.

Notifications You must be signed in to change notification settings

WinterSilence/kohana-translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Translation module for Kohana framework 3.3

Auto translate, detect language. API offers text translation function for more than 20 language pairs.

Uses Yandex API http://api.yandex.ru/translate/ . Terms of use http://legal.yandex.ru/translate_api/ .

Current version can:

  • Translate text and html
  • Detect text and html language
  • Translated languages list
  • Translate direction list
  • Cached requests to API
Planned add:
  • Translate i18n/messages files
  • Update and expand caching
  • Support others translation services

Setup:

To use, download the source, extract and rename to translation. Move that folder into your modules directory, activate in your bootstrap, set Translation::$key - http://api.yandex.ru/key/form.xml?service=trnsl and Translation::$certificate - path to certificate *.crt file (certificate chain in the format pem).

Usage:

Configure:

Translation::$key = 'trnsl.1 .. 32';
Translation::$certificate = APPPATH.'YandexTranslate.crt';

Translation::$to = 'fr';
Translation::$from = 'en';

Translate:

$i18n = Kohana::load('... i18n/ru.php');
$i18n = Translation::translate($i18n, 'ru', 'en', TRUE);

Language detect:

echo Translation::detect('тест тост', TRUE);

Translate direction:

$dirs = Translation::direction();

Translated language list:

$langs = Translation::langs('ru');

About

Translation module for Kohana framework 3.3. Auto translate, detect language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages