[G5] 다국어 홈페이지 사용하기 > 기술자료 | 해피정닷컴

[G5] 다국어 홈페이지 사용하기 > 기술자료

본문 바로가기

사이트 내 전체검색

[G5] 다국어 홈페이지 사용하기 > 기술자료

그누보드 [G5] 다국어 홈페이지 사용하기

페이지 정보


본문

그누보드 G5 에서 다국어 홈페이지를 이용하는 방법입니다.
실시간 번역 방식이 아닌 별도 게시판과 컨텐츠 페이지를 이용하는 방법입니다.


HISTORY
2016-11-03  최초작성
2021-06-11  작업순서 변경


1. 게시판 생성
게시판 이름을 생성할때 게시판 이름 뒤에 언어코드를 추가해서 생성했습니다.
예를 들면 자유게시판 을 아래와 같이 생성했습니다.
한글 :  free
영어 :  free_en
중문 :  free_cn
일어 :  free_jp


2. 그누보드5 / index.php  을  index_en.php 로 복사후 내용 수정
<?php
include_once('./_common.php');

define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

if (G5_IS_MOBILE) {
    include_once(G5_THEME_MOBILE_PATH.'/index_en.php');
    return;
}

require_once(G5_THEME_PATH.'/index_en.php');
return;


3. 그누보드5 / bbs / content.php 를  content_en.php 복사후 내용 수정
include_once(G5_MOBILE_PATH.'/content.php'); 를
include_once(G5_MOBILE_PATH.'/content_en.php'); 로 변경

include_once('./_head.php'); 를
include_once(G5_THEME_PATH.'/head_en.php'); 로 변경

include_once(G5_THEME_PATH.'/tail.php'); 를
include_once(G5_THEME_PATH.'/tail_en.php'); 로 변경

include_once('./_tail.php'); 를
include_once(G5_THEME_PATH.'/tail_en.php'); 로 변경


4. 그누보드5 / theme / 테마명 / index.php 를  index_en.php 로 복사해서 내용 수정
<?php
include_once('./_common.php');

define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

if (G5_IS_MOBILE) {
    include_once(G5_MOBILE_PATH.'/index_en.php');
    return;
}

include_once(G5_THEME_PATH.'/head_en.php');
?>
본문
<?php
include_once(G5_THEME_PATH.'/tail_en.php');


5. 그누보드5 / theme / 테마명 / head.php 를 head_en.php 로 복사후 내용 수정
include_once(G5_THEME_MOBILE_PATH.'/head.php'); 를
include_once(G5_THEME_MOBILE_PATH.'/head_en.php'); 로 변경


6. 그누보드5 / theme / 테마명 / tail.php 를   tail_en.php  로 복사후 내용 수정
include_once(G5_THEME_MOBILE_PATH.'/tail.php');  를
include_once(G5_THEME_MOBILE_PATH.'/tail_en.php');  로 변경

content.php  를  content_en.php   로 변경


7. 그누보드5 / mobile / index_en.php 추가
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

require_once(G5_THEME_MOBILE_PATH.'/index_en.php');
return;


8. 그누보드5 / mobile / head_en.php 추가
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

require_once(G5_THEME_MOBILE_PATH."/head_en.php");
return;


9. 그누보드5 / mobile / tail_en.php 추가
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

require_once(G5_THEME_MOBILE_PATH."/tail_en.php");
return;


10. 그누보드5 / mobile / content.php 를  content_en.php 복사후 내용 수정
include_once('./_head.php'); 를
include_once(G5_THEME_PATH.'/head_en.php'); 로 수정

include_once('./_tail.php'); 를
include_once(G5_THEME_PATH.'/tail_en.php'); 로 수정


11. 그누보드5 / theme / 테마명 / mobile / head.php 를 head_en.php 로 복사후 내용 수정
모바일 메뉴는 g5의 환경설정에서 만든 메뉴를 사용할 수 없으므로 개별 작업이 필요합니다.
한글 모바일 메뉴에서 소스를 추출해서 메뉴부분을  head_en.php 에 적용합니다.


12. 그누보드5 / theme / 테마명 / mobile / tail.php 를   tail_en.php  로 복사후 내용 수정


