i18n for AuthenticationUserBar
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 9 Nov 2016 15:08:36 +0000 (16:08 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 9 Nov 2016 15:08:36 +0000 (16:08 +0100)
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java

index 281ed06e8ab6ba2b186593dbfdf29fed3d321993..a56ca8310595b00e4eac79fe2a10219778eb9cd3 100644 (file)
@@ -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              
index be6719e8f661641dd6ab7422e58b7059c1223c9c..bb3d7468302246978bc47e7f10ac81b521e3eea7 100644 (file)
@@ -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              
index c92ef50baa9775ea4113e28cbfe087d697d6168f..48c0e4e9509ef238bc7d2bf77ff705ed8a7397bd 100644 (file)
@@ -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;
index c0486d07d83b5a174067655aff90eb1f606781a3..6ffc3ef3833fa7896aacc541d5afc49dbbd66ced 100644 (file)
@@ -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;
 
-    /**
-     * <p>Constructor for AuthenticatedUserBar.</p>
-     */
     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);
     }
 
-
 }