The Google Translate
There is in the base of the goods with the description.
They have such parameters:
title, h1, meta_description and text.
You need to create a page on which the data from the database is uploaded and automatically translated from Russian to Ukrainian. It also adds the possibility of changing language, from both sides.
We are going to integrate this code to ourselves in the admin.
-
2335 37 0 Your Google Translate API
$key = 'YOUR_API_KEY'
Function for translation of text
function translate($text, $source, $target) {
the global $key;
$url = 'https://translation.googleapis.com/language/translate/v2?key=' .The Key;
$data = array(
‘q’ = $text,
… ‘source’ = $source
‘target’ = $target
and the
$options = array(
‘HTTP’ = array(
'header' => 'Content-type: application/x-www-form-urlencoded',
‘method’ = ‘post’
'content' => http_build_query ($data)
and
and the
$context = stream_context_create ($options)
$result = file_get_contents ($url, false, $context)
if ($result === false) {
The return false.
The
$result = json_decode ($result, true)
if (!isset($result['data']['translations'][0]['translatedText'])) {
The return false.
The
return $result['data']['translations'][0]['translatedText']
The
Examples of use
$text = ‘Hello, world!‘;
$source = ‘en’;
$target = ‘uk’
$translation = translate ($text, $source, $target)
echo $translation; // will release "Hello, the world!"
-
142 9 3 1 Good day .
I realize throughout the day. You have access to the API translate. to turn.
-
1848 43 0 I just finished a project like that.
HTTPS://freelancehunt.com/project/napisat-skript-dlya-perevoda-tekstov-iz/1166195.html
Turn to!
-
4751 66 0 Good day ! I can integrate it immediately to the admin or as you want. WEB for what?
-
283 6 1 At present, the app is not supported by Google (this means receiving the key). But I have my own carpet that translates pages. We can talk. The two days indicated are for any case if unpredictable overwhelming occurs.
-
4302 215 0 1 Good morning, I worked with the API translate, ready to perform. Write to the page and discuss the details.
-
2110 71 0 Good day . I've done such a translator, please write details in the message.
Do you need all the languages that supports Google Translate?
Current freelance projects in the category PHP
Developer for CMS website project on Drupal 7 + PHP/MySQL.We are looking for a developer to assist with the setup of a CMS site on Drupal 7 + PHP/MySQL. Task:1. Create product cards for the entire range of products (currently, not all products on the site have product cards with descriptions and characteristics).2. Add correct… Content Management Systems, PHP ∙ 10 hours 27 minutes back ∙ 34 proposals |
Looking for a Bitrix24 specialist / CRM integrator to set up automation.Our company works with CRM Bitrix24. We need a specialist who can set up automatic addition of phone numbers to leads/orders in two formats. Automation must be correctly configured for two countries: the Republic of Moldova and Romania. Task: When creating a lead or order in… PHP, Web Programming ∙ 1 day 8 hours back ∙ 23 proposals |
Website optimizationOptimization of the website jdgreta.co.uk on Shopify. SEO audit attached to the project. Main tasks - - Fix all meta data - Complete the technical specifications for the programmer (since this project combines tasks for both the programmer and SEO, if you are not a company -… HTML & CSS, PHP ∙ 2 days 5 hours back ∙ 32 proposals |
Horoshop SpecialistNeed a specialist who can correctly set up the product Feed. Problem: Currently, over 13,000 products are being uploaded with the same type value (e.g., "everything for manicure and pedicure"). Because of this, it is impossible to segment products in Google Ads and set different… PHP, Website Maintenance ∙ 3 days 7 hours back ∙ 21 proposals |
Make sure that order emails from the store do not go to spam.Currently, there is a store on OpenCart, and order emails are landing in spam. We need to ensure they go to Inbox (ukr.net gmail) and check it. The hosting provider wrote: Poor email delivery may be related to a low sender reputation - IP or domain. In this case, we can advise… PHP, Web Programming ∙ 4 days 8 hours back ∙ 47 proposals |