Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
plone.app.multilanguage:Access Translated Object';s属性_Plone - Fatal编程技术网

plone.app.multilanguage:Access Translated Object';s属性

plone.app.multilanguage:Access Translated Object';s属性,plone,Plone,环境:Plone 4.3.3,Plone.app.multilingual 2.0a4(从github签出),在我的情况下,启用了两种语言(en和zh),即双语站点 My有一个字段remoteUrl,其定义如下: <field name="remoteUrl" type="zope.schema.TextLine"> <title i18n:translate="">URL</title> <description i18n:translate

环境:Plone 4.3.3,Plone.app.multilingual 2.0a4(从github签出),在我的情况下,启用了两种语言(en和zh),即双语站点

My有一个字段
remoteUrl
,其定义如下:

<field name="remoteUrl"
 type="zope.schema.TextLine">
  <title i18n:translate="">URL</title>
  <description i18n:translate="">Link to the Resource.</description>
  <default>http://</default>
  <required>False</required>
</field>

统一资源定位地址
链接到资源。
http://
假的
我的场景是这样的:当在zh文件夹(zh/My_item)中创建项目时,
remoteUrl
字段被填充,它将根据需要显示。然后,在将项目翻译成en语言(en/my_项目)时,如果en/my_项目中未填充
remoteUrl
字段,我希望它显示zh/my_项目的值。另一方面,如果填写en/my_项,则其值将用于
remoteUrl
字段并显示


现有的不符合我的需要,因为填充值将影响两个zh/en项目。如何从en/my_项目上下文访问zh/my_项目
remoteUrl
值?对于视图类/模板的任何提示或示例片段,我们将不胜感激。

如果您只想显示另一种语言的替代值,可以从catalog index TranslationGroup访问翻译。只是个主意