XLIFF 1.1 ແລະ 1.2¶
Note
XLIFF 2.0 ເປັນຮູບແບບທີ່ແຕກຕ່າງກັນ ແລະ ບໍ່ສາມາດໃຊ້ງານກັບ XLIFF 1.2 ໄດ້ (ບໍ່ສາມາດໃຊ້ຮ່ວມກັນໃນທາງກັບກັນ).
ຮູບແບບທີ່ອີງໃສ່ XML ເຊິ່ງສ້າງຂຶ້ນເພື່ອເຮັດໃຫ້ໄຟລ໌ການແປມີມາດຕະຖານ, ແຕ່ສຸດທ້າຍມັນກໍເປັນໜຶ່ງໃນ ຫຼາຍມາດຕະຖານ ໃນດ້ານນີ້.
XML Localization Interchange File Format (XLIFF) ໂດຍປົກກະຕິຖືກໃຊ້ເປັນແບບສອງພາສາ, ແຕ່ Weblate ກໍຮອງຮັບມັນໃນແບບພາສາດຽວເຊັ່ນກັນ.
Weblate ຮອງຮັບ XLIFF ໃນຫຼາຍຮູບແບບ:
- ໄຟລ໌ການແປ XLIFF 1.2
Standard XLIFF file. Placeables handling is controlled by the
xliff_placeablesພາລາມິເຕີຮູບແບບໄຟລ໌.- XLIFF 1.2 ພ້ອມ Gettext Extensions
XLIFF ທີ່ຖືກເພີ່ມເຕີມດ້ວຍ XLIFF 1.2 Representation Guide for Gettext PO ເພື່ອຮອງຮັບພົດພົດ.
- XLIFF 1.2 ພ້ອມ Apple Extensions
XLIFF ທີ່ຖືກເພີ່ມເຕີມໂດຍ Apple ເພື່ອຮອງຮັບພົດພົດ.
See also
ສະຖານະການແປ¶
Attribute state ໃນໄຟລ໌ຈະຖືກປະມວນຜົນບາງສ່ວນ ແລະ Map ໄປຍັງສະຖານະ "Needs edit" ໃນ Weblate (ສະຖານະຕໍ່ໄປນີ້ຖືກໃຊ້ເພື່ອໝາຍຂໍ້ຄວາມວ່າຕ້ອງການແກ້ໄຂ ຖ້າມີເປົ້າໝາຍ: new, needs-translation, needs-adaptation, needs-l10n). ຖ້າ Attribute state ຂາດໄປ, ຂໍ້ຄວາມຈະຖືກພິຈາລະນາວ່າຖືກແປແລ້ວທັນທີທີ່ມີອົງປະກອບ <target>.
ຖ້າຂໍ້ຄວາມການແປມີ approved="yes", ມັນກໍຈະຖືກນຳເຂົ້າສູ່ Weblate ເປັນ "Approved", ສ່ວນອື່ນໆຈະຖືກນຳເຂົ້າເປັນ "Waiting for review" (ເຊິ່ງກົງກັບສະເປັກ XLIFF).
ໃນຂະນະທີ່ບັນທຶກ, Weblate ຈະບໍ່ເພີ່ມ Attribute ເຫຼົ່ານັ້ນນອກຈາກຈະຈຳເປັນ:
Attribute
stateຈະຖືກເພີ່ມໃນກໍລະນີທີ່ຂໍ້ຄວາມຖືກໝາຍວ່າຕ້ອງການແກ້ໄຂເທົ່ານັ້ນ.Attribute
approvedຈະຖືກເພີ່ມໃນກໍລະນີທີ່ຂໍ້ຄວາມໄດ້ຜ່ານການກວດສອບແລ້ວເທົ່ານັ້ນ.ໃນກໍລະນີອື່ນ Attribute ຈະບໍ່ຖືກເພີ່ມ, ແຕ່ພວກມັນຈະຖືກອັບເດດໃນກໍລະນີທີ່ມີຢູ່ແລ້ວ.
ນັ້ນໝາຍຄວາມວ່າເມື່ອໃຊ້ຮູບແບບ XLIFF, ແນະນຳຢ່າງຍິ່ງໃຫ້ເປີດໃຊ້ຂະບວນການກວດສອບຂອງ Weblate ເພື່ອທີ່ຈະເບິ່ງ ແລະ ປ່ຽນສະຖານະ Approved ຂອງຂໍ້ຄວາມ.
ເຊັ່ນດຽວກັນ, ເມື່ອນຳເຂົ້າໄຟລ໌ດັ່ງກ່າວ (ໃນຟອມອັບໂຫຼດ), ທ່ານຄວນເລືອກ Import as translated ພາຍໃຕ້ Processing of strings needing edit.
See also
ຊ່ອງຫວ່າງ ແລະ ການຂຶ້ນແຖວໃໝ່ໃນ XLIFF¶
Weblate controls how whitespaces are handled with the xml_whitespace_handling
ພາລາມິເຕີຮູບແບບໄຟລ໌ for XLIFF components:
Follow xml:space — honor
xml:spaceattributes 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>
See also
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.
See also
ການລະບຸ Flag ການແປ¶
ທ່ານສາມາດລະບຸ Flag ການແປເພີ່ມເຕີມ (ເບິ່ງ ການປັບແຕ່ງພຶດຕິກຳໂດຍໃຊ້ທຸງ (flags)) ໂດຍໃຊ້ Attribute weblate-flags. Weblate ຍັງເຂົ້າໃຈ Attribute maxwidth ແລະ font ຈາກສະເປັກ XLIFF:
<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>
Attribute font ຈະຖືກແຍກວິເຄາະຫາ Font Family, ຂະໜາດ ແລະ ນ້ຳໜັກ, ຕົວຢ່າງຂ້າງເທິງສະແດງໃຫ້ເຫັນທັງໝົດນັ້ນ, ເຖິງແມ່ນວ່າຈະຕ້ອງການພຽງແຕ່ Font Family ເທົ່ານັ້ນ. ຊ່ອງຫວ່າງໃດໆໃນ Font Family ຈະຖືກປ່ຽນເປັນ Underscore, ສະນັ້ນ Source Sans Pro ຈະກາຍເປັນ Source_Sans_Pro, ກະລຸນາຈື່ສິ່ງນີ້ໄວ້ໃນເວລາຕັ້ງຊື່ກຸ່ມ Font (ເບິ່ງ ການຈັດການຟອນ (fonts)).
Key ຂໍ້ຄວາມ¶
Weblate ລະບຸໜ່ວຍຕ່າງໆໃນໄຟລ໌ XLIFF ໂດຍ Attribute resname ໃນກໍລະນີທີ່ມີຢູ່ ແລະ ຈະກັບໄປໃຊ້ id (ພ້ອມກັບ Tag file ຖ້າມີ) ແທນ.
Attribute resname ຄວນເປັນຕົວລະບຸທີ່ມະນຸດອ່ານເຂົ້າໃຈໄດ້ງ່າຍຂອງໜ່ວຍນັ້ນ ເຊິ່ງເຮັດໃຫ້ມັນເໝາະສົມກວ່າສຳລັບ Weblate ໃນການສະແດງແທນ id. resname ຕ້ອງເປັນເອກະລັກ (unique) ໃນໄຟລ໌ XLIFF ທັງໝົດ. ສິ່ງນີ້ຖືກກຳນົດໂດຍ Weblate ແລະ ບໍ່ໄດ້ຖືກກວມເອົາໂດຍມາດຕະຖານ XLIFF - ມັນບໍ່ໄດ້ວາງຂໍ້ຈຳກັດຄວາມເປັນເອກະລັກໃດໆໄວ້ເທິງ Attribute ນີ້.
ໄຟລ໌ຕົວຢ່າງ¶
ຕົວຢ່າງໄຟລ໌ 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 <https://demo.weblate.org/>!
</source>
</trans-unit>
<trans-unit>
<source>Thank you for using Weblate.</source>
</trans-unit>
</body>
</file>
</xliff>
ນາມສະກຸນໄຟລ໌ |
|
|---|---|
ຈຳນວນພາສາ ⓘ |
ເປັນທັງແບບພາສາດຽວ ແລະ ສອງພາສາ |
ຮອງຮັບພະຫູພົດ ⓘ |
|
ຮອງຮັບຄຳອະທິບາຍ ⓘ |
|
ຮອງຮັບຄຳຊີ້ແຈງ ⓘ |
|
ຮອງຮັບບໍລິບົດ (context) ⓘ |
|
ຮອງຮັບຕຳແໜ່ງ ⓘ |
|
ຮອງຮັບທຸງ (flags) ⓘ |
|
ສະຖານະເພີ່ມເຕີມ ⓘ |
|
ຕົວລະບຸ API |
|
ຮອງຮັບຂໍ້ຄວາມແບບອ່ານຢ່າງດຽວ ⓘ |
|
ຮອງຮັບການລຶບຂໍ້ຄວາມທີ່ລ້າສະໄໝ ⓘ |
|
ການຕັ້ງຄ່າ Weblate¶
ການຕັ້ງຄ່າ Component ຂອງ Weblate ໂດຍປົກກະຕິສຳລັບ XLIFF ແບບສອງພາສາ |
|
|---|---|
ໜ້າກາກໄຟລ໌ |
|
ໄຟລ໌ພາສາຫຼັກ (Monolingual) |
ຫວ່າງເປົ່າ |
ແມ່ແບບສຳລັບການແປໃໝ່ |
|
ຮູບແບບໄຟລ໌ |
ໄຟລ໌ການແປ XLIFF |
ການຕັ້ງຄ່າ Component ຂອງ Weblate ໂດຍປົກກະຕິສຳລັບ XLIFF ແບບພາສາດຽວ |
|
|---|---|
ໜ້າກາກໄຟລ໌ |
|
ໄຟລ໌ພາສາຫຼັກ (Monolingual) |
|
ແມ່ແບບສຳລັບການແປໃໝ່ |
|
ຮູບແບບໄຟລ໌ |
ໄຟລ໌ການແປ XLIFF |