13. 그누보드5 / theme / 테마명 / mobile / head_en.php  에 언어선택 메뉴 추가하기
<!-- } 상단 끝 -->
<hr>
<!-- 콘텐츠 시작 { -->

를 아래와 같이 변경

<!-- } 상단 끝 -->
<style>
#tnb {border-bottom:1px solid #ddd;background:#fff}
#tnb h3 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#tnb ul {margin:0 auto;zoom:1}
#tnb ul:after {display:block;visibility:hidden;clear:both;content:""}
#tnb li {float:right;border-left:1px solid #ddd;margin-bottom:-1px;font-size:0.92em;width:25%; text-align:center}
#tnb a {display:inline-block;padding:0 10px;color:#646464;line-height:35px}
#tnb a:focus, #tnb a:hover {color:#253dbe;background:#fafafa}
#tnb .tnb_admin a{color:#ff0000;}
#tnb .tnb_left{float:left}
#tnb .tnb_left a{padding:0 14px}
#tnb .tnb_cart{border-right:1px solid #ddd;}
#tnb .tnb_community{border-right:1px solid #ddd}
#tnb .tnb_community i{font-size:15px}
#tnb .tnb_community{background:#e7e7e7;font-weight:bold;}
#tnb .tnb_community:focus, #tnb .tnb_community:hover {color:#333;border-bottom:0}
#tnb .tnb_community a{color:#253dbe;border-bottom:1px solid #e7e7e7}
</style>

<div id="tnb">
    <ul>
        <li class="tnb_left "><a href="<?php echo G5_URL; ?>/"><i class="fa fa-home" aria-hidden="true"></i> KOR</a></li>
        <li class="tnb_left tnb_community"><a href="<?php echo G5_URL; ?>/index_en.php"><i class="fa fa-home" aria-hidden="true"></i> ENG</a></li>
    </ul>
</div>
<!-- 콘텐츠 시작 { -->


14-1. 그누보드5 / bbs / wirte.php
    $title_msg = '글쓰기';

를 아래와 같이 변경

    if (preg_match('/_en/i', $bo_table)) $title_msg = 'Writing';
    elseif (preg_match('/_jp/i', $bo_table)) $title_msg = '書き込み';
    elseif (preg_match('/_cn/i', $bo_table)) $title_msg = '写作';
    else $title_msg = '글쓰기';


14-2. 그누보드5 / bbs / wirte.php
    $title_msg = '글수정';

를 아래와 같이 변경

    if (preg_match('/_en/i', $bo_table)) $title_msg = 'Edit article';
    elseif (preg_match('/_jp/i', $bo_table)) $title_msg = '文の変更';
    elseif (preg_match('/_cn/i', $bo_table)) $title_msg = '编辑文章';
    else $title_msg = '글수정';


14-3. 그누보드5 / bbs / wirte.php
    $title_msg = '글답변';

를 아래와 같이 변경

    if (preg_match('/_en/i', $bo_table)) $title_msg = 'Reply';
    elseif (preg_match('/_jp/i', $bo_table)) $title_msg = '文の回答';
    elseif (preg_match('/_cn/i', $bo_table)) $title_msg = '第二十答案';
    else $title_msg = '글답변';


14-4. 그누보드5 / bbs / wirte.php
                alert('비밀번호가 틀립니다.');

를 아래와 같이 변경

                if (preg_match('/_en/i', $bo_table)) alert('The password is incorrect.');
                elseif (preg_match('/_jp/i', $bo_table)) alert('パスワードが違います。');
                elseif (preg_match('/_cn/i', $bo_table)) alert('密码不正确。');
                else alert('비밀번호가 틀립니다.');


14-5. 그누보드5 / bbs / wirte.php
    $captcha_html = captcha_html();

를 아래와 같이 변경합니다.

    if (preg_match('/_en/i', $bo_table)) $captcha_html = captcha_html_en();
    elseif (preg_match('/_jp/i', $bo_table)) $captcha_html = captcha_html_jp();
    elseif (preg_match('/_cn/i', $bo_table)) $captcha_html = captcha_html_cn();
    else $captcha_html = captcha_html();


15. 그누보드5 / plugin / kcaptcha / kcaptcha.lib.php
사용하는 캡차가 kcapthca 인 경우에는 해당됩니다.
다른 캡챠를 사용한다면 해당 파일을 수정해야 합니다.

// 캡챠 HTML 코드 출력
function captcha_html($class="captcha")
{
    if(is_mobile())
        $class .= ' m_captcha';

    $html .= "\n".'<script>var g5_captcha_url  = "'.G5_CAPTCHA_URL.'";</script>';
    //$html .= "\n".'<script>var g5_captcha_path = "'.G5_CAPTCHA_PATH.'";</script>';
    $html .= "\n".'<script src="'.G5_CAPTCHA_URL.'/kcaptcha.js"></script>';
    $html .= "\n".'<fieldset id="captcha" class="'.$class.'">';
    $html .= "\n".'<legend><label for="captcha_key">자동등록방지</label></legend>';
    if (is_mobile()) $html .= '<audio id="captcha_audio" controls></audio>';
    //$html .= "\n".'<img src="#" alt="" id="captcha_img">';
    $html .= "\n".'<img src="'.G5_CAPTCHA_URL.'/img/dot.gif" alt="" id="captcha_img">';
    $html .= '<input type="text" name="captcha_key" id="captcha_key" required class="captcha_box required" size="6" maxlength="6">';
    if (!is_mobile()) $html .= "\n".'<button type="button" id="captcha_mp3"><span></span>숫자음성듣기</button>';
    $html .= "\n".'<button type="button" id="captcha_reload"><span></span>새로고침</button>';
    $html .= "\n".'<span id="captcha_info">자동등록방지 숫자를 순서대로 입력하세요.</span>';
    $html .= "\n".'</fieldset>';
    return $html;
}

아래에 언어별 함수를 추가합니다.

// 캡챠 HTML 코드 출력 # 영어
function captcha_html_en($class="captcha")
{
    if(is_mobile())
        $class .= ' m_captcha';

    $html .= "\n".'<script>var g5_captcha_url  = "'.G5_CAPTCHA_URL.'";</script>';
    //$html .= "\n".'<script>var g5_captcha_path = "'.G5_CAPTCHA_PATH.'";</ script>';
    $html .= "\n".'<script src="'.G5_CAPTCHA_URL.'/kcaptcha.js"></script>';
    $html .= "\n".'<fieldset id="captcha" class="'.$class.'">';
    $html .= "\n".'<legend><label for="captcha_key">Prevent automatic registration</label></legend>';
    if (is_mobile()) $html .= '<audio id="captcha_audio" controls></audio>';
    //$html .= "\n".'<img src="#" alt="" id="captcha_img">';
    $html .= "\n".'<img src="'.G5_CAPTCHA_URL.'/img/dot.gif" alt="" id="captcha_img">';
    $html .= '<input type="text" name="captcha_key" id="captcha_key" required class="captcha_box required" size="6" maxlength="6">';
    if (!is_mobile()) $html .= "\n".'<button type="button" id="captcha_mp3"><span></span>Listen to numbers</button>';
    $html .= "\n".'<button type="button" id="captcha_reload"><span></span>Refresh</button>';
    $html .= "\n".'<span id="captcha_info">Enter the numbers in order to prevent automatic registration</span>';
    $html .= "\n".'</fieldset>';
    return $html;
}
// 캡챠 HTML 코드 출력 # 일어
function captcha_html_jp($class="captcha")
{
    if(is_mobile())
        $class .= ' m_captcha';

    $html .= "\n".'<script>var g5_captcha_url  = "'.G5_CAPTCHA_URL.'";</script>';
    //$html .= "\n".'<script>var g5_captcha_path = "'.G5_CAPTCHA_PATH.'";</ script>';
    $html .= "\n".'<script src="'.G5_CAPTCHA_URL.'/kcaptcha.js"></script>';
    $html .= "\n".'<fieldset id="captcha" class="'.$class.'">';
    $html .= "\n".'<legend><label for="captcha_key">自動登録防止</label></legend>';
    if (is_mobile()) $html .= '<audio id="captcha_audio" controls></audio>';
    //$html .= "\n".'<img src="#" alt="" id="captcha_img">';
    $html .= "\n".'<img src="'.G5_CAPTCHA_URL.'/img/dot.gif" alt="" id="captcha_img">';
    $html .= '<input type="text" name="captcha_key" id="captcha_key" required class="captcha_box required" size="6" maxlength="6">';
    if (!is_mobile()) $html .= "\n".'<button type="button" id="captcha_mp3"><span></span>数字音声を聞く</button>';
    $html .= "\n".'<button type="button" id="captcha_reload"><span></span>リフレッシュ</button>';
    $html .= "\n".'<span id="captcha_info">自動登録を防止するための数字を順に入力してください。</span>';
    $html .= "\n".'</fieldset>';
    return $html;
}
// 캡챠 HTML 코드 출력 # 중문
function captcha_html_cn($class="captcha")
{
    if(is_mobile())
        $class .= ' m_captcha';

    $html .= "\n".'<script>var g5_captcha_url  = "'.G5_CAPTCHA_URL.'";</script>';
    $html .= "\n".'<script src="'.G5_CAPTCHA_URL.'/kcaptcha.js"></script>';
    $html .= "\n".'<fieldset id="captcha" class="'.$class.'">';
    $html .= "\n".'<legend><label for="captcha_key">防止自动注册</label></legend>';
    if (is_mobile()) $html .= '<audio id="captcha_audio" controls></audio>';
    //$html .= "\n".'<img src="#" alt="" id="captcha_img">';
    $html .= "\n".'<img src="'.G5_CAPTCHA_URL.'/img/dot.gif" alt="" id="captcha_img">';
    $html .= '<input type="text" name="captcha_key" id="captcha_key" required class="captcha_box required" size="6" maxlength="6">';
    if (!is_mobile()) $html .= "\n".'<button type="button" id="captcha_mp3"><span></span>听数字</button>';
    $html .= "\n".'<button type="button" id="captcha_reload"><span></span>刷新</button>';
    $html .= "\n".'<span id="captcha_info">请输入数字以防止自动注册</span>';
    $html .= "\n".'</fieldset>';
    return $html;
}

댓글목록

profile_image

안녕하세요님의 댓글

안녕하세요 이름으로 검색 작성일

이렇게 했을때 접속 주소는 어떤식으로 될까요??

도메인/eng  이렇게 하려면
eng 폴더를 만들고 위에 말씀하신 내용을 따라가면 될까요?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

eng 폴더 생성이유 없습니다.
그누보드 게시판을 기준으로 영문용 index 추가, 영문용 게시판 추가해서 사용하는 방식입니다.

profile_image

관리자1님의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

도메인/eng 형태로 접속을 하려 한다면 조금 다르게 접근해야할듯 하네요.
data 폴더를 같은 것을 사용하도록 하는 등 다른 접근 방법을 생각해야할듯합니다.

profile_image

음님의 댓글

이름으로 검색 작성일

엄청난 자료 감사합니다.  그런데  이해가 안가는 부분이 있습니다. 위 같이 만들어 놓고

홈페이지를 접속하면  index.php 로 들어가질텐데  여기서 어떻게 영문화된 index_en.php 을 보여줄 수 있는지

그리고  _en 이 붙은 게시판을 보여줄 수 있는지 이해가 되질 않습니다.  아마 맨 윗분도 이것을 궁금해 하는 것 같네용

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

영문홈페이지주소는  index_en.php 입니다.
즉, index.php 는 한국어 홈페이지 , index_en.php 는 영문홈페이지
이렇게 각각 운영하는경우 입니다.

게시판도 예를 들어 자유게시판을 free 라고 한다면
한국어 게시판 = free /  영어 게시판 = free_en  이렇게 각각 생성관리하는 방식입니다.


Total 2,643건 1 페이지
  • RSS
기술자료 목록
2643
PHP   570  2025-02-07 09:27 ~ 2025-02-07 16:59  
2642
그누보드   499  2025-02-07 08:55 ~ 2025-02-07 17:04  
2641
그누보드   744  2024-11-26 21:14 ~ 2024-11-26 21:22  
2640
그누보드   854  2024-11-22 10:52 ~ 2024-11-22 11:03  
2639
호스팅   841  2024-11-19 14:41 ~ 2024-11-19 21:17  
2638
Linux   661  2024-11-18 15:45 ~ 2024-11-18 15:48  
2637
일반   620  2024-11-15 16:45 ~ 2024-11-15 16:46  
2636
Secure   619  2024-11-06 18:48 ~ 2024-11-06 18:50  
2635
영카트   858  2024-10-21 13:44 ~ 2024-10-21 19:42  
2634
전자결제   1746  2024-09-05 09:30  
2633
MySQL   1505  2024-03-29 14:14 ~ 2024-03-29 14:14  
2632
그누보드   1725  2024-02-23 18:40 ~ 2024-02-24 06:13  
2631
JavaScript   1835  2024-02-16 18:50 ~ 2024-02-16 20:37  
2630
Java   1827  2024-02-06 16:49  
2629
PHP   2049  2024-02-06 16:42  
2628
호스팅   1777  2024-01-29 12:54  
2627
PHP   1663  2024-01-26 11:04 ~ 2024-01-26 11:13  
2626
MySQL   1800  2024-01-08 17:37 ~ 2024-03-14 16:00  
2625
SQL   2130  2024-01-08 12:36  
2624
영카트   2131  2024-01-04 14:57  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.