如何在 actions.xml 中使用/翻译 (url_expr/available_expr)?
我通常的方法是为每种语言制作一个单独的“对象”:
<object name="contact" meta_type="CMF Action" i18n:domain="my.theme">
<property name="title" i18n:translate="">Contact</property>
<property name="description" i18n:translate=""></property>
<property
name="url_expr">string:${globals_view/navigationRootUrl}/contact</property>
<property name="icon_expr"></property>
<property name="available_expr">python:request.LANGUAGE == 'en'</property>
</object>
<object name="contact-de" meta_type="CMF Action" i18n:domain="my.theme">
<property name="title" i18n:translate="">Contact</property>
<property name="description" i18n:translate=""></property>
<property
name="url_expr">string:${globals_view/navigationRootUrl}/kontakt</property>
<property name="icon_expr"></property>
<property name="available_expr">python:request.LANGUAGE == 'de'</property>
</object>