From 2743a2922b77089dd382d75048090f90aa12ed76 Mon Sep 17 00:00:00 2001 From: Patrick Plitzner Date: Mon, 24 Aug 2015 13:02:50 +0200 Subject: [PATCH] Externalize strings --- .../OSGI-INF/l10n/messages.properties | 3 ++- .../OSGI-INF/l10n/messages_de.properties | 3 ++- .../src/main/java/eu/etaxonomy/taxeditor/Messages.java | 1 + .../taxeditor/ui/element/UriWithLabelElement.java | 8 +++++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties index 9d02cb1d2..3c21795a8 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties @@ -15,4 +15,5 @@ LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restar LanguageEditorPreferencePage_PleaseRestart=Please Restart LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect. OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required. -OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator. \ No newline at end of file +OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator. +UriWithLabelElement_URL_NOT_SAVED=URL won't be saved\! diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties index 3c18fec10..d03d93e32 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties @@ -14,4 +14,5 @@ LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte w LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten? LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich. -OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich. \ No newline at end of file +OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich. +UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\! \ No newline at end of file diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java index 9757c60b1..b583632dc 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java @@ -36,6 +36,7 @@ public class Messages extends NLS { public static String CdmDataSourceViewPart_7; public static String CdmDataSourceViewPart_8; public static String CdmDataSourceViewPart_9; + public static String UriWithLabelElement_URL_NOT_SAVED; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java index 02b61f541..31486b409 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java @@ -17,6 +17,8 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; +import eu.etaxonomy.taxeditor.Messages; + /** * @author n.hoffmann * @created Dec 20, 2010 @@ -31,7 +33,7 @@ public class UriWithLabelElement extends TextWithLabelElement { URI initialUri, Integer textHeight, int style) { super(formFactory, parentElement, labelString, null, textHeight, style); - labelException = formFactory.createLabel(getLayoutComposite(), "", SWT.WRAP); + labelException = formFactory.createLabel(getLayoutComposite(), "", SWT.WRAP); //$NON-NLS-1$ labelException.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1)); addControl(labelException); setUri(initialUri); @@ -47,12 +49,12 @@ public class UriWithLabelElement extends TextWithLabelElement { try { labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT)); labelException.setForeground(getPersistentBackground()); - labelException.setText(""); + labelException.setText(""); //$NON-NLS-1$ return new URI(super.getText()); } catch (Exception e) { labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); - labelException.setText("URL won't be saved! "+e.getMessage()); + labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getMessage()); return null; } } -- 2.34.1