Hi Karen,

I have succeeded to add it to manakin with the following patches.
I am using "Kuburick" theme.

Hope this helps you.

Keiji Suzuki
Ebetsu, Japan

====== from this =================

--- 
/home/dspace/dspace-1.5.1-source/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/DSpaceLocaleAction.java
    2008-09-26
12:43:10.000000000 +0900
+++ DSpaceLocaleAction.java     2008-10-17 21:58:08.000000000 +0900
@@ -48,6 +48,8 @@
 import org.apache.cocoon.i18n.I18nUtils.LocaleValidator;
 import org.dspace.core.ConfigurationManager;
 import org.dspace.core.I18nUtil;
+import org.dspace.core.Context;
+import org.dspace.app.xmlui.utils.ContextUtil;

 import java.util.ArrayList;
 import java.util.HashMap;
@@ -126,10 +128,13 @@
                               "locale-attribute",
                               localeStr,
                               false,
-                              false,
+                              true,
                               false,
                               false);

+       Context context = ContextUtil.obtainContext(objectModel);
+       context.setCurrentLocale(locale);
+
         // Set up a map for sitemap parameters
         Map map = new HashMap();
         map.put("language", locale.getLanguage());

--- 
/home/dspace/dspace-1.5.1-source/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser/Navigation.java
    2008-09-26
12:43:08.000000000 +0900
+++ Navigation.java     2008-10-17 15:14:56.000000000 +0900
@@ -44,6 +44,7 @@
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Locale;

 import org.apache.cocoon.caching.CacheableProcessingComponent;
 import org.apache.cocoon.environment.ObjectModelHelper;
@@ -67,6 +68,7 @@
 import org.dspace.content.DSpaceObject;
 import org.dspace.content.Item;
 import org.dspace.core.ConfigurationManager;
+import org.dspace.core.I18nUtil;
 import org.xml.sax.SAXException;

 /**
@@ -220,6 +222,13 @@
         pageMeta.addMetadata("page","contactURL").addContent(contextPath
+ "/contact");
         pageMeta.addMetadata("page","feedbackURL").addContent(contextPath
+ "/feedback");

+        Locale[] locales = I18nUtil.getSupportedLocales();
+        for (int i=0; i < locales.length; i++)
+        {
+            pageMeta.addMetadata("page",
"supportedLocale").addContent(locales[i].getLanguage());
+       }
+        
pageMeta.addMetadata("page","currentLocale").addContent(context.getCurrentLocale().getLanguage());
+
         DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
         if (dso != null)
         {

--- 
/home/dspace/dspace-1.5.1-source/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Kubrick/Kubrick.xsl
        2008-09-26
12:43:12.000000000 +0900
+++ Kubrick.xsl 2008-10-17 21:49:21.000000000 +0900
@@ -142,6 +142,24 @@
     -->
     <xsl:template match="dri:options">
         <div id="sidebar">
+
+          <h3 id="ds-language-selector"
class="ds-language-selector"><i18n:text>xmlui.general.language</i18n:text></h3>
+
+            <form method="get" name="repost" action=""
style="display: inline;">
+               <input type ="hidden" name ="locale-attribute"/>
+               <select name="lang" id="tlang"
onchange="javascript:document.forms['repost']['locale-attribute'].value=this.value;document.repost.submit();">
+                 <xsl:for-each
select="/dri:document/dri:meta/dri:pageMeta/dri:[EMAIL PROTECTED]'page'[EMAIL 
PROTECTED]'supportedLocale']">
+                    <option>
+                      <xsl:attribute name="value"><xsl:value-of
select="."/></xsl:attribute>
+                      <xsl:if
test=".=/dri:document/dri:meta/dri:pageMeta/dri:[EMAIL PROTECTED]'page'[EMAIL 
PROTECTED]'currentLocale']">
+                        <xsl:attribute name="selected">selected</xsl:attribute>
+                      </xsl:if>
+                      <i18n:text><xsl:value-of
select="concat('xmlui.general.language.', .)"/></i18n:text>
+                    </option>
+                 </xsl:for-each>
+               </select>
+            </form>
+
             <h3 id="ds-search-option-head"
class="ds-option-set-head"><i18n:text>xmlui.dri2xhtml.structural.search</i18n:text></h3>
             <div id="ds-search-option" class="ds-option-set">
                 <!-- The form, complete with a text box and a button,
all built from attributes referenced

=======

2008/10/16 Janssens Karen <[EMAIL PROTECTED]>:
> Hi all
>
> We want our Manakin (on DSpace 1.5.1) to support tw locales: english and
> dutch.
> Manakin selects the locale depending on the brwoser settings. This will
> not always be the one preferred by the end user (eg in a library
> different users are using the same pc).
>
> Has anyone tried (and succeeded) to add a 'switch' to manakin? Eg if
> you're in the ducht interface, a link 'English' brings you to the
> english one and vice versa. Or something similar...
>
> Thanks!
> Karen
>
>
> --
> Karen Janssens
> Universiteit Antwerpen
> Anet - Bibliotheekautomatisering
> Bibliotheek Stadscampus
> Prinsstraat 9
> B-2000 Antwerpen
> Belgium
> Tel    +32 3 220.49.71
> Email  [EMAIL PROTECTED]
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to