피라미드 프로젝트의 템플릿 파일에서 텍스트를 번역하려고합니다. 이 예와 같이 많거나 적습니다. http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/chameleon_i18n.html<동적 요소> 대신 태그가있는 POT 파일
이제 내 .pot 파일의 주석에 <dynamic element>
을 없애려면 어떻게해야합니까? 나머지 코드를 태그와 함께보고 싶습니다.
내 카멜레온 템플릿 (입니다 .Pt) :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="MyDomain">
<head>
...
</head>
<body>
<div i18n:translate="MyID">
This will appear in the comments.
<span>This will NOT.</span>
While this will again appear.
</div>
</body>
</html>
내 setup.py에서 다음 옵션과 함께 메시지를 추출하기 위해 바벨과 링구아을 사용
message_extractors = { '.': [
('**.py', 'lingua_python', None),
('**.pt', 'lingua_xml', None),
]}
그리고 관련 출력 내 .pot 파일은 다음과 같습니다.
#. Default: This will appear in the comments. <dynamic element> While this will
#. again appear.
#: myproject/templates/base.pt:10
msgid "MyID"
msgstr ""