所有檔案都使用Name.<sourceLocale>.<ext>命名慣例。
.resx
瞭解更多信息 基於XML的.NET資源檔案。 翻譯每個<data><value>節點嘅內部文本,保留註釋同元數據。
<?xml version="1.0" encoding="utf-8"?><root> <data name="Greeting" xml:space="preserve"> <value>Hello, world!</value> <comment>Shown on the home page</comment> </data> <data name="Goodbye" xml:space="preserve"> <value>See you later</value> </data></root>.xliff
瞭解更多信息 OASIS XLIFF 2.0 文件。 翻譯每個<source>並將結果寫入相應的<target>,為該語言設定trgLang。
<?xml version="1.0" encoding="utf-8"?><xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en"> <file id="ui"> <unit id="greeting"> <segment> <source>Hello, world!</source> </segment> </unit> </file></xliff>.po
瞭解更多信息 GNU gettext 可移植物件檔案。 將每個msgid/msgid_plural翻譯成msgstr/msgstr[n]形式。
msgid ""msgstr """Content-Type: text/plain; charset=UTF-8\n"
msgid "Hello, world!"msgstr ""
msgid "%d apple"msgid_plural "%d apples"msgstr[0] ""msgstr[1] "".json
瞭解更多信息 任意JSON檔案。 嵌套嘅物件會用[--]分隔符號壓平以進行翻譯,然後喺輸出時重新嵌套。 虛線鍵("unit.dotted.key")會逐字保留。
{ "app": { "title": "Resource Translator", "tagline": "Localize your repo on every commit" }, "buttons": { "save": "Save", "cancel": "Cancel" }}.ini
瞭解更多信息 簡單key=value檔案(Win32 式 INI 或任何平面配置)。 章節標題同註釋會保留。
# Display strings[ui]greeting=Hello, world!goodbye=See you later
[errors]not_found=The resource you requested was not found..restext
瞭解更多信息 Microsoft MUI 文字資源 — 扁平key=value對,用作.resx的文字伴侶。
Greeting=Hello, world!Goodbye=See you laterNotFound=The resource you requested was not found.來回保證
測試套件驗證每種格式的代表性夾具的位元組對位元組往返。 如果格式怪異破壞咗你嘅程式碼庫中嘅往返,請用最少嘅樣本開期。