我正在创建一个symfony 1.4应用程序,其中包含sfGuardDoctrinePlugin。 为了管理用户,我使用了管理生成器:
generator:
class: sfDoctrineGenerator
param:
model_class: sfGuardUser
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: utilisateur
with_doctrine_route: true
config:
fields:
first_name: { label: "Prénom" }
last_name: { label: "Nom" }
username: { label: "Login" }
password: { label: "Mot de passe" }
password_again: { label: "Confirmation" }
email_address: { label: "E-mail" }
is_active: { label: "Actif" }
last_login: { label: "Dernière cnx" }
# groups_list: { label: "Groupes" }
permissions_list: { label: "Permissions" }
list:
title: Liste des utilisateurs
display: [=username, first_name, last_name, is_active, last_login]
filter:
class: false
form:
class: sfGuardUserAdminForm
display:
"Utilisateur": [first_name, last_name, email_address, username, password, password_again]
"Permissions": [is_active, permissions_list]
edit:
title: Modifier l'utilisateur "%%username%%"
new:
title: Nouvel utilisateur
一切都很好,但我无法翻译last_login,email_address和is_active字段,如字段部分所配置。
有你的想法吗?
提前致谢,
热雷米
答案 0 :(得分:0)
我认为您可以编辑翻译,例如
app/backend/i18n/fr/messages.xml
就我而言:
<!-- sfGuardUser user form -->
<trans-unit id="6">
<source>User</source>
<target>Користувач</target>
</trans-unit>
<trans-unit id="7">
<source>First name</source>
<target>Ім'я</target>
</trans-unit>
<trans-unit id="8">
<source>Last name</source>
<target>Прізвище</target>
</trans-unit>
<trans-unit id="9">
<source>Email address</source>
<target>Email</target>
</trans-unit>
<trans-unit id="10">
<source>Password (again)</source>
<target>Пароль (знову)</target>
</trans-unit>
<trans-unit id="11">
<source>Permissions and groups</source>
<target>Права та групи</target>
</trans-unit>
<trans-unit id="12">
<source>Is active</source>
<target>Активний</target>
</trans-unit>
<trans-unit id="13">
<source>Is super admin</source>
<target>Супер адмін</target>
</trans-unit>
<trans-unit id="14">
<source>Groups</source>
<target>Групи</target>
</trans-unit>
<trans-unit id="15">
<source>Permissions</source>
<target>Права</target>
</trans-unit>
<!-- End sfGuardUser user form -->
不要忘记清除缓存。