From: <ap...@vh...> - 2005-11-14 15:11:58
|
Author: apevec Date: 2005-11-14 16:10:37 +0100 (Mon, 14 Nov 2005) New Revision: 995 Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java trunk/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java Log: internal hook in CMS globalization to override keys in CMSResources.properties Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java 2005-11-14 14:38:27 UTC (rev 994) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java 2005-11-14 15:10:37 UTC (rev 995) @@ -47,11 +47,8 @@ /** - * Displays a table of publishing history for an item, with options - * to republish the item at any of its previous states. + * Displays a list of all language instances of an item. * - * @author Stanislav Freidin (sfr...@ar...) - * @version $Id$ */ public class ItemLanguagesTable extends DataTable { @@ -70,7 +67,7 @@ addColumn("cms.ui.language.header", ContentPage.LANGUAGE, false, new LanguageRenderer()); addColumn("cms.title", ContentPage.TITLE); m_deleteColumn = addColumn("cms.ui.action", new ActionCellRenderer(m_model)); - setResourceBundle(GlobalizationUtil.BUNDLE_NAME); + setResourceBundle(GlobalizationUtil.getBundleName()); addTableActionListener(new InstanceDeleter()); } Modified: trunk/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java 2005-11-14 14:38:27 UTC (rev 994) +++ trunk/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java 2005-11-14 15:10:37 UTC (rev 995) @@ -32,14 +32,27 @@ public class GlobalizationUtil { - public static final String BUNDLE_NAME = "com.arsdigita.cms.util.CMSResourceBundle"; + public static String s_bundleName = "com.arsdigita.cms.util.CMSResourceBundle"; public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); + return new GlobalizedMessage(key, getBundleName()); } public static GlobalizedMessage globalize(String key, Object[] args) { - return new GlobalizedMessage(key, BUNDLE_NAME, args); + return new GlobalizedMessage(key, getBundleName(), args); } + /* + * Not a part of API. Otherwise it would need to be properly synchronized. + * Only meant be used to override resource keys in CMSResources + * by a custom application, in Initializer. + */ + public static void internalSetBundleName(String bundleName) { + s_bundleName = bundleName; + } + + public static String getBundleName() { + return s_bundleName; + } + } |