Hi Robert,

I  have succeeded to make input_form in JSPUI to i18n with
the attached patches.

I hope it helps you. Thank you.

Keiji Suzuki
[EMAIL PROTECTED]

2008/7/9 Claudia Jürgen <[EMAIL PROTECTED]>:
> Hi Robert,
>
> I did not investigate the changes along with the Customizable Submission
> Interface (CSS) closely, I'll take a look as soon as I find some time.
>
> Claudia
>
>
> Robert Roggenbuck schrieb:
>> Oops...
>>
>> so, is it a matter of reformulating CSS or hacking Java / JSP? Is it a
>> big thing to do? Will this be fixed in 1.5.1?
>>
>> Greetings
>>
>> Robert
>>
>>
>> Claudia Jürgen schrieb:
>>> Hi all,
>>>
>>> the introduction of CSS removed the i18n of the submission, so at the
>>> moment the input-form is not selected based on your language settings.
>>>
>>> cheers
>>>
>>> Claudia
>>>
>>>
>>> Robert Roggenbuck schrieb:
>>>> Hi Mikel,
>>>>
>>>> I did not solved the problem complete, but I had some success:
>>>>
>>>> 1. My 'ant init_configs' does not copy all files in the main
>>>> directory of DSpace. I must copy the input-forms*.xml manually.
>>>>
>>>> 2. To get the right forms selected You have to mention them in the
>>>> workflow configuration item-submission.xml .
>>>>
>>>> Now my modified input form is used - but still only the English
>>>> version :-(
>>>>
>>>> Sorry for no further help - until now. Did You succeed in the meantime?
>>>>
>>>> Greetings
>>>>
>>>> Robert
>>>>
>>>> PS: In my case it's DSpace 1.5 and jspu too.
>>>>
>>>> ---
>>>>
>>>> Mikel Nin schrieb:
>>>>> Hi Robert,
>>>>>
>>>>>
>>>>>
>>>>> I'm having the same problem with the Spanish version of
>>>>> input-forms.xml.
>>>>> Although I have a Spanish version of input-forms.xml
>>>>> (input-forms_eu.xml)
>>>>> and default.license (default_es.license), both of them still
>>>>> continue in
>>>>> English. Did you managed to make it run properly?
>>>>>
>>>>>
>>>>>
>>>>> Greetings
>>>>>
>>>>>
>>>>>
>>>>> Mikel
>>>>
>>>>
>>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>
Index: dspace-api/src/main/java/org/dspace/submit/step/DescribeStep.java
===================================================================
--- dspace-api/src/main/java/org/dspace/submit/step/DescribeStep.java	(revision 169)
+++ dspace-api/src/main/java/org/dspace/submit/step/DescribeStep.java	(revision 170)
@@ -43,6 +43,7 @@
 import java.sql.SQLException;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -63,6 +64,7 @@
 import org.dspace.content.Item;
 import org.dspace.content.MetadataField;
 import org.dspace.core.Context;
+import org.dspace.core.I18nUtil;
 import org.dspace.submit.AbstractProcessingStep;
 
 /**
@@ -88,8 +90,11 @@
     private static Logger log = Logger.getLogger(DescribeStep.class);
 
     /** hash of all submission forms details */
-    private static DCInputsReader inputsReader;
+    private static DCInputsReader inputsReader = null;
 
+    /** locale  */
+    private static Locale langForm = null;
+
     /***************************************************************************
      * STATUS / ERROR FLAGS (returned by doProcessing() if an error occurs or
      * additional user interaction may be required)
@@ -346,9 +351,30 @@
     }
 
     /**
+     * @param context
+     *          The current context
      * 
      * @return the current DCInputsReader
      */
+    public static DCInputsReader getInputsReader(Context context) throws ServletException
+    {
+	Locale locale = context.getCurrentLocale();
+	
+        // load inputsReader only the first time
+        if ((inputsReader == null) || (langForm == null) || !langForm.equals(locale))
+        {
+            // read configurable submissions forms data
+            inputsReader = new DCInputsReader(I18nUtil.getInputFormsFileName(locale));
+	    langForm = locale;
+        }
+        
+        return inputsReader;
+    }
+
+    /**
+     * 
+     * @return the current DCInputsReader
+     */
     public static DCInputsReader getInputsReader() throws ServletException
     {
         // load inputsReader only the first time
Index: dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/submit/step/JSPDescribeStep.java
===================================================================
--- dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/submit/step/JSPDescribeStep.java	(revision 169)
+++ dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/submit/step/JSPDescribeStep.java	(revision 170)
@@ -232,7 +232,7 @@
         Collection c = subInfo.getSubmissionItem().getCollection();
 
         // requires configurable form info per collection
-        request.setAttribute("submission.inputs", DescribeStep.getInputsReader().getInputs(c
+        request.setAttribute("submission.inputs", DescribeStep.getInputsReader(context).getInputs(c
                 .getHandle()));
 
         // forward to edit-metadata JSP
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to