如何在 DSpace XMLUI 中捕获当前或活动的语言环境? [英] How can I capture current or active locale in DSpace XMLUI?
问题描述
我在 dspace.cfg
webui.supported.locales = en, fr, zh
中有这个设置.我想知道如果我使用:
I have this setting in dspace.cfg
webui.supported.locales = en, fr, zh
. I wonder why I can't get the active or current locale if I use:
<xsl:value-of
select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='currentLocale']"/>
在我的 item-view.xsl
中?
查看页面例如http://localhost:8080/DRI/handle/123456789/10476?locale-attribute=fr
,很明显在:
Viewing the page eg http://localhost:8080/DRI/handle/123456789/10476?locale-attribute=fr
, it is obviously there in:
<metadata element="page" qualifier="currentLocale">fr</metadata>
我错过了什么吗?
推荐答案
显然,在 global-variables.xsl
中的一个变量中声明这个,例如
Apparently, declaring this in a variable in the global-variables.xsl
eg
<xsl:variable name="active-locale" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='currentLocale']"/>
解决了我的问题.
我现在可以捕获当前/活动的语言环境.我仍然不知道如果我只是在 item-view.xsl
中使用和声明变量,为什么它不起作用.
I can now capture the current/active locale. I still don't know why it won't work if I just use and declare the variable in item-view.xsl
.
这篇关于如何在 DSpace XMLUI 中捕获当前或活动的语言环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!