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']"/>
in my item-view.xsl
?
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>
Am I missing something?
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']"/>
solved my issue.
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
.
来源:https://stackoverflow.com/questions/32042118/how-can-i-capture-current-or-active-locale-in-dspace-xmlui