<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" type="topic" style="task" id="dev-translate-build" xml:lang="ko">
<info>
<link type="next" xref="dev-translate-tools"/>
<revision version="0.1" date="2013-06-19" status="review"/>
<credit type="author">
<name>Ekaterina Gerasimova</name>
<email its:translate="no">kittykat3756@gmail.com</email>
<years>2013</years>
</credit>
<include xmlns="http://www.w3.org/2001/XInclude" href="cc-by-sa-3-0.xml"/>
<desc/>
<mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
<mal:name>조성호</mal:name>
<mal:email>shcho@gnome.org</mal:email>
<mal:years>2016, 2017.</mal:years>
</mal:credit>
</info>
<title>번역 빌드 시스템을 설정합니다</title>
<links type="series" style="floatend">
<title>번역 설정</title>
</links>
<p>번역을 처리하려면 프로젝트와 빌드 시스템을 설정해야합니다.</p>
<p>프로젝트 디렉터리에 <file>po/</file> 하위 디렉터리를 만들고 <file>po/POTFILES.in</file> 파일에 번역할 파일 이름 문자열을 넣으십시오. <file>po/POTFILES.skip</file> 파일에는 번역<em>하지 않을</em> 파일 이름을 넣으십시오.</p>
<p>다음 줄을 <file>configure.ac</file> 파일에 추가하십시오:</p>
<code>
IT_PROG_INTLTOOL([0.50.0])
AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Package name for gettext])</code>
<p>다음 줄을 <file>Makefile.am</file> 파일에 추가하십시오:</p>
<code>
SUBDIRS = po
</code>
<code>
AM_CPPFLAGS = -DPACKAGE_LOCALEDIR=\""$(datadir)/locale"\"
</code>
<code>
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = data/<input>applicationname</input>.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
</code>
<p><cmd>autoreconf</cmd> 명령을 실행하기 전에 <cmd>intltoolize</cmd> 명령을 실행하여 빌드 트리에 intltool 빌드 기반을 복사하십시오.</p>
<p>이제 빌드 시스템을 준비했고 원본 문자열을 번역할 준비가 끝났으니, <app>gettext</app>에 다음 세가지 요소를 언급해야합니다:</p>
<list>
<item><p>보통 프로그램 이름과 동일하게 언급하는 <em>번역 영역</em></p></item>
<item><p>빌드한 번역을 설치할 위치</p></item>
<item><p>보통 UTF-8로 취급하는 번역 문자 인코딩</p></item>
</list>
<example>
<note>
<p>이 예제에서는 프로그램을 C 프로그래밍 언어로 작성했다고 가정합니다. 다른 프로그래밍 언어로 작성했을 경우 약간 다를 수 있습니다.</p>
</note>
<p>다음 줄을 <code>main()</code> 함수가 있는 소스 파일에 추가하십시오:</p>
<code>#include "config.h"</code>
<p>그 다음 <code>main()</code> 함수에 다음 줄을 추가하십시오:</p>
<code>
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALEDIR);
bind_textdomain_codeset (PACKAGE_TARNAME, "UTF-8");
textdomain (GETTEXT_PACKAGE);
</code>
</example>
<p><file>po</file> 디렉터리에서 <cmd>make <input>projectname</input>.pot</cmd> 명령을 실행하십시오. 이 명령은 소스 코드에서 번역할 수 있는 문자열을 빼내어 po 양식(POT) 파일에 넣습니다.</p>
</page>