php-google-translator
Php wrapper for google javascript translator website plugin. It will create a dropdown option for languages.

Installation
Installation is super-easy via Composer:
composer require peterujah/php-google-translator
USAGES
use Peterujah\NanoBlock\GTranslator;
$translate = new GTranslator("en", "/assets/flags/");
set selector design provider, you can choose between DEFAULT
style and BOOTSTRAP.
The DEFAULT
is the default provider
$this->setProvider(GTranslator::DEFAULT || GTranslator::BOOTSTRAP);
Set the fag icon type, PNG
or SVG
to use icons download country flag icon and set the Relative or Absolute path
$translate->setIconType(GTranslator::PNG || GTranslator::SVG);
$translate->setIconPath("https://foo.com/assets/flags/");
Add additional langues
$translate->addLanguage("en", "English")->addLanguage("ig", "Igbo");
Load languages
$translate->setLanguages([
"en" => "English",
"ig" => "Igbo"
])
Full usage on website to translate webpage
<?php
use Peterujah\NanoBlock\GTranslator;
$translate = new GTranslator("en", "/assets/flags/");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHP Google Translator</title>
</head>
<body>
<div class="button">
<?php $translate->button();?>
</div>
<div class="content">
<h2>We have a long history of service in the Bay Area</h2>
<p>
We were one of the first credit unions that operate world wide, founded in 1932 as City & County Employees' Credit Union.
Membership is now open to anyone who lives, works, or attends school in
Alameda, Contra Costa, San Joaquin, Solano, Stanislaus, or Kings counties in California.
We believe in banking locally and hope you will too.
</p>
</div>
<?php $translate->load();?>
</body>
</html>