Google Translate Integration for HTMLy #912
touficmamdouh
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Checked several themes, but couldn't find any with a header.html |
Beta Was this translation helpful? Give feedback.
1 reply
-
Did as you said, but it is showing this frame. Need to integrate it properly with some customization so that it matches properly with the header icons. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Integrating Google Translate into an HTMLy CMS (a flat-file CMS) for basic multilingual support can be a quick solution, especially if you don't need manual translation for each post. However, it’s worth noting that Google Translate integration provides machine translation, not SEO-friendly multilingual URLs. Here's a step-by-step guide to add Google Translate to HTMLy:
✅ Basic Google Translate Integration for HTMLy
Open your HTMLy theme's header.html file:
Path: /themes/your-theme/header.html
Add Google Translate Widget Code:
Insert the following code just before the closing head tag:
<div id="google_translate_element"></div>
Style the Translate Dropdown (optional):
Add some CSS to make it fit your theme:
<style> #google_translate_element { position: fixed; top: 10px; right: 10px; z-index: 1000; } </style>
Customize Source Language:
Replace 'en' in pageLanguage: 'en' with your site's default language code (e.g., 'ar' for Arabic, 'fr' for French, etc.).
Beta Was this translation helpful? Give feedback.
All reactions