القائمة الرئيسية

الصفحات

 Add translation in blogger blog

To add a translation code to your Blogger blog, you can use Google's automatic translation tool, which allows your readers to translate your blog into their preferred language. Here are the steps to do it:




  1. Go to the Blogger dashboard and select the blog you want to add the translation code to.
  2. Click on "Layout" in the left-hand menu.
  3. Select "Add a Gadget" where you want the translation code to appear on your blog.
  4. Choose the "HTML/JavaScript" gadget.
  5. Copy and paste the following code into the content box:
<div style="text-align:center">
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>

  1. Replace 'en' in pageLanguage: 'en' with your blog's language code, for example, 'fr' for French or 'es' for Spanish.
  2. Save the gadget, and you're done!

Now your readers can use the translation tool to read your blog in their preferred language.







تعليقات