Basetypes Globalization repariert

git-svn-id: https://svn.libreccm.org/ccm/trunk@426 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2010-05-20 09:40:35 +00:00
parent 08744c27f0
commit 9a8718f86d
5 changed files with 47 additions and 36 deletions

View File

@ -59,7 +59,7 @@ public class Address extends ContentPage {
public static final String BASE_DATA_OBJECT_TYPE public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.cms.basetypes.Address"; = "com.arsdigita.cms.basetypes.Address";
private static final AddressConfig s_config = new AddressConfig(); private static AddressConfig s_config = new AddressConfig();
static { static {
s_config.load(); s_config.load();
} }

View File

@ -4,4 +4,10 @@ cms.basetypes.ui.address.city=City
cms.basetypes.ui.address.state=State cms.basetypes.ui.address.state=State
cms.basetypes.ui.address.iso_country_code=Country cms.basetypes.ui.address.iso_country_code=Country
cms.basetypes.ui.address.error_iso_country=You must select a country cms.basetypes.ui.address.error_iso_country=You must select a country
cms.basetypes.ui.person.surname=Surname
cms.basetypes.ui.person.givenname=Given name
cms.basetypes.ui.person.titlepre=Title
cms.basetypes.ui.person.titlepost=Name appendix
address.authoring.basic_properties.title=Basic Properties address.authoring.basic_properties.title=Basic Properties

View File

@ -4,4 +4,10 @@ cms.basetypes.ui.address.city=Stadt
cms.basetypes.ui.address.state=Bundesland cms.basetypes.ui.address.state=Bundesland
cms.basetypes.ui.address.iso_country_code=Land cms.basetypes.ui.address.iso_country_code=Land
cms.basetypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus cms.basetypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus
cms.basetypes.ui.person.surname=Nachname
cms.basetypes.ui.person.givenname=Vorname
cms.basetypes.ui.person.titlepre=Titel
cms.basetypes.ui.person.titlepost=Namesanhang
address.authoring.basic_properties.title=Eigenschaften von Adresse address.authoring.basic_properties.title=Eigenschaften von Adresse

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
package com.arsdigita.cms.basetypes.ui; package com.arsdigita.cms.basetypes.ui;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
@ -31,22 +30,22 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
import java.text.DateFormat; import java.text.DateFormat;
public class PersonPropertiesStep extends SimpleEditStep { public class PersonPropertiesStep extends SimpleEditStep {
public static final String EDIT_SHEET_NAME = "edit"; public static final String EDIT_SHEET_NAME = "edit";
public PersonPropertiesStep(ItemSelectionModel itemModel, public PersonPropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) { AuthoringKitWizard parent) {
super(itemModel, parent); super(itemModel, parent);
setDefaultEditKey(EDIT_SHEET_NAME); setDefaultEditKey(EDIT_SHEET_NAME);
createEditSheet(itemModel); createEditSheet(itemModel);
setDisplayComponent(getPersonPropertySheet(itemModel)); setDisplayComponent(getPersonPropertySheet(itemModel));
} }
protected void createEditSheet(ItemSelectionModel itemModel) { protected void createEditSheet(ItemSelectionModel itemModel) {
@ -56,31 +55,31 @@ public class PersonPropertiesStep extends SimpleEditStep {
} }
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) { public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), Person.SURNAME); sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), Person.SURNAME);
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), Person.GIVENNAME); sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), Person.GIVENNAME);
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), Person.TITLEPRE); sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), Person.TITLEPRE);
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), Person.TITLEPOST); sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), Person.TITLEPOST);
if(!ContentSection.getConfig().getHideLaunchDate()) { if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(), sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
ContentPage.LAUNCH_DATE, ContentPage.LAUNCH_DATE,
new DomainObjectPropertySheet.AttributeFormatter() { new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
String attribute,
PageState state) {
ContentPage page = (ContentPage)item;
if (page.getLaunchDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
}
else {
return (String)BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
}
}
});
}
return sheet; public String format(DomainObject item,
String attribute,
PageState state) {
ContentPage page = (ContentPage) item;
if (page.getLaunchDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
} else {
return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
}
}
});
}
return sheet;
} }
} }

View File

@ -23,7 +23,7 @@ import com.arsdigita.globalization.GlobalizedMessage;
public class BasetypesGlobalizationUtil { public class BasetypesGlobalizationUtil {
final public static String BUNDLE_NAME = final public static String BUNDLE_NAME =
"com.arsdigita.cms.basetypes.util.BaetypesResourceBundle"; "com.arsdigita.cms.basetypes.util.BasetypesResourceBundle";
public static GlobalizedMessage globalize (String key) { public static GlobalizedMessage globalize (String key) {
return new GlobalizedMessage(key, BUNDLE_NAME); return new GlobalizedMessage(key, BUNDLE_NAME);