From: Patrick Plitzner
Date: Wed, 9 Nov 2016 15:08:36 +0000 (+0100)
Subject: i18n for AuthenticationUserBar
X-Git-Tag: 4.4.0^2~63
X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/49bb07814797d8a1246663c708b245ff18602681
i18n for AuthenticationUserBar
---
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
index 281ed06e8..a56ca8310 100644
--- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
+++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
@@ -113,4 +113,7 @@ SearchManager_LARGE_RESULT_EXPECTED=Large result expected
SearchManager_LONG_SEARCH_WARNING=The current search will return %s objects. This will take a long time and/or might render the editor unusable. Please consider refining your search.\nSearch anyway?
SupplementalDataViewPart_VIEWER_NAME=Supplemental Data
-DetailsViewPart_VIEWER_NAME=Details
\ No newline at end of file
+DetailsViewPart_VIEWER_NAME=Details
+
+AuthenticatedUserBar_LOGGED_IN_AS=Logged in as: %s
+AuthenticatedUserBar_NOT_LOGGED_IN=Not logged in
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 be6719e8f..bb3d74683 100644
--- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
+++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
@@ -114,3 +114,6 @@ SearchManager_LONG_SEARCH_WARNING=Die aktuelle Suche wird %s Objekte laden. Dies
SupplementalDataViewPart_VIEWER_NAME=Zusatzdaten
DetailsViewPart_VIEWER_NAME=Details
+
+AuthenticatedUserBar_LOGGED_IN_AS=Angemeldet als: %s
+AuthenticatedUserBar_NOT_LOGGED_IN=Nicht angemeldet
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 c92ef50ba..48c0e4e95 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
@@ -18,6 +18,8 @@ import org.eclipse.osgi.util.NLS;
*/
public class Messages extends NLS {
private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+ public static String AuthenticatedUserBar_LOGGED_IN_AS;
+ public static String AuthenticatedUserBar_NOT_LOGGED_IN;
public static String LanguageEditorPreferencePage_ChooseDefaultLanguage;
public static String LanguageEditorPreferencePage_EditorHasToRestart;
public static String LanguageEditorPreferencePage_PleaseRestart;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java
index c0486d07d..6ffc3ef38 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java
@@ -1,4 +1,3 @@
-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
@@ -21,6 +20,7 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.Messages;
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.util.ApplicationUtil;
@@ -36,16 +36,10 @@ public class AuthenticatedUserBar extends WorkbenchWindowControlContribution imp
private Label label_authenticatedUser;
- /**
- * Constructor for AuthenticatedUserBar.
- */
public AuthenticatedUserBar(){
CdmStore.getLoginManager().addObserver(this);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
- */
/** {@inheritDoc} */
@Override
protected Control createControl(Composite parent) {
@@ -57,31 +51,25 @@ public class AuthenticatedUserBar extends WorkbenchWindowControlContribution imp
return label_authenticatedUser;
}
- /* (non-Javadoc)
- * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public void update(Observable o, Object arg) {
User authenticatedUser = CdmStore.getLoginManager().getAuthenticatedUser();
// TODO find a method to recompute width for parental toolbar item
- String text = "";
+ String text = ""; //$NON-NLS-1$
if(authenticatedUser == null) {
- text = "Not logged in " ;
+ text = Messages.AuthenticatedUserBar_NOT_LOGGED_IN ;
} else {
CdmRemoteSource source = (CdmRemoteSource) CdmStore.getActiveCdmSource();
- String loginInfo = authenticatedUser.getUsername() + "@" + source.getName() + ":" + source.getContextPath();
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo);
-
- text = "Logged in as: " + authenticatedUser.getUsername() + " ";
+ String loginInfo = String.format("%s@%s:%s",authenticatedUser.getUsername(), source.getName(), source.getContextPath()); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo); //$NON-NLS-1$
+
+ text = String.format(Messages.AuthenticatedUserBar_LOGGED_IN_AS, authenticatedUser.getUsername());
}
label_authenticatedUser.setText(text);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.ContributionItem#dispose()
- */
/** {@inheritDoc} */
@Override
public void dispose() {
@@ -89,5 +77,4 @@ public class AuthenticatedUserBar extends WorkbenchWindowControlContribution imp
CdmStore.getLoginManager().deleteObserver(this);
}
-
}