I’m looking into the possibility of replacing the defunct free Google Translate API with self-hosted Libre Translate.
I integrated the GT API within the webpage, by using a javascript library, and then placing buttons to call the translations of html elements, like this:
<script>
function googleSectionalElementInit() {
new google.translate.SectionalElement({
sectionalNodeClassName: 'goog-trans-section',
controlNodeClassName: 'goog-trans-control',
}, 'google_sectional_element');
}
</script>
and then a button :
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script>
<a href="javascript:void(0)"><span class="goog-trans-control"></span></a>
Ideally, I would like to use Libre Translate in the same way.
I skimmed Libre Translate docs for a bit, but I’m still unsure on how to proceed.
My webserver is a standard LAMP, Ubuntu with PHP, Apache.
I use composer.
First, what are resource requirements ?
Will my small webserver be able to run it ? (volume should be low, below 10 translations/minute)
Then, how to install and get the self-hosted API up and running ?
Is there a javascript library to invoke it in a similar way to google translate ?
Thank you for your help.