Skip to content

atk14/LiveTranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveTranslator

Installation

cd path/to/your/project/
composer require atk14/live-translator

ln -s ../../../vendor/atk14/live-translator/src/app/forms/api/live_translator app/forms/api/
ln -s ../../../vendor/atk14/live-translator/src/app/controllers/api/live_translator_controller.php app/controllers/api/

Edit gulpfile-admin.js and add live_translator.js to vendorScripts

var vendorScripts = [
  ...
  "vendor/atk14/live-translator/src/public/scripts/utils/live_translator.js"
];

TODO: Describe changes in app/forms/admin/admin_form.php

Configuration

By default LiveTranslator is using Google API. If translation using DeepL.com is required, the following two constants must be defined:

define("LIVE_TRANSLATOR_DEEPL_API_AUTH_KEY","34567012-9a78-debc-f012-789abc456de0:fx");
define("LIVE_TRANSLATOR_DEEPL_API_PRO",false); // true or false

Source language

Source language for translation is taken automatically from the lang attribute in <htm> element (e.g. <html lang="cs">).

In attribute data-live_translator_source_lang the other source language can be specified implicitly (e.g. <html lang="cs" data-live_translator_source_lang="en">).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •