我試圖實現國際化支持我的項目爲這個人建議谷歌關閉模板。但是對於模板非常新。封閉模板試圖獲得語言特定的消息但沒有獲得xlf文件。如果任何人知道如何使用閉包模板生成特定於語言的消息,請告訴我步驟,這對我很有幫助。如何使用谷歌封閉模板獲取語言特定的消息
我的.soy文件代碼如下。
{namespace poc}
/**
*Testing message translation
*@param pageTitle
*/
{template .translate}
<HTML>
<Head>
<title>{$pageTitle}
</title>
</head>
<div>
{msg desc="Hello"}Hello{/msg}
</div>
</html>
{/template}
and generated .xlf content as bellow
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="SoyMsgBundle" datatype="x-soy-msg-bundle" xml:space="preserve" source-language="en" target-language="pt-BR">
<body>
<trans-unit id="2286494898080570401" datatype="html">
<source>Thanks</source>
<target/>
<note priority="1" from="description">Says thanks</note>
</trans-unit>
</body>
</file>
</xliff>