https://translate.google.com/manager/website/?hl=ko
1. 기본
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'ko', includedLanguages: 'de,en,ja,ko,zh-CN,zh-TW'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
2. 이미지 클릭
<style type="text/css">
/*상단 플로팅 바 옵션 가리기 */
body { position: static !important; top:0px !important; }
iframe.goog-te-banner-frame { display: none !important; }
.goog-logo-link { display:none !important; }
.goog-te-gadget { color: transparent !important; overflow: hidden;}
.goog-te-balloon-frame{display: none !important;}
/*원본 텍스트 팝업 안뜨게 하기*/
.goog-tooltip {display: none !important;}
.goog-tooltip:hover {display: none !important;}
.goog-text-highlight {background-color: transparent !important; border: none !important; box-shadow: none !important;}
</style>
<div id="google_translate_element" style="visibility: hidden; position: absolute; top: 0px;"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'ko', includedLanguages: 'de,en,ja,ko,zh-CN', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false, multilanguagePage: true}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script type="text/javascript">
$(window).load(function () {
$('.translation-icons').css('visibility', 'visible');
$('.translation-icons a').click(function(e) {
e.preventDefault();
var placement = $(this).data('placement');
var lang_num = $('.translation-icons a').length;
var $frame = $('.goog-te-menu-frame:first');
if (!$frame.size()) {
alert("Error: Could not find Google translate frame.");
return false;
}
var langs = $('.goog-te-menu-frame:first').contents().find('a span.text');
if(langs.length != lang_num) placement = placement+1;
langs.eq(placement).click();
return false;
});
});ko
</script>
<div class="translation-icons" style="visibility: hidden; position: relative; text-align: center; margin:0 auto; zoom:1">
<a href="#" class="ko" data-placement="0" style="padding:5px;"> <img src="<?php echo G5_IMG_URL?>/icon-lang/KR.png" alt='한국'/></a>
<a href="#" class="gm" data-placement="1" style="padding:5px;"> <img src="<?php echo G5_IMG_URL?>/icon-lang/GM.png" alt='독일'/></a>
<a href="#" class="us" data-placement="2" style="padding:5px;"> <img src="<?php echo G5_IMG_URL?>/icon-lang/US.png" alt='미국'/></a>
<a href="#" class="jp" data-placement="3" style="padding:5px;"> <img src="<?php echo G5_IMG_URL?>/icon-lang/JP.png" alt='일본'/></a>
<a href="#" class="cn" data-placement="4" style="padding:5px;"> <img src="<?php echo G5_IMG_URL?>/icon-lang/CN.png" alt='중국'/></a>
</div>
<div id="" style="text-align:center; padding-top:10px;">
<img src="<?php echo G5_IMG_URL?>/icon-lang/google_translate_logo.png" alt='구글 번역 api'/>
</div>
'기타자료' 카테고리의 다른 글
구글 번역 특정영역 번역 안되게 막기 (0) | 2018.09.12 |
---|---|
뉴스 저작권에 대한 팁 (0) | 2018.09.11 |
폰트 아이콘 목록 (0) | 2018.09.05 |
특수문자 (계속 업데이트) (2) | 2018.08.31 |
크롬 탭 전환시 자동 새로고짐 해제 (0) | 2018.08.26 |