Author: jleroux
Date: Thu Sep 4 02:41:43 2008 New Revision: 691953 URL: http://svn.apache.org/viewvc?rev=691953&view=rev Log: Patches from Bruno Busco & Bilgin Ibryam "List and Multi form pagination labels are not localized" (https://issues.apache.org/jira/browse/OFBIZ-1922) - OFBIZ-1922 Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml ofbiz/trunk/framework/widget/dtd/widget-form.xsd ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=691953&r1=691952&r2=691953&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Thu Sep 4 02:41:43 2008 @@ -2260,6 +2260,8 @@ <property key="CommonFirst"> <value xml:lang="de">Erster</value> <value xml:lang="en">First</value> + <value xml:lang="it">Primo</value> + <value xml:lang="fr">Premier</value> <value xml:lang="th">à¸à¸±à¸à¸à¸±à¸à¹à¸£à¸</value> </property> <property key="CommonFollowingErrorsOccurred"> @@ -3056,6 +3058,7 @@ <value xml:lang="de">Letzter</value> <value xml:lang="en">Last</value> <value xml:lang="fr">Dernier</value> + <value xml:lang="it">Ultimo</value> <value xml:lang="th">สุà¸à¸à¹à¸²à¸¢</value> </property> <property key="CommonLastUpdated"> @@ -4931,6 +4934,7 @@ <value xml:lang="de">Zeilen</value> <value xml:lang="en">rows</value> <value xml:lang="fr">lignes</value> + <value xml:lang="it">righe</value> <value xml:lang="th">à¹à¸à¸§</value> </property> <property key="CommonRun"> @@ -5443,7 +5447,7 @@ <value xml:lang="de">Sortiert nach</value> <value xml:lang="en">Sorted By</value> <value xml:lang="fr">Triés par</value> - <value xml:lang="it">Ordinato Per</value> + <value xml:lang="it">Ordinato per</value> <value xml:lang="pt">Listar por</value> <value xml:lang="ro">Ordinat Pe</value> <value xml:lang="ru">СоÑÑиÑовка по</value> Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=691953&r1=691952&r2=691953&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Thu Sep 4 02:41:43 2008 @@ -125,16 +125,16 @@ <xs:annotation><xs:documentation>The total number of rows in the original list (used for pagination). If not specified, the size of the list will be used. Accepts ${} notation.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute type="xs:string" name="paginate-first-label"> - <xs:annotation><xs:documentation>Text to display for the [First] button in a form with pagination. Defaults to "First". Accepts ${} notation.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Text to display for the [First] button in a form with pagination. Defaults to the CommonFirst label defined in CommonUiLabels.xml. Accepts ${} notation.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute type="xs:string" name="paginate-previous-label"> - <xs:annotation><xs:documentation>Text to display for the [Previous] button in a form with pagination. Defaults to "Previous". Accepts ${} notation.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Text to display for the [Previous] button in a form with pagination. Defaults to the CommonPrevious label defined in CommonUiLabels.xml. Accepts ${} notation.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute type="xs:string" name="paginate-next-label"> - <xs:annotation><xs:documentation>Text to display for the [Next] button in a form with pagination. Defaults to "Next". Accepts ${} notation.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Text to display for the [Next] button in a form with pagination. Defaults to the CommonNext label defined in CommonUiLabels.xml. Accepts ${} notation.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute type="xs:string" name="paginate-last-label"> - <xs:annotation><xs:documentation>Text to display for the [Last] button in a form with pagination. Defaults to "Last". Accepts ${} notation.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Text to display for the [Last] button in a form with pagination. Defaults to the CommonLast label defined in CommonUiLabels.xml. Accepts ${} notation.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute type="xs:string" name="paginate-style"> <xs:annotation><xs:documentation>CSS style to use for the whole pager in a form with pagination. Defaults to "nav-pager".</xs:documentation></xs:annotation> Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=691953&r1=691952&r2=691953&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Thu Sep 4 02:41:43 2008 @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; @@ -169,10 +170,6 @@ protected int defaultViewSize = DEFAULT_PAGE_SIZE; public static String DEFAULT_PAG_INDEX_FIELD = "viewIndex"; public static String DEFAULT_PAG_SIZE_FIELD = "viewSize"; - public static String DEFAULT_PAG_FIRST_LABEL = "First"; - public static String DEFAULT_PAG_PREV_LABEL = "Previous"; - public static String DEFAULT_PAG_NEXT_LABEL = "Next"; - public static String DEFAULT_PAG_LAST_LABEL = "Last"; public static String DEFAULT_PAG_STYLE = "nav-pager"; public static String DEFAULT_PAG_FIRST_STYLE = "nav-first"; public static String DEFAULT_PAG_PREV_STYLE = "nav-previous"; @@ -2308,33 +2305,37 @@ } public String getPaginateFirstLabel(Map<String, Object> context) { + Locale locale = (Locale)context.get("locale"); String field = this.paginateFirstLabel.expandString(context); if (UtilValidate.isEmpty(field)) { - field = DEFAULT_PAG_FIRST_LABEL; + field = UtilProperties.getMessage("CommonUiLabels", "CommonFirst", locale); } return field; } public String getPaginatePreviousLabel(Map<String, Object> context) { + Locale locale = (Locale)context.get("locale"); String field = this.paginatePreviousLabel.expandString(context); if (UtilValidate.isEmpty(field)) { - field = DEFAULT_PAG_PREV_LABEL; + field = UtilProperties.getMessage("CommonUiLabels", "CommonPrevious", locale); } return field; } public String getPaginateNextLabel(Map<String, Object> context) { + Locale locale = (Locale)context.get("locale"); String field = this.paginateNextLabel.expandString(context); if (UtilValidate.isEmpty(field)) { - field = DEFAULT_PAG_NEXT_LABEL; + field = UtilProperties.getMessage("CommonUiLabels", "CommonNext", locale); } return field; } public String getPaginateLastLabel(Map<String, Object> context) { + Locale locale = (Locale)context.get("locale"); String field = this.paginateLastLabel.expandString(context); if (UtilValidate.isEmpty(field)) { - field = DEFAULT_PAG_LAST_LABEL; + field = UtilProperties.getMessage("CommonUiLabels", "CommonLast", locale); } return field; } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java?rev=691953&r1=691952&r2=691953&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Thu Sep 4 02:41:43 2008 @@ -39,6 +39,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -2242,15 +2243,13 @@ // needed for the "Page" and "rows" labels Map uiLabelMap = (Map) context.get("uiLabelMap"); String pageLabel = ""; - String rowsLabel = ""; - String ofLabel = ""; + String commonDisplaying = ""; if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); } else { pageLabel = (String) uiLabelMap.get("CommonPage"); - rowsLabel = (String) uiLabelMap.get("CommonRows"); - ofLabel = (String) uiLabelMap.get("CommonOf"); - ofLabel = ofLabel.toLowerCase(); + Map<String, Integer> messageMap = UtilMisc.toMap("lowCount", Integer.valueOf(lowIndex + 1), "highCount", Integer.valueOf(lowIndex + actualPageSize), "total", Integer.valueOf(listSize)); + commonDisplaying = UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", messageMap, (Locale) context.get("locale")); } // for legacy support, the viewSizeParam is VIEW_SIZE and viewIndexParam is VIEW_INDEX when the fields are "viewSize" and "viewIndex" @@ -2367,12 +2366,14 @@ i = page * viewSize; } writer.append("</select></li>"); - writer.append("<li>"); - writer.append(Integer.toString((lowIndex + 1)) + " - " + Integer.toString((lowIndex + actualPageSize)) + " " + ofLabel + " " + Integer.toString(listSize) + " " + rowsLabel); - writer.append("</li>"); - appendWhitespace(writer); } + // show row count + writer.append("<li>"); + writer.append(commonDisplaying); + writer.append("</li>"); + appendWhitespace(writer); + // Next button writer.append(" <li class=\"" + modelForm.getPaginateNextStyle()); if (highIndex < listSize) { |
Free forum by Nabble | Edit this page |