i18n for SearchManager
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 1 Sep 2016 09:31:47 +0000 (11:31 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 1 Sep 2016 09:31:56 +0000 (11:31 +0200)
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/store/SearchManager.java

index 443cbe54a14a169debb61c2a49b152d6dbc5a98c..08c5bc41e1bf625315ba762728177682ddd41f9d 100644 (file)
@@ -108,3 +108,6 @@ PasswordWizardPage_OLD_PASSWORD=Old Password
 PasswordWizardPage_PASSWORD_MIN_CHARACTER=Password has to have at least %s characters
 PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=The passwords do not match
 PasswordWizardPage_REPEAT_PASSWORD=Repeat Password
 PasswordWizardPage_PASSWORD_MIN_CHARACTER=Password has to have at least %s characters
 PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=The passwords do not match
 PasswordWizardPage_REPEAT_PASSWORD=Repeat Password
+
+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?
index c165b4a636e25b63acdbcc60715339c9440f9186..7b1f5431dbc6f29be563dbe3a422d7f91b0f6b14 100644 (file)
@@ -108,3 +108,6 @@ PasswordWizardPage_OLD_PASSWORD=Altes Kennwort
 PasswordWizardPage_PASSWORD_MIN_CHARACTER=Kennwort muss mindesten %s Zeichen enthalten
 PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=Die Kennwörter stimmen nicht überein
 PasswordWizardPage_REPEAT_PASSWORD=Kennwort wiederholen
 PasswordWizardPage_PASSWORD_MIN_CHARACTER=Kennwort muss mindesten %s Zeichen enthalten
 PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=Die Kennwörter stimmen nicht überein
 PasswordWizardPage_REPEAT_PASSWORD=Kennwort wiederholen
+
+SearchManager_LARGE_RESULT_EXPECTED=Große Anzahl an Suchergebnissen
+SearchManager_LONG_SEARCH_WARNING=Die aktuelle Suche wird %s Objekte laden. Dies kann einige Zeit dauern und den Editor währenddessen unbedienbar machen. Bitte erstellen sie eine detailliertere Suche.\nTrotzdem suchen?
index 716a64c0d428655439126760051635d37a98725d..8d33a54310dd24747879d308f41da04176829194 100644 (file)
@@ -122,6 +122,8 @@ public class Messages extends NLS {
        public static String RemotingLoginDialog_JOB_SERVER_LAUNCH;
        public static String RemotingLoginDialog_STARTING_MGD_SERVER;
        public static String RemotingLoginDialog_TASK_LAUNCHING_SERVER;
        public static String RemotingLoginDialog_JOB_SERVER_LAUNCH;
        public static String RemotingLoginDialog_STARTING_MGD_SERVER;
        public static String RemotingLoginDialog_TASK_LAUNCHING_SERVER;
+    public static String SearchManager_LARGE_RESULT_EXPECTED;
+    public static String SearchManager_LONG_SEARCH_WARNING;
        static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
        static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
index bfa1e5528ca09f7f1ef90af5e4cb6cf42930c424..91b01474850d455960760baab9e1008b16f49c9a 100644 (file)
@@ -44,6 +44,7 @@ import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
+import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
@@ -56,16 +57,16 @@ public class SearchManager {
 
        public static final List NO_RESULTS = Arrays.asList(new Object[]{});
 
 
        public static final List NO_RESULTS = Arrays.asList(new Object[]{});
 
-       public static final String WILDCARD = "*";
+       public static final String WILDCARD = "*"; //$NON-NLS-1$
 
        public static int NO_COUNT = -1;
 
        public static int NO_COUNT = -1;
-       
+
 
        // TODO make this configurable via preferences
        private static final int MAX_RESULTS_BEFORE_WARNING = 500;
 
        public List<TaxonNameBase> findNames(IIdentifiableEntityServiceConfigurator configurator, ConversationHolder conversation){
 
        // TODO make this configurable via preferences
        private static final int MAX_RESULTS_BEFORE_WARNING = 500;
 
        public List<TaxonNameBase> findNames(IIdentifiableEntityServiceConfigurator configurator, ConversationHolder conversation){
-                       
+
                if(checkLargeResult(CdmStore.getService(INameService.class).countByTitle(configurator))){
                        List<TaxonNameBase> records = CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
                        addUuidSearchResults(records, configurator, INameService.class);
                if(checkLargeResult(CdmStore.getService(INameService.class).countByTitle(configurator))){
                        List<TaxonNameBase> records = CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
                        addUuidSearchResults(records, configurator, INameService.class);
@@ -166,25 +167,25 @@ public class SearchManager {
        public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits){
            List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
                final List<String> BASE_OCCURRENCE_INIT_STRATEGY = Arrays.asList(new String[] {
        public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits){
            List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
                final List<String> BASE_OCCURRENCE_INIT_STRATEGY = Arrays.asList(new String[] {
-                       "collection",
-                       "descriptions",
-                       "identifiers",
-                       "derivationEvents.originals",
-                       "derivedFrom.originals",
-                       "gatheringEvent.country.representations",
-                       "gatheringEvent.collector",
-                       "gatheringEvent.locality",
-                       "descriptions.descriptionElements",
-                       "kindOfUnit",
-                       "amplificationResults",
-                       "sequences.singleReadAlignments",
-                       "mediaSpecimen"
+                       "collection", //$NON-NLS-1$
+                       "descriptions", //$NON-NLS-1$
+                       "identifiers", //$NON-NLS-1$
+                       "derivationEvents.originals", //$NON-NLS-1$
+                       "derivedFrom.originals", //$NON-NLS-1$
+                       "gatheringEvent.country.representations", //$NON-NLS-1$
+                       "gatheringEvent.collector", //$NON-NLS-1$
+                       "gatheringEvent.locality", //$NON-NLS-1$
+                       "descriptions.descriptionElements", //$NON-NLS-1$
+                       "kindOfUnit", //$NON-NLS-1$
+                       "amplificationResults", //$NON-NLS-1$
+                       "sequences.singleReadAlignments", //$NON-NLS-1$
+                       "mediaSpecimen" //$NON-NLS-1$
                });
 
                List<String> occurrencePropertyPaths = new ArrayList<String>();
                occurrencePropertyPaths.addAll(BASE_OCCURRENCE_INIT_STRATEGY);
                for(String propertyPath:BASE_OCCURRENCE_INIT_STRATEGY) {
                });
 
                List<String> occurrencePropertyPaths = new ArrayList<String>();
                occurrencePropertyPaths.addAll(BASE_OCCURRENCE_INIT_STRATEGY);
                for(String propertyPath:BASE_OCCURRENCE_INIT_STRATEGY) {
-                   occurrencePropertyPaths.add("derivationEvents.derivatives." + propertyPath);
+                   occurrencePropertyPaths.add("derivationEvents.derivatives." + propertyPath); //$NON-NLS-1$
                }
                configurator.setPropertyPaths(occurrencePropertyPaths);
 
                }
                configurator.setPropertyPaths(occurrencePropertyPaths);
 
@@ -219,16 +220,15 @@ public class SearchManager {
 
        private boolean checkLargeResult(int count, int maxBeforWarning) {
                if(count > maxBeforWarning){
 
        private boolean checkLargeResult(int count, int maxBeforWarning) {
                if(count > maxBeforWarning){
-                       return MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Large result expected",
-                                       String.format("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.", count));
+                       return MessageDialog.openConfirm(Display.getDefault().getActiveShell(), Messages.SearchManager_LARGE_RESULT_EXPECTED,
+                                       String.format(Messages.SearchManager_LONG_SEARCH_WARNING, count));
                }else{
                        return true;
                }
        }
 
        private String sqlizeTitleSearchString(IIdentifiableEntityServiceConfigurator configurator){
                }else{
                        return true;
                }
        }
 
        private String sqlizeTitleSearchString(IIdentifiableEntityServiceConfigurator configurator){
-               return configurator.getTitleSearchString().replace(WILDCARD, "%");
+               return configurator.getTitleSearchString().replace(WILDCARD, "%"); //$NON-NLS-1$
        }
 
        public List findTaxa(IIdentifiableEntityServiceConfigurator configurator) {
        }
 
        public List findTaxa(IIdentifiableEntityServiceConfigurator configurator) {