KonstantinKlepikov / myknowlegebase

My knowlege base

Home Page:https://konstantinklepikov.github.io/myknowlegebase/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add translate widget

KonstantinKlepikov opened this issue · comments

Thanks for submitting the request. You can now use the Website Translator on your site, with the instructions below.

Step 1: Determine the language code of your website pages.

Go to https://translate.google.com/, choose your site's language as the source language, then the "sl" parameter is the language code to be used.

For example, English language code is "en", and Japanese is "ja".

Step 2: Copy the following code to the appropriate part of your site. Replace the language code 'en' with the one you get from step 1, if needed.

<script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element'); } </script> <script type="text/javascript" src="//[translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>