diff options
author | jeffreytse <jeffreytse.mail@gmail.com> | 2021-08-12 12:02:44 +0800 |
---|---|---|
committer | jeffreytse <jeffreytse.mail@gmail.com> | 2021-08-12 12:13:12 +0800 |
commit | 9ecb45bd4e0e07750609347f220acd0455763b64 (patch) | |
tree | ae2e555dd6c9abc95243ceabd89b810b4f2d7738 /_includes/extensions | |
parent | f06b7b0e62d5cb6c9fe2dacf4a0f59cfedf3dd5e (diff) |
fix: inaccurate google translation behavior (#55)
Diffstat (limited to '_includes/extensions')
-rw-r--r-- | _includes/extensions/google-translate.html | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/_includes/extensions/google-translate.html b/_includes/extensions/google-translate.html index ce1ef94..9763315 100644 --- a/_includes/extensions/google-translate.html +++ b/_includes/extensions/google-translate.html @@ -2,6 +2,10 @@ {% assign translate_langs = include.translate_langs %} {% endif %} +{% if include.lang %} + {% assign lang = include.lang %} +{% endif %} + <div id="google_translate_element" style="display: none;"> </div> @@ -24,7 +28,7 @@ <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({ - pageLanguage: '', + pageLanguage: '{{ lang }}', autoDisplay: false, layout: google.translate.TranslateElement.InlineLayout.VERTICAL }, 'google_translate_element'); |