This shows you the differences between two versions of the page.
google_translate [2014/03/31 16:04] |
google_translate [2014/03/31 16:04] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Google translate ====== | ||
+ | |||
+ | You can translate your descriptions using Google translate API. Note, that this service is not free, and it's Google who takes money for the service, not the script. | ||
+ | |||
+ | To do it you have to go to https:// | ||
+ | |||
+ | ===== Translation of Existing DB ===== | ||
+ | |||
+ | If you already have a ready DB with descriptions you want to translate you have to use ssh and go to scj/bin, after that run | ||
+ | |||
+ | php rot.php action=translate | ||
+ | |||
+ | This this point script will ask you what you want to translate, and, if you want to translate both descriptions and titles (alt) you'll have to run this command twice. | ||
+ | |||
+ | |||
+ | **Then script asks what method you want to use - stops, log, fast** stops - means we we'll make a stop after each phrase and you'll be able to edit a result. Log - means no stops but output texts and translations, | ||
+ | |||
+ | |||
+ | ===== Translation of New Entries ===== | ||
+ | |||
+ | It takes some time to setup and understand how it works but it worth it because it gives you flexibility to do much more. | ||
+ | |||
+ | You have to setup [[Import Replacements]] for necessary fields , let's say for description | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | If this field = URL | ||
+ | Contains this value = http (ie we want to translate descriptions for all galleries actually) | ||
+ | Then Search For - * (* means 'whole field' | ||
+ | in This Field - Custom Vars 1 ( if you use version 50 or language field if you use 51) | ||
+ | And Replace it With - external:: | ||
+ | |||
+ | As you can see this way all new content will be processed using that URL | ||
+ | |||
+ | What you have to notice here: | ||
+ | |||
+ | * external:: at the beginning - prefix means what script has to request an external url | ||
+ | * YOURDOMAIN - .... | ||
+ | * {DESCRIPTION} - tag that will be replaced with an actual gallery' | ||
+ | * source_lng=en& | ||
+ | * YOUR_API_KEY - should be replaced with your key you got from google | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Why do we do it this way: that's a way for you to optimize this, for example you can user it as external:: | ||
+ | |||
+ | Moreover, this is a way for you not to save a key in the DB just in case if someone gets an access to your admin area. | ||
+ | |||
+ | |||
+ | |||