This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-- install nedded packages | |
sudo apt-get update | |
sudo apt-get install -y libgbm1 libasound2 libxkbcommon0 libgtk-3-0 libnss3 libx11-xcb1 | |
#-- download google chrome | |
wget -q https://storage.googleapis.com/chrome-for-testing-public/140.0.7339.127/linux64/chrome-linux64.zip -O /tmp/chrome.zip | |
sudo unzip /tmp/chrome.zip -d /opt/ | |
sudo rm /tmp/chrome.zip | |
sudo ln -sf /opt/chrome-linux64/chrome /usr/bin/google-chrome |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function translate($source, $target, $text) { | |
$url = "https://translate.google.com/translate_a/single?client=at&dt=t&dt=ld&dt=qca&dt=rm&dt=bd&dj=1&hl=es-ES&ie=UTF-8&oe=UTF-8&inputm=2&otf=2&iid=1dd3b944-fa62-4b55-b330-74909a99969e"; | |
$fields = array( | |
'sl'=>urlencode($source), | |
'tl'=>urlencode($target), | |
'q'=>urlencode($text) | |
); | |
$fields_string = ""; | |
foreach ($fields as $key => $value) { | |
$fields_string .= $key . '=' . $value . '&'; |