From c25964196a5069547f4796c64c84e9fb6926e215 Mon Sep 17 00:00:00 2001 From: pb Date: Sun, 9 Jun 2013 17:46:52 +0000 Subject: [PATCH] =?UTF-8?q?Anpassung=20und=20Vervollst=C3=A4ndigung=20Reso?= =?UTF-8?q?urceBundles=20sowie=20Sprachumschaltung=20abgeschlossen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2194 8810af33-2d31-482b-a856-94f89814c4df --- .../contenttypes/MinutesResources.properties | 6 ++- .../MinutesResources_de.properties | 4 ++ .../MinutesResources_en_GB.properties | 5 +++ .../MinutesResources_fr.properties | 5 +++ .../ui/MinutesPropertiesStep.java | 36 +++++++++++---- .../contenttypes/ui/MinutesPropertyForm.java | 19 +++++--- .../util/MinutesGlobalizationUtil.java | 44 +++++++++++++++++++ 7 files changed, 103 insertions(+), 16 deletions(-) create mode 100755 ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_en_GB.properties create mode 100755 ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_fr.properties create mode 100644 ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/util/MinutesGlobalizationUtil.java diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources.properties b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources.properties index 6e2418af7..3c5d2321c 100755 --- a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources.properties +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources.properties @@ -1 +1,5 @@ -minutes.authoring.basic_properties.description=Edit the title, name, attendees, note taker and apologies of minutes \ No newline at end of file +minutes.authoring.basic_properties.description=Edit the title, name, attendees, note taker and apologies of minutes +cms.contenttypes.ui.minutes.reference=Reference: +cms.contenttypes.ui.minutes.action_item=Action Item: +cms.contenttypes.ui.minutes.attendees=Attendees: +cms.contenttypes.ui.minutes.description_of=Description of Minutes: diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_de.properties b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_de.properties index 9be279371..ee6bd6d14 100644 --- a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_de.properties +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_de.properties @@ -1 +1,5 @@ minutes.authoring.basic_properties.description=Editieren von Titel, Name, Teilnehmer, etc. +cms.contenttypes.ui.minutes.reference=Referenz: +cms.contenttypes.ui.minutes.action_item=Aktionselement: +cms.contenttypes.ui.minutes.attendees=Teilnehmer: +cms.contenttypes.ui.minutes.description_of=Beschreibung der Tagesordnungspunkte: diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_en_GB.properties b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_en_GB.properties new file mode 100755 index 000000000..3c5d2321c --- /dev/null +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_en_GB.properties @@ -0,0 +1,5 @@ +minutes.authoring.basic_properties.description=Edit the title, name, attendees, note taker and apologies of minutes +cms.contenttypes.ui.minutes.reference=Reference: +cms.contenttypes.ui.minutes.action_item=Action Item: +cms.contenttypes.ui.minutes.attendees=Attendees: +cms.contenttypes.ui.minutes.description_of=Description of Minutes: diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_fr.properties b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_fr.properties new file mode 100755 index 000000000..b59ff5ff5 --- /dev/null +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/MinutesResources_fr.properties @@ -0,0 +1,5 @@ +minutes.authoring.basic_properties.description=Edit the title, name, attendees, note taker and apologies of minutes +cms.contenttypes.ui.minutes.reference=R\u00e9ference +cms.contenttypes.ui.minutes.action_item=Action de l'\u00e9l\u00e9ment +cms.contenttypes.ui.minutes.attendees=Participants: +cms.contenttypes.ui.minutes.description_of=Description de la r\u00e9union diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertiesStep.java b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertiesStep.java index 650973b6c..889ec6574 100755 --- a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertiesStep.java +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertiesStep.java @@ -25,6 +25,7 @@ import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.Minutes; +import com.arsdigita.cms.contenttypes.util.MinutesGlobalizationUtil; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.domain.DomainObject; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; @@ -75,10 +76,15 @@ public class MinutesPropertiesStep extends SimpleEditStep { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.name"), Minutes.NAME); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.title"), Minutes.TITLE); + sheet.add( GlobalizationUtil + .globalize("cms.contenttypes.ui.title"), + Minutes.TITLE); + sheet.add( GlobalizationUtil + .globalize("cms.contenttypes.ui.name"), + Minutes.NAME); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"), + sheet.add(GlobalizationUtil + .globalize("cms.contenttypes.ui.launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { public String format(DomainObject item, @@ -89,16 +95,28 @@ public class MinutesPropertiesStep extends SimpleEditStep { return DateFormat.getDateInstance(DateFormat.LONG) .format(page.getLaunchDate()); } else { - return (String)GlobalizationUtil.globalize("cms.ui.unknown").localize(); + return (String)GlobalizationUtil + .globalize("cms.ui.unknown") + .localize(); } } }); } - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.reference"), Minutes.MINUTE_NUMBER); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.description"), Minutes.DESCRIPTION); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.action_item"), Minutes.ACTION_ITEM); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.attendees"), Minutes.ATTENDEES); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.ui.description_of_minutes"), Minutes.DESCRIPTION_OF_MINUTES); + sheet.add( MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.reference"), + Minutes.MINUTE_NUMBER); + sheet.add( GlobalizationUtil + .globalize("cms.contenttypes.ui.description"), + Minutes.DESCRIPTION); + sheet.add( MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.action_item"), + Minutes.ACTION_ITEM); + sheet.add( MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.attendees"), + Minutes.ATTENDEES); + sheet.add( MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.description_of"), + Minutes.DESCRIPTION_OF_MINUTES); return sheet; } diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertyForm.java b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertyForm.java index 9310e2590..745f55e25 100755 --- a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertyForm.java +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/ui/MinutesPropertyForm.java @@ -30,6 +30,7 @@ import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.Minutes; +import com.arsdigita.cms.contenttypes.util.MinutesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.util.GlobalizationUtil; @@ -73,7 +74,8 @@ public class MinutesPropertyForm extends BasicPageForm * Minutes to work on * @param step The MinutesPropertiesStep which controls this form. */ - public MinutesPropertyForm( ItemSelectionModel itemModel, MinutesPropertiesStep step ) { + public MinutesPropertyForm( ItemSelectionModel itemModel, + MinutesPropertiesStep step ) { super( ID, itemModel ); m_step = step; addSubmissionListener(this); @@ -85,35 +87,40 @@ public class MinutesPropertyForm extends BasicPageForm protected void addWidgets() { super.addWidgets(); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.reference"))); + add(new Label(MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.reference"))); ParameterModel minuteNumberParam = new StringParameter(MINUTE_NUMBER); TextArea minuteNumber = new TextArea(minuteNumberParam); minuteNumber.setCols(40); minuteNumber.setRows(3); add(minuteNumber); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.description"))); + add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.description"))); ParameterModel descriptionParam = new StringParameter(DESCRIPTION); TextArea description = new TextArea(descriptionParam); description.setCols(40); description.setRows(5); add(description); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.action_item"))); + add(new Label(MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.action_item"))); ParameterModel actionItemParam = new StringParameter(ACTION_ITEM); TextArea actionItem = new TextArea(actionItemParam); actionItem.setCols(40); actionItem.setRows(3); add(actionItem); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.attendees"))); + add(new Label(MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.attendees"))); ParameterModel attendeesParam = new StringParameter(ATTENDEES); TextArea attendees = new TextArea(attendeesParam); attendees.setCols(40); attendees.setRows(3); add(attendees); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.description_of_minutes"))); + add(new Label(MinutesGlobalizationUtil + .globalize("cms.contenttypes.ui.minutes.description_of"))); ParameterModel descriptionOfMinutesParam = new StringParameter(DESCRIPTION_OF_MINUTES); TextArea descriptionOfMinutes = new TextArea(descriptionOfMinutesParam); diff --git a/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/util/MinutesGlobalizationUtil.java b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/util/MinutesGlobalizationUtil.java new file mode 100644 index 000000000..a2c4d8e8e --- /dev/null +++ b/ccm-cms-types-minutes/src/com/arsdigita/cms/contenttypes/util/MinutesGlobalizationUtil.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 Jens Pelzetter + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package com.arsdigita.cms.contenttypes.util; + +import com.arsdigita.globalization.Globalized; +import com.arsdigita.globalization.GlobalizedMessage; + +/** + * Compilation of methods to simplify the handling of globalizing keys. + * Basically it adds the name of package's resource bundle files to the + * globalize methods and forwards to GlobalizedMessage, shortening the + * method invocation in the various application classes. + * + */ +public class MinutesGlobalizationUtil implements Globalized { + + /** Name of Java resource files to handle Member's globalisation. */ + final public static String BUNDLE_NAME = + "com.arsdigita.cms.contenttypes.MinutesResources"; + + public static GlobalizedMessage globalize (String key) { + return new GlobalizedMessage(key, BUNDLE_NAME); + } + + public static GlobalizedMessage globalize (String key, Object[] args) { + return new GlobalizedMessage(key, BUNDLE_NAME, args); + } +}