我已经根据文档安装了所有东西。根据文档,有些事情正在工作。如果您选择那些 lang ,是否有类似 Django 翻译的东西会自动替换特定语言的翻译?
索引.html
<!DOCTYPE HTML>
<html>
{% load static %}
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script>
<script src="{% static 'first.js'%}"></script>
<script src="{% static '/angular-gettext/dist/angular-gettext.js'%}"></script>
<script type="text/javascript" >
angular.module('first').run(function (gettextCatalog) {
gettextCatalog.setCurrentLanguage('fr');
gettextCatalog.debug = true;
gettextCatalog.setStrings('fr', {
"Hello!":"Bonjour !"});
});
</script>
</head>
<body>
<div ng-app="first">
<translate>Hello!</translate> Sagar
<h1 translate>Hello!</h1>
</div>
</body>
</html>
采购订单文件
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"X-Generator: Poedit 2.2.3\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr\n"
#: ui/templates/admin/firsttranslate/index.html:24
#: ui/templates/admin/firsttranslate/index.html:26
msgid "Hello!"
msgstr "Halo !"
当我运行我的代码时,它会搜索 Hello 并替换为Bonjour但我希望它自动替换,因为 Django 提前致谢。