XLIFF 1.1 및 1.2

참고

XLIFF 2.0 는 다른 형식이며 XLIFF 1.2와 하위 호환되지 않습니다.

번역 파일을 표준화하기 위해 만들어진 XML 기반 형식이지만, 결국 이 분야의 수많은 표준 중 하나입니다.

XML 현지화 교환 파일 형식 (XLIFF) 은 일반적으로 이중 언어로 사용되지만 Weblate는 단일 언어로도 지원합니다.

Weblate는 여러 변형에서 XLIFF를 지원함:

XLIFF 1.2 번역 파일

Standard XLIFF file. Placeables handling is controlled by the xliff_placeables 파일 형식 매개변수.

XLIFF 1.2 gettext 확장 포함

복수형을 지원하기 위해 XLIFF 1.2 Representation Guide for Gettext PO 로 강화된 XLIFF.

XLIFF 1.2 Apple 확장 포함

복수형을 지원하기 위해 Apple이 강화한 XLIFF.

번역 상태

파일의 state 속성은 부분적으로 처리되어 Weblate의 “편집 필요” 상태에 매핑됩니다 (대상이 있는 경우 문자열을 편집 필요로 표시하는 데 사용되는 상태: new, needs-translation, needs-adaptation, needs-l10n). state 속성이 없으면 <target> 요소가 존재하는 즉시 문자열은 번역된 것으로 간주됩니다.

번역 문자열에 approved="yes" 가 있으면 Weblate에 “승인됨”으로도 가져와지며, 그 외에는 “검토 대기 중”으로 가져와집니다 (XLIFF 사양과 일치).

저장 시 Weblate는 필요한 경우에만 해당 속성을 추가함:

  • state 속성은 문자열이 편집 필요로 표시된 경우에만 추가됩니다.

  • approved 속성은 문자열이 검토된 경우에만 추가됩니다.

  • 다른 경우에는 속성이 추가되지 않지만, 존재하는 경우 업데이트됩니다.

이는 XLIFF 형식을 사용할 때 문자열의 승인 상태를 보고 변경하기 위해 Weblate 검토 프로세스를 켜는 것이 강력히 권장됨을 의미합니다.

마찬가지로 이러한 파일을 가져올 때 (업로드 양식에서) 편집 필요 문자열 처리 에서 번역됨으로 가져오기 를 선택해야 합니다.

더 보기

전담 검토자

XLIFF의 공백 및 줄 바꿈

Weblate controls how whitespaces are handled with the xml_whitespace_handling 파일 형식 매개변수 for XLIFF components:

  • Follow xml:space — honor xml:space attributes in the file (and the XLIFF default when the attribute is missing).

  • Always preserve — keep all whitespace and set xml:space="preserve" on units (Weblate’s default for new units).

  • Always normalize — collapse whitespace even when the file sets xml:space="preserve".

To keep newlines or surrounding spaces when following xml:space, mark the string with xml:space="preserve":

    <trans-unit id="10" approved="yes">
        <source xml:space="preserve">hello</source>
        <target xml:space="preserve">Hello, world!
</target>
    </trans-unit>

Placeables in XLIFF

Weblate controls how XML elements inside XLIFF content are handled with the xliff_placeables 파일 형식 매개변수:

  • Plain text — escape XML elements in the content.

  • Placeables — preserve placeables and other XML elements (the default). Tags then appear as placeholders in the editor.

번역 플래그 지정

weblate-flags 속성을 사용하여 추가 번역 플래그 ( 플래그를 사용한 동작 사용자 지정 참조)를 지정할 수 있습니다. Weblate는 XLIFF 사양의 maxwidth 및 font 속성도 이해함:

<trans-unit id="10" maxwidth="100" size-unit="pixel" font="ubuntu;22;bold">
   <source>Hello %s</source>
</trans-unit>
<trans-unit id="20" maxwidth="100" size-unit="char" weblate-flags="c-format">
   <source>Hello %s</source>
</trans-unit>

font 속성은 글꼴 패밀리, 크기 및 굵기에 대해 파싱됩니다. 위 예시는 이 모든 것을 보여주지만 글꼴 패밀리만 필수입니다. 글꼴 패밀리의 공백은 밑줄로 변환되므로 Source Sans Pro 는 Source_Sans_Pro 가 됩니다. 글꼴 그룹을 이름 지을 때 이 점을 유의하세요 ( 글꼴 관리 참조).

문자열 키

Weblate는 resname 속성이 있는 경우 이를 사용하여 XLIFF 파일의 단위를 식별하며, 없으면 id (file 태그가 있는 경우 포함)로 폴백합니다.

resname 속성은 id 대신 Weblate에서 표시하기에 더 적합한 단위의 사람이 읽기 식별자여야 합니다. resname 은 전체 XLIFF 파일에서 고유해야 합니다. 이는 Weblate에 의해 요구되며 XLIFF 표준에서는 다루지 않습니다 - XLIFF 표준은 이 속성에 고유성 제한을 두지 않습니다.

파일 예시

XLIFF 파일 예시:

<?xml version='1.0' encoding='UTF-8'?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1">
    <file>
        <body>
            <trans-unit weblate-flags="c-format, max-length:100">
                <source xml:space="preserve">Hello, world!
</source>
            </trans-unit>
            <trans-unit>
                <source xml:space="preserve">Orangutan has %d banana.
</source>
            </trans-unit>
            <trans-unit>
                <source xml:space="preserve">Try Weblate at &lt;https://demo.weblate.org/&gt;!
</source>
            </trans-unit>
            <trans-unit>
                <source>Thank you for using Weblate.</source>
            </trans-unit>
        </body>
    </file>
</xliff>
지원 기능

파일 확장자

.mxliff, .poxliff, .sdlxliff, .xlf, .xliff

언어성 ⓘ

단일 언어 및 이중 언어 방식 모두

복수형 지원 ⓘ

Yes

설명 지원 ⓘ

Yes

설명 지원 ⓘ

No

문맥 지원 ⓘ

Yes

위치 지원 ⓘ

Yes

플래그 지원 ⓘ

Yes

추가 상태 ⓘ

Approved, Needs editing

API 식별자

apple-xliff, poxliff, xliff

읽기 전용 문자열 지원 ⓘ

Yes

Supports removing obsolete strings ⓘ

No

Weblate 구성

이중 언어 XLIFF용 일반적인 Weblate 구성요소 설정

파일 마스크

localizations/*.xliff

단일언어 기반 언어 파일

빈

신규 번역의 템플릿

localizations/en-US.xliff

파일 형식

XLIFF 번역 파일

단일 언어 XLIFF용 일반적인 Weblate 구성요소 설정

파일 마스크

localizations/*.xliff

단일언어 기반 언어 파일

localizations/en-US.xliff

신규 번역의 템플릿

localizations/en-US.xliff

파일 형식

XLIFF 번역 파일