Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- use Stichoza\GoogleTranslate\GoogleTranslate;
- function translate()
- {
- $CI =& get_instance();
- $text = $CI->output->get_output();
- $text = trim($text);
- $translate = new GoogleTranslate();
- $output = $translate->setSource('id')->setTarget('en')->translate($text);
- $output = trim($output);
- $CI->output->set_output($output);
- $CI->output->_display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement