From e44bbd4b281726f5cfbad432618b4ff068b6772b Mon Sep 17 00:00:00 2001 From: pb Date: Thu, 6 Jun 2013 00:34:00 +0000 Subject: [PATCH] =?UTF-8?q?Lokalisierung=20und=20Resource=20Bundles=20verv?= =?UTF-8?q?ollst=C3=A4ndigt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2175 8810af33-2d31-482b-a856-94f89814c4df --- .../src/com/arsdigita/cms/CMSResources.java | 18 ++++ .../com/arsdigita/cms/CMSResources.properties | 9 +- .../com/arsdigita/cms/CMSResources_de.java | 18 ++++ .../arsdigita/cms/CMSResources_de.properties | 15 ++-- .../com/arsdigita/cms/CMSResources_en_GB.java | 18 ++++ .../com/arsdigita/cms/CMSResources_fr.java | 18 ++++ .../arsdigita/cms/CMSResources_fr.properties | 8 +- .../cms/ui/authoring/BasicItemForm.java | 29 +++---- .../bebop/event/FormInitListener.java | 1 - .../bebop/parameters/StringParameter.java | 2 + .../globalization/MessageCatalog.java | 4 + .../MessageCatalogAddResource.java | 87 +++++++++++++++++++ .../globalization/MixedResourceBundle.java | 2 +- .../london/cms/dublin/DublinCoreItem.java | 25 +++++- .../london/cms/dublin/ui/DublinCoreEdit.java | 31 ++++--- .../cms/dublin/ui/DublinCoreFormSection.java | 8 +- 16 files changed, 234 insertions(+), 59 deletions(-) create mode 100644 ccm-cms/src/com/arsdigita/cms/CMSResources.java create mode 100644 ccm-cms/src/com/arsdigita/cms/CMSResources_de.java create mode 100644 ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.java create mode 100644 ccm-cms/src/com/arsdigita/cms/CMSResources_fr.java create mode 100644 ccm-core/src/com/arsdigita/globalization/MessageCatalogAddResource.java diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.java b/ccm-cms/src/com/arsdigita/cms/CMSResources.java new file mode 100644 index 000000000..f31022787 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms; + +import com.arsdigita.globalization.MixedResourceBundle; + +/** + * + * @author pb + */ +public class CMSResources extends MixedResourceBundle { + + public CMSResources() { + super(); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index 1025a52b9..fd8b7b28e 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -13,8 +13,6 @@ cms.instantiationexception=Instantiation Exception: cms.nosuchmethodexception=No-Such-Method Exception: cms.templates=Templates cms.title=Title -no=No -yes=Yes mime_type_jsp=JSP mime_type_xsl=XSL @@ -49,7 +47,6 @@ cms.contenttypes.link_to_map=Link to Map: cms.contenttypes.location=Location: cms.contenttypes.main_contributor=Main Contributor: cms.contenttypes.minutes_type_not_registered=Minutes type not registered -cms.contenttypes.news_date=Date: cms.contenttypes.newsitem_type_not_registered=NewsItem type not registered cms.contenttypes.no_content_section=No content section cms.contenttypes.no_section=No section @@ -64,7 +61,7 @@ cms.contenttypes.start_date=Start Date: cms.contenttypes.start_time=Start Time: cms.contenttypes.subjectitems=SubjectItems: cms.contenttypes.summary=Description: -cms.contenttypes.title=Title: +cms.contenttypes.title=Page Title: cms.contenttypes.template.body_text.title=Body text cms.contenttypes.template.body_text.description=Edit the body text cms.contenttypes.shared.assign_categories.title=Assign Categories @@ -113,7 +110,7 @@ cms.contenttypes.ui.lead_line=Description: cms.contenttypes.ui.link_to_map=Link to Map: cms.contenttypes.ui.location=Location: cms.contenttypes.ui.main_contributor=Main Contributor: -cms.contenttypes.ui.name=Name: +cms.contenttypes.ui.name=Name (URL stub): cms.contenttypes.ui.opening_times=Opening Times: cms.contenttypes.ui.person_specification=Person Specification: cms.contenttypes.ui.ref_code=Ref. Code: @@ -371,14 +368,12 @@ cms.ui.authoring.invalid_create_component=Creation component for parent content cms.ui.authoring.missing_content_type=Missing content type cms.ui.authoring.missing_item_id=Missing item id cms.ui.authoring.name=Name: -cms.ui.authoring.name_url=Name (URL): cms.ui.authoring.no_asset=No asset cms.ui.authoring.no_content_types_were_found=No content types were found cms.ui.authoring.no_current_wizard=No current wizard cms.ui.authoring.none=none cms.ui.authoring.not_implemented=Not Implemented cms.ui.authoring.page_launch_date=Launch Date: -cms.ui.authoring.page_title=Page Title: cms.ui.authoring.remove_image=Remove image cms.ui.authoring.select_an_existing_image=Select an existing image cms.ui.authoring.sql_error_in_getting_byte_content=SQL Error in getting byte content! diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.java b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.java new file mode 100644 index 000000000..d1bf7ad01 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms; + +import com.arsdigita.globalization.MixedResourceBundle; + +/** + * + * @author pb + */ +public class CMSResources_de extends MixedResourceBundle { + + public CMSResources_de() { + super(); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index 699cdec56..18a58af0a 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -6,15 +6,13 @@ cms.cannot_create_xml_document=Kann XML Dokument nicht erstellen cms.cant_promote_folders=Can't promote folders cms.classnotfoundexception=ClassNotFoundException: cms.illegalaccessexception=IllegalAccessException: -cms.image.erroneous_jpeg_marker_length=Erroneous JPEG marker length -cms.image.expected_soi_marker_first=Expected SOI marker first +cms.image.erroneous_jpeg_marker_length=Fehlerhafte L\u00e4nge des JPEG marker +cms.image.expected_soi_marker_first=Zuerst den SOI marker erwartet cms.image.not_a_jpeg_file=Keine JPEG Datei cms.instantiationexception=Ausnahmebedinung bei Instantiierung: cms.nosuchmethodexception=NoSuchMethodException: cms.templates=Vorlagen cms.title=Titel -no=Nein -yes=Ja mime_type_jsp=JSP mime_type_xsl=XSL @@ -49,7 +47,6 @@ cms.contenttypes.link_to_map=Karte (Link)\: cms.contenttypes.location=Ort: cms.contenttypes.main_contributor=Hauptredner\: cms.contenttypes.minutes_type_not_registered=Inhaltstyp Minutes nicht registriert -cms.contenttypes.news_date=Datum: cms.contenttypes.newsitem_type_not_registered=Inhaltstyp NewsItem nicht registriert cms.contenttypes.no_content_section=Kein Inhaltsabschnitt cms.contenttypes.no_section=Kein Abschnitt @@ -113,7 +110,7 @@ cms.contenttypes.ui.lead_line=Beschreibung (Lead Zeile): cms.contenttypes.ui.link_to_map=Lageplan: cms.contenttypes.ui.location=Ort: cms.contenttypes.ui.main_contributor=Hauptredner\: -cms.contenttypes.ui.name=Name: +cms.contenttypes.ui.name=Name (als Teil-URL): cms.contenttypes.ui.opening_times=\u00d6ffnungszeiten\: cms.contenttypes.ui.person_specification=Person Specification: cms.contenttypes.ui.ref_code=Ref. Code: @@ -292,7 +289,7 @@ cms.ui.min_launch=Kleinstes Startdatum cms.ui.my_workspace=Mein Portal cms.ui.name=Name cms.ui.name_prompt=Name: -cms.ui.need_category_map_privilege=Need categorize items privilege on that category +cms.ui.need_category_map_privilege=Es wird die Berechtigung zur Kategorisierung von Dokumenten ben\u00f6tigt. cms.ui.new_folder=Neuen Ordner erstellen cms.ui.new_item=Neues Element cms.ui.no=Nein @@ -367,13 +364,11 @@ cms.ui.authoring.invalid_create_component=Creation component for parent content cms.ui.authoring.missing_content_type=Dokumenttyp fehlt cms.ui.authoring.missing_item_id=Fehlende Item-ID cms.ui.authoring.name=Name: -cms.ui.authoring.name_url=Name (URL): cms.ui.authoring.no_asset=Kein Asset cms.ui.authoring.no_content_types_were_found=Keine Inhaltstypen gefunden cms.ui.authoring.no_current_wizard=No current wizard cms.ui.authoring.not_implemented=Nicht implementiert cms.ui.authoring.page_launch_date=Ver\u00f6ffentlichungsdatum: -cms.ui.authoring.page_title=Titel der Seite: cms.ui.authoring.remove_image=Bild entfernen cms.ui.authoring.select_an_existing_image=Vorhandenes Bild ausw\u00c4hlen cms.ui.authoring.sql_error_in_getting_byte_content=SQL Fehler beim Holen von Bin\u00e4rinhalt! @@ -382,7 +377,7 @@ cms.ui.authoring.steps=Authoring steps cms.ui.authoring.submission_cancelled=Submission Cancelled cms.ui.authoring.text_type=Text Type: cms.ui.authoring.this_article_does_not_have_an_image=Dieser Artikel hat kein Bild. -cms.ui.authoring.title=Titel: +cms.ui.authoring.title=Titel der Seite: cms.ui.authoring.unable_to_load_file=Datei konnte nicht geladen werden: cms.ui.authoring.upload_a_new_image=Neues Bild hochladen cms.ui.authoring.upload_image=Bild hochladen: diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.java b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.java new file mode 100644 index 000000000..359bafbe8 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms; + +import com.arsdigita.globalization.MixedResourceBundle; + +/** + * + * @author pb + */ +public class CMSResources_en_GB extends MixedResourceBundle { + + public CMSResources_en_GB() { + super(); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.java b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.java new file mode 100644 index 000000000..d6ec48897 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms; + +import com.arsdigita.globalization.MixedResourceBundle; + +/** + * + * @author pb + */ +public class CMSResources_fr extends MixedResourceBundle { + + public CMSResources_fr() { + super(); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties index 6340b05e3..a3a94b57b 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties @@ -53,7 +53,7 @@ cms.contenttypes.ui.job_description=Description du poste cms.contenttypes.ui.lead=Fil conducteur cms.contenttypes.ui.lead_line=Ligne de t\u00eate cms.contenttypes.ui.link_to_map=Lien vers la carte -cms.contenttypes.ui.name=Nom +cms.contenttypes.ui.name=Nom (URL) cms.contenttypes.ui.opening_times=Heures d'ouverture cms.contenttypes.ui.person_specification=D\u00e9tails concernant la personne cms.contenttypes.ui.ref_code=Code de r\u00e9f\u00e9rence @@ -65,7 +65,7 @@ cms.contenttypes.ui.services_provided=Services propos\u00e9s cms.contenttypes.ui.summary=R\u00e9sum\u00e9 cms.contenttypes.ui.summary=R\u00e9sum\u00e9 cms.contenttypes.ui.there_are_no_events=Il n'y a aucun \u00e9venement -cms.contenttypes.ui.title=Titre +cms.contenttypes.ui.title=Titre de la page cms.contenttypes.ui.view_image=voir l'image # Package com.arsdigita.cms.dispatcher @@ -216,13 +216,11 @@ cms.ui.authoring.invalid_create_component=TRANSLATE THIS: Creation component for cms.ui.authoring.missing_content_type=Type de contenu manquant cms.ui.authoring.missing_item_id=Identifiant de l'\u00e9l\u00e9ment manquant cms.ui.authoring.name=Nom -cms.ui.authoring.name_url=Nom (URL) cms.ui.authoring.no_asset=TRANSLATE THIS: No asset (cms.ui.authoring.no_asset) cms.ui.authoring.no_content_types_were_found=Pas de type de contenu trouv\u00e9 cms.ui.authoring.no_current_wizard=TRANSLATE THIS: No current wizard (cms.ui.authoring.no_current_wizard) cms.ui.authoring.not_implemented=Non Impl\u00e9ment\u00e9 cms.ui.authoring.page_launch_date=Date de lancement -cms.ui.authoring.page_title=Titre de la page cms.ui.authoring.remove_image=Supprimer l'image cms.ui.authoring.select_an_existing_image=S\u00e9lectionner une image existante cms.ui.authoring.sql_error_in_getting_byte_content=Erreur SQL en r\u00e9cup\u00e9rant le contenu @@ -530,8 +528,6 @@ cms.ui.workflow.you_are_assigned_to_this_item=Vous \u00eates assign\u00e9 \u00e0 cms.ui.workflow.your_active_tasks=Vos t\u00e2ches actives cms.ui.workflows=Workflows cms.ui.you_do_not_have_sufficient_privileges_to_access_this_page=Vous n'\u00eates pas autoris\u00e9 \u00e0 voir cette page. -no=Non -yes=Oui cms.contenttypes.ui.address.uri=URL (TRANSLATE THIS cms.contenttypes.ui.address.uri) cms.contenttypes.ui.address.email.desc=Means of contacting someone at this address (TRANSLATE THIS cms.contenttypes.ui.address.email.desc) cms.contenttypes.ui.address.uri.desc=A URL to find more information about this Address (TRANSLATE THIS cms.contenttypes.ui.address.uri.desc) diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java index 4217fd57b..21b9ce9be 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java @@ -26,7 +26,6 @@ import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SaveCancelSection; -import com.arsdigita.bebop.event.FormCancelListener; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; @@ -41,6 +40,7 @@ import com.arsdigita.cms.Folder; import com.arsdigita.cms.ItemCollection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.util.GlobalizationUtil; +import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.SessionManager; import com.arsdigita.xml.Element; @@ -157,10 +157,10 @@ public abstract class BasicItemForm // it breaks URLs & potentially overwrites the user's // customizations. - //jensp 2011-01-28: For some content types it is maybe useful to change - //the label of this field to something other than 'title'. This can now - //be done by overwriting the getTitleLabel() method. - //add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_title"))); + // For some content types it is maybe useful to change the label of the + // title field to something different than 'title'. + // This can nowbe done by overwriting the getTitleLabel() method. + // (jensp 2011-01-28) add(new Label(getTitleLabel())); TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE)); titleWidget.addValidationListener(new NotNullValidationListener()); @@ -172,10 +172,10 @@ public abstract class BasicItemForm + ".value = urlize(this.value) }"); add(titleWidget); - //jensp 2011-01-28: For some content types it is maybe useful to change - //the label of this field to something other than 'title'. This can now - //be done by overwriting the getNameLabel() method. - //add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.name_url"))); + // For some content types it is maybe useful to change the label of + // the name (or URL) field to something different than 'name (url)'. + // This can now be accomplished by overwriting the getNameLabel() method. + // (jensp 2011-01-28) add(new Label(getNameLabel())); TextField nameWidget = new TextField(new TrimmedStringParameter(NAME)); nameWidget.addValidationListener(new NameValidationListener()); @@ -409,10 +409,8 @@ public abstract class BasicItemForm * * @return (Content for the) Label for the title field as string */ - protected String getTitleLabel() { - return (String) GlobalizationUtil.globalize( - "cms.ui.authoring.page_title"). - localize(); + protected GlobalizedMessage getTitleLabel() { + return GlobalizationUtil.globalize("cms.contenttypes.ui.title"); } /** @@ -422,8 +420,7 @@ public abstract class BasicItemForm * * @return (Content for the) Label for the name field as string */ - protected String getNameLabel() { - return (String) GlobalizationUtil.globalize("cms.ui.authoring.name_url"). - localize(); + protected GlobalizedMessage getNameLabel() { + return GlobalizationUtil.globalize("cms.contenttypes.ui.name"); } } diff --git a/ccm-core/src/com/arsdigita/bebop/event/FormInitListener.java b/ccm-core/src/com/arsdigita/bebop/event/FormInitListener.java index 85a78718f..1d1036b5f 100755 --- a/ccm-core/src/com/arsdigita/bebop/event/FormInitListener.java +++ b/ccm-core/src/com/arsdigita/bebop/event/FormInitListener.java @@ -31,7 +31,6 @@ import java.util.EventListener; * @author Uday Mathur * @version $Id: FormInitListener.java 287 2005-02-22 00:29:02Z sskracic $ */ - public interface FormInitListener extends EventListener { /** diff --git a/ccm-core/src/com/arsdigita/bebop/parameters/StringParameter.java b/ccm-core/src/com/arsdigita/bebop/parameters/StringParameter.java index a1fab8483..0c642abad 100755 --- a/ccm-core/src/com/arsdigita/bebop/parameters/StringParameter.java +++ b/ccm-core/src/com/arsdigita/bebop/parameters/StringParameter.java @@ -55,10 +55,12 @@ public class StringParameter extends ParameterModel { return transformSingleValue(request); } + @Override public Object unmarshal(String encoded) { return encoded; } + @Override public Class getValueClass() { return String.class; } diff --git a/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java b/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java index 0668a5ca8..db0a84f53 100755 --- a/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java +++ b/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java @@ -113,6 +113,9 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable } + /** + * + */ @Override protected void initialize() { super.initialize(); @@ -134,6 +137,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable * @return String The fully qualified name of the base data object type * for the MessageCatalog DataObject. */ + @Override public String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } diff --git a/ccm-core/src/com/arsdigita/globalization/MessageCatalogAddResource.java b/ccm-core/src/com/arsdigita/globalization/MessageCatalogAddResource.java new file mode 100644 index 000000000..4cf2a74a0 --- /dev/null +++ b/ccm-core/src/com/arsdigita/globalization/MessageCatalogAddResource.java @@ -0,0 +1,87 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.globalization; + +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +// import com.arsdigita.london.util.Transaction; +import com.arsdigita.util.cmd.Program; + +import org.apache.commons.cli.CommandLine; +import org.apache.log4j.Logger; + +/** + * + * @author pb + */ +public class MessageCatalogAddResource extends Program { + + /** A logger instance to assist debugging. */ + private static final Logger s_log = + Logger.getLogger(MessageCatalogAddResource.class); + + /** + * Default Constructor + */ + public MessageCatalogAddResource() { + super("Add Resource Bundle to MesageCatalog", + "1.0.0", + "Fulle qualified bundle name"); + } + + /** + * Utility method to read a property file and convert it to a MessageCatalog + * entry. + * + * @param bundleFile String with bundle's fully qualified file name + */ + private static void create(String bundleFile) { + + } + + /** + * + * @param cmdLine + */ + protected void doRun(final CommandLine cmdLine) { +/* new Transaction() { + public void doRun() { + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + String[] args = cmdLine.getArgs(); + if (args.length == 3) { + String bundleName = args[0]; + // String navTitle = args[1]; + // String domainKey = args[2]; + if (bundleName != null && bundleName.length() != 0 + // && navTitle != null && navTitle.length() != 0 + // && domainKey != null && domainKey.length() != 0) + ) { + create(bundleName); + } else { + help(System.err); + System.exit(1); + } + } else { + help(System.err); + System.exit(1); + } + } + }.run(); + } + }.run(); */ + } + + /** + * @param args + */ + public static void main(String[] args) { + new MessageCatalogAddResource().run(args); + } + + + +} diff --git a/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java b/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java index 06122f8ca..77f8b93c9 100755 --- a/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java +++ b/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java @@ -48,7 +48,7 @@ import org.apache.log4j.Logger; * How to use (rough reconstruction from code) * - for each *.properties file create a child of this class with the same(!) name * in the same package (subdirecgory) - * - for each language-specific *.proerties file create a child of this class + * - for each language-specific *.properties file create a child of this class * with the same(1) name * - Example: *