Hongsam's Blog
[Javascript] HTML 페이지 번역 본문
고객의 요청은 다음과 같다.
"현재 페이지를 여러가지 언어로 번역하여 사용하면 좋겠어요"
그래 고객님이 원하니 찾아봐야지
www.w3schools.com/howto/howto_google_translate.asp
How To Google Translate
How TO - Google Translate Learn how to add a Google Translate button on your web page. Google Translate Button Start with a simple basic web page. Add a
element with the id "google_translate_element": Example
My Web
www.w3schools.com
세상은 넓고 감사한 분들은 차고 넘친다.
구글님 감사합니다.
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
라이브러리를 불러 온 후에 . . .
<div id="google_translate_element"></div>
위와 같은 div를 만들고 . . .
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
이렇게 javascript로 라이브러리를 사용해서 div id에 연결시켜 주면 된다 . . . . .
감사한 분들이 많으니 고객님 요청도 쉽게 들어줄 수 있었다. . . .
끗...