You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Translate with Google Complete beginner tutorial:
How to integrate Google translate to Opera:Translate current page with Google translate accessible from drop-down menu(on page)
Translate selected text with Google translate accessible from drop-down menu(on selected text)
Use of Automatic translation (Google tries to detect source language).
What you need:
Basic computer skills (text editors, files, zip)
Basic .ini Editing skills (menu.ini, skin.ini)
What do we do:
Change the skin so it contains flag icons. So if you change your skin you lose icons.(or you'll need to repeat part of the process). If you do not care about icons just skip that part and use "thisneedicon" as <name of flag from skin>. If anything go wrong you can just select your old skin (Opera -> Shif+f12 -> select your original skin).
Edit custom menu So that we can access translate functions. If anything go wrong you can just select standard menu (Go in Opera, Ctrl + F12 -> Advanced -> Toolbars, !!!!! Menu set-up !!!!! -> "Opera standard" )
This tutorial tested on version 10.52 W7 Some versions 10.5x has bugs that prevent passing %u, %t arguments in menu.ini !!! Older versions (<10.10) should be fine. Use of javascript is needed because 10.52 has bug (reported), passing unencoded URL. So future releases might give us more simple code, but this version should still apply. Other OS version could use this tutorial with obvious changes "c:\".
This tutorial is simple. It is just detailed and have long example and reference at the end
.EDITING THE SKIN FOR FLAGS IMAGES
[1]Create directory c:\mytemp\
[2]Create directory c:\mytemp\countries
[3]Create directory c:\mytemp\skin
[4]Download: http://www.icondrawer.com/free_icons/Flags.zip
[5]Unzip it(Flags.zip) to c:\mytemp\
[6]Copy flags you of languages you want to use from c:\mytemp\flags_iso\16\ To c:\mytemp\skin\countries
[7]Unzip opera:config#Button Set to c:\mytemp\skin
[8]Edit c:\mytemp\skin\skin.ini
- - -at the beggining of the file in section [info] change Name =<Skin name> to Name =<Skin name>_with flags
- - -for each flag in c:\mytemp\skin\countries create this line at the end of skin.ini: country_<file name> = countries\<full file name>
- - -example line for Japanese flag: country_jp = countries\jp.png
[9]Zip c:\mytemp\skin\ to c:\mytemp\myskinwithflags.zip
[10]copy c:\mytemp\myskinwithflags.zip to opera:config#Skin Directory
[11]Select is as an active skin (Restart Opera , In Opera Shift + F12 -> Skin -> <Skin name>_with flags)
EDITING THE MENU FOR TRANSLATIONS
[-2]If you do not have custom menu setup create it by
Go in Opera,
Ctrl + F12 -> Advanced -> Toolbars
!!!!! Menu set-up !!!!! -> "Opera standard" is selected press Duplicate
Select "Copy of Opera standard" press rename to "mycustommenu"
[-1]If you have custom menu Edit it:
location: opera:config#Menu Configuration
[0]If you just created new "mycustommenu.ini" delete everything except sections [Translate menu], [Document Popup Menu] (section means [headline] plus text below until next [headline])
[1]Create new section [Translate Page menu]
[2]Insert line Submenu, Translate page, Translate Page Menu in the [Document Popup Menu] section, anywhere is fine.
[3]For every translate direction create this line in [Translate Page menu] section. Code reference is at At the end.
Item, <text visible in drop-down menu>= Go to page, "http://www.google.com/translate_c?langpair=<Code of source language>|<Code of destination language>&u=%u",,,"<name of flag from skin>"
[4a]For every translate direction create this line in [Translate menu] section, You can delete what is there originally if you do not want to use original opera translation. This will translate selected text in the SAME page. Code reference is at At the end.
- - - Item, <text visible in drop-down menu> = Go to page, "javascript:window.location.href=encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=<Code of source language>&tl=<Code of destination language>')",,,"<name of flag from skin>"
- - - Example:Item, English to Japanese = Go to page, "javascript:window.location.href=encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=ja')",,,"country_jp"
[4b]For every translate direction create this line in [Translate menu] section, You can delete what is there originally if you do not want to use original opera translation. This will translate selected text in NEW page. Code reference is at At the end.
- - - Item, <text visible in drop-down menu> = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=<Code of source language>&tl=<Code of destination language>')))",,,"<name of flag from skin>"
- - - Example:Item, Anything to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=auto&tl=en')))",,,"country_en"
EXAMPLE OF SKIN INI CHANGES:
[Info]
Name=Opera Standard Skin_with flags
Name String Code=S_SKIN_MANAGER_OPERA_STANDARD
Author=Opera Software
Version=3
Preview Image=
...
country_jp = countries\jp.png
country_en = countries\en.png
country_it = countries\it.png
country_es = countries\es.png
country_ru = countries\ru.png
country_de = countries\de.png
country_fr = countries\fr.png
EXAMPLE OF MENU INI CHANGES:
[Document Popup Menu]
Item, MI_IDM_Prev_PM, = Back
Item, MI_IDM_Next_PM, = Forward
Item, M_REWIND, = Rewind
Item, M_FAST_FORWARD, = Fast Forward
--------------------1
Item, MI_IDM_Reload_PM, = Reload
Submenu, MI_IDM_AUTORELOAD_TOGGLE_PARENT, Reload Menu
--------------------2
Item, M_DOCUMENT_POPUP_MENU_BOOKMARK_PAGE = Add to bookmarks, 1
Item, MI_IDM_POPUP_ADDRESS = Copy document address
Item, MI_IDM_SEND_URL_EMAIL = Send document address in mail
Item, MI_IDM_Print = Print document
--------------------3
GhostItem, M_INSPECT_ELEMENT = Inspect element
Item, MI_IDM_Kilde = View document source
Item, M_DOCUMENT_POPUP_MENU_VALIDATE = Validate frame source
Submenu, M_OPEN_WITH, Open in menu
Submenu, Translate page, Translate Page Menu
--------------------5
Include, Internal Frame
Include, Internal Document Background
--------------------7
Item, M_BLOCK_CONTENT = Content block mode on | Content block mode off
Item, M_EDIT_SITE_PREFERENCES = Edit site preferences
--------------------8
Item, MI_IDM_FULLSCREENTOGGLE = Enter fullscreen | Leave fullscreen
[Translate Page menu]
Item, English to French = Go to page, "http://www.google.com/translate_c?langpair=en|fr&u=%u",,,"country_fr"
Item, English to German = Go to page, "http://www.google.com/translate_c?langpair=en|de&u=%u",,,"country_de
Item, English to Italian = Go to page, "http://www.google.com/translate_c?langpair=en|it&u=%u",,,"country_it"
Item, English to Spanish = Go to page, "http://www.google.com/translate_c?langpair=en|es&u=%u",,,"country_es"
Item, English to Russian = Go to page, "http://www.google.com/translate_c?langpair=en|ru&u=%u",,,"country_ru"
Item, English to Japanese = Go to page, "http://www.google.com/translate_c?langpair=en|ja&u=%u",,,"country_jp"
--------------------1
Item, Anything to English = Go to page, "http://www.google.com/translate_c?langpair=auto|en&u=%u",,,"country_en"
--------------------2
Item, French to English = Go to page, "http://www.google.com/translate_c?langpair=fr|en&u=%u",,,"country_en"
Item, German to English = Go to page, "http://www.google.com/translate_c?langpair=de|en&u=%u",,,"country_en"
Item, Italian to English = Go to page, "http://www.google.com/translate_c?langpair=it|en&u=%u",,,"country_en"
Item, Spanish to English = Go to page, "http://www.google.com/translate_c?langpair=es|en&u=%u",,,"country_en"
Item, Russian to English = Go to page, "http://www.google.com/translate_c?langpair=ru|en&u=%u",,,"country_en"
Item, Japanese to English = Go to page, "http://www.google.com/translate_c?langpair=ja|en&u=%u",,,"country_en"
[Translate menu]
Item, English to French = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=fr')))",,,"country_fr"
Item, English to German = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=de')))",,,"country_de"
Item, English to Italian = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=it')))",,,"country_it"
Item, English to Spanish = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=es')))",,,"country_es"
Item, English to Russian = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=ru')))",,,"country_ru"
Item, English to Japanese = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=en&tl=ja')))",,,"country_jp"
--------------------1
Item, Anything to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=auto&tl=en')))",,,"country_en"
--------------------2
Item, French to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=fr&tl=en')))",,,"country_en"
Item, German to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=de&tl=en')))",,,"country_en"
Item, Italian to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=it&tl=en')))",,,"country_en"
Item, Spanish to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=es&tl=en')))",,,"country_en"
Item, Russian to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=ru&tl=en')))",,,"country_en"
Item, Japanese to English = Go to page, "javascript:void(window.open(encodeURI('http://translate.google.com/?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&text=%t&file=&sl=ja&tl=en')))",,,"country_en"
LANGUAGE CODES:
I took this codes form some site I didn't test all of them. If they do not work try use Google translate manually (http://translate.google.com/) and read codes from URL. Code you need to fill is text after : usually two letters.
AFRIKAANS:af
ALBANIAN:sq
AMHARIC:am
ARABIC:ar
ARMENIAN:hy
AZERBAIJANI:az
BASQUE:eu
BELARUSIAN:be
BENGALI:bn
BIHARI:bh
BULGARIAN:bg
BURMESE:my
CATALAN:ca
CHEROKEE:chr
CHINESE:zh
CHINESE_SIMPLIFIED:zh-CN
CHINESE_TRADITIONAL:zh-TW
CROATIAN:hr
CZECH:cs
DANISH:da
DHIVEHI:dv
DUTCH':nl
ENGLISH:en
ESPERANTO:eo
ESTONIAN:et
FILIPINO:tl
FINNISH:fi
FRENCH:fr
GALICIAN:gl
GEORGIAN:ka
GERMAN:de
GREEK:el
GUARANI:gn
GUJARATI:gu
HEBREW:iw
HINDI:hi
HUNGARIAN:hu
ICELANDIC:is
INDONESIAN:id
INUKTITUT:iu
IRISH:ga
ITALIAN:it
JAPANESE:ja
KANNADA:kn
KAZAKH:kk
KHMER:km
KOREAN:ko
KURDISH':ku
KYRGYZ':ky
LAOTHIAN':lo
LATVIAN:lv
LITHUANIAN:lt
MACEDONIAN:mk
MALAY:ms
MALAYALAM:ml
MALTESE:mt
MARATHI:mr
MONGOLIAN:mn
NEPALI:ne
NORWEGIAN:no
ORIYA:or
PASHTO:ps
PERSIAN:fa
POLISH:pl
PORTUGUESE:pt-PT
PUNJABI:pa
ROMANIAN:ro
RUSSIAN:ru
SANSKRIT:sa
SERBIAN:sr
SINDHI:sd
SINHALESE:si
SLOVAK:sk
SLOVENIAN:sl
SPANISH:es
SWAHILI:sw
SWEDISH:sv
TAJIK:tg
TAMIL:ta
TAGALOG:tl
TELUGU:te
THAI:th
TIBETAN:bo
TURKISH:tr
UKRAINIAN:uk
URDU:ur
UZBEK:uz
UIGHUR:ug
VIETNAMESE:vi
WELSH:cy
YIDDISH:yi