Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Download Elxis CMS:
Elxis 5.5 Hermes
.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Elxis 2008 developers guide
»
Translate content using build-in translator class
« previous
next »
Print
Pages: [
1
]
Author
Topic: Translate content using build-in translator class (Read 20961 times)
datahell
Elxis Team
Hero Member
Posts: 10356
Translate content using build-in translator class
«
on:
March 21, 2007, 21:10:22 »
Elxis has build-in automatically translation support via the
Translator
class. Translator class provides 2 methods of translation from different internet sources. A method ideal for small text strings and a method ideal for large texts. We wont explain here how the translator class works but we will give usage examples inorder to use it in your own modules, components etc (Only for Elxis CMS! See notice at the end).
Usage example 1
Translation of large texts
//include the translator class (we call the script from backend)
require_once( 'includes/translator.class.php' );
//initialize translator
$trans= new translator ( $text, $fromto );
where
$text
the text we want to translate and
$fromto
the languages pair. Example of language pair:
en_fr
(from English to French)
$translated_text = $trans->translate();
That's it!
$translated_text
contains our translated text. We can then save it to the database, display it to the user, etc.
Usage example 2
Translation of small text strings (ie item titles)
$trans = new translator ( $text, $fromto, true );
$translated_text = $trans->translateLite();
Finish. Easy enough?
Notice that Elxis translator preserves the text format, images etc!
Supported language pairs
zt_en', 'en_zh', 'en_zt', 'en_nl', 'en_fr', 'en_de', 'en_el', 'en_it','en_ja','en_ko', 'en_pt', 'en_ru','en_es', 'nl_en', 'nl_fr', 'fr_en', 'fr_de', 'fr_el', 'fr_it', 'fr_pt', 'fr_nl', 'fr_es', 'de_en', 'de_fr', 'el_en', 'el_fr', 'it_en', 'it_fr', 'ja_en', 'ko_en', 'pt_en', 'pt_fr', 'ru_en', 'es_en', 'es_fr
* Note: The
Translator Class
is copyrighted by me (Ioannis Sannos). Contact me if you want a licence to use it in other than Elxis applications or in commercial products.
«
Last Edit: March 21, 2007, 21:21:46 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Elxis 2008 developers guide
»
Translate content using build-in translator class