Author: erwan
Date: Thu Apr 22 13:50:24 2010 New Revision: 936845 URL: http://svn.apache.org/viewvc?rev=936845&view=rev Log: Enabling localization for portal page names, adding the CommonPortalEntityLabels file Added: ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml (with props) Modified: ofbiz/trunk/framework/common/entitydef/entitymodel.xml ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java Added: ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml?rev=936845&view=auto ============================================================================== --- ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml (added) +++ ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml Thu Apr 22 13:50:24 2010 @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <property key="PortalPage.portalPageName.10000"> + <value xml:lang="en">My Tasks</value> + <value xml:lang="fr">Mes tâches</value> + </property> + <property key="PortalPage.portalPageName.10010"> + <value xml:lang="en">My Comms</value> + <value xml:lang="fr">Mes communications</value> + </property> + <property key="PortalPage.portalPageName.10011"> + <value xml:lang="en">Other Party Comms</value> + <value xml:lang="fr">Autres communications</value> + </property> + <property key="PortalPage.portalPageName.MYPORTAL_EMPLOYEE"> + <value xml:lang="en">Main</value> + <value xml:lang="fr">Accueil</value> + </property> + <property key="PortalPage.portalPageName.MYPORTAL_EMPLOYEE1"> + <value xml:lang="en">My Profile</value> + <value xml:lang="fr">Mon profil</value> + </property> + <property key="PortalPage.portalPageName.MYPORTAL_EMPLOYEE4"> + <value xml:lang="en">My Time Sheet</value> + <value xml:lang="fr">Mes feuilles de temps</value> + </property> +</resource> \ No newline at end of file Propchange: ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/common/config/CommonPortalEntityLabels.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/framework/common/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/entitydef/entitymodel.xml?rev=936845&r1=936844&r2=936845&view=diff ============================================================================== --- ofbiz/trunk/framework/common/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/framework/common/entitydef/entitymodel.xml Thu Apr 22 13:50:24 2010 @@ -668,7 +668,8 @@ under the License. <key-map field-name="portletCategoryId"/> </relation> </entity> - <entity entity-name="PortalPage" package-name="org.ofbiz.common.portal" title="Defines a Portal Page"> + <entity entity-name="PortalPage" package-name="org.ofbiz.common.portal" title="Defines a Portal Page" + default-resource-name="CommonPortalEntityLabels"> <field name="portalPageId" type="id-ne"></field> <field name="portalPageName" type="name"></field> <field name="description" type="description"></field> Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java?rev=936845&r1=936844&r2=936845&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java Thu Apr 22 13:50:24 2010 @@ -22,6 +22,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import javax.xml.parsers.ParserConfigurationException; @@ -275,6 +276,7 @@ public class ModelMenuItem { passed = false; } } + Locale locale = (Locale) context.get("locale"); //Debug.logInfo("in ModelMenu, name:" + this.getName(), module); if (passed) { ModelMenuAction.runSubActions(this.actions, context); @@ -285,7 +287,7 @@ public class ModelMenuItem { if (UtilValidate.isNotEmpty(portalPage.getString("portalPageName"))) { ModelMenuItem localItem = new ModelMenuItem(this.getModelMenu()); localItem.name = portalPage.getString("portalPageId"); - localItem.setTitle(portalPage.getString("portalPageName")); + localItem.setTitle((String) portalPage.get("portalPageName", locale)); localItem.link = new Link(this); List<WidgetWorker.Parameter> linkParams = localItem.link.getParameterList(); linkParams.add(new WidgetWorker.Parameter("portalPageId", portalPage.getString("portalPageId"), false)); @@ -296,7 +298,7 @@ public class ModelMenuItem { } else { localItem.link.setTarget("showPortalPage"); } - localItem.link.setText(portalPage.getString("portalPageName")); + localItem.link.setText((String)portalPage.get("portalPageName", locale)); menuStringRenderer.renderMenuItem(writer, context, localItem); } } |
Free forum by Nabble | Edit this page |