Skip to content

Commit

Permalink
Merge branch 'master' into uftest
Browse files Browse the repository at this point in the history
* master:
  fix SplitPaneChangeListener (JabRef#1840)
  French localization: Jabref_fr: empty strings translated (JabRef#1847)
  Fixes JabRef#1687 "month" field ascending/descending sorting swapped (JabRef#1837)
  Fix localization entry.
  Update German translation (JabRef#1829)
  • Loading branch information
Siedlerchr committed Aug 25, 2016
2 parents ba5f9f8 + b73b236 commit c45bf6b
Show file tree
Hide file tree
Showing 23 changed files with 239 additions and 76 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Fixed [#1531](https://github.com/JabRef/jabref/issues/1531): `\relax` can be used for abbreviation of author names
- Fixed [#1771](https://github.com/JabRef/jabref/issues/1771): Show all supported import types as default
- Fixed [#1804](https://github.com/JabRef/jabref/issues/1804): Integrity check no longer removes URL field by mistake
- Fixed [#1687](https://github.com/JabRef/jabref/issues/1687): "month" field ascending/descending sorting swapped



Expand Down
8 changes: 3 additions & 5 deletions src/main/java/net/sf/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,6 @@ public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) {
LOGGER.warn("Could not register FileUpdateMonitor", ex);
}
}

// saves the divider position as soon as it changes
splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, propertyChangeEvent -> {
saveDividerLocation();
});
}

// Returns a collection of AutoCompleters, which are populated from the current database
Expand Down Expand Up @@ -1523,6 +1518,9 @@ public void setupMainPanel() {
splitPane.revalidate();
revalidate();
repaint();

// saves the divider position as soon as it changes
splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, event -> saveDividerLocation());
}

public void updateSearchManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void listen(ConnectionLostEvent connectionLostEvent) {
Localization.lang("Close database")};

int answer = JOptionPane.showOptionDialog(jabRefFrame,
Localization.lang("The connection to the server has been determinated.") + "\n\n",
Localization.lang("The connection to the server has been terminated.") + "\n\n",
Localization.lang("Connection lost"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE,
null, options, options[0]);

Expand Down Expand Up @@ -80,4 +80,4 @@ public void listen(SharedEntryNotPresentEvent sharedEntryNotPresentEvent) {
dbmsSynchronizer.pullChanges();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@
import net.sf.jabref.model.entry.MonthUtil;

/**
*
* A comparator for BibEntry fields
*
* Initial Version:
*
* @author alver
* @version Date: Oct 13, 2005 Time: 10:10:04 PM To
*
* TODO: Testcases
*
*/
public class FieldComparator implements Comparator<BibEntry> {

Expand All @@ -47,26 +38,16 @@ public FieldComparator(String field) {
this(field, false);
}

public FieldComparator(String field, boolean reversed) {
public FieldComparator(SaveOrderConfig.SortCriterion sortCriterion) {
this(sortCriterion.field, sortCriterion.descending);
}

public FieldComparator(String field, boolean descending) {
this.fieldName = Objects.requireNonNull(field);
this.field = fieldName.split(FieldName.FIELD_SEPARATOR);
fieldType = determineFieldType();
isNumeric = InternalBibtexFields.isNumeric(this.field[0]);

if(fieldType == FieldType.MONTH) {
/*
* [ 1598777 ] Month sorting
*
* http://sourceforge.net/tracker/index.php?func=detail&aid=1598777&group_id=92314&atid=600306
*/
multiplier = reversed ? 1 : -1;
} else {
multiplier = reversed ? -1 : 1;
}
}

public FieldComparator(SaveOrderConfig.SortCriterion sortCriterion) {
this(sortCriterion.field, sortCriterion.descending);
multiplier = descending ? -1 : 1;
}

private static Collator getCollator() {
Expand All @@ -92,6 +73,16 @@ private FieldType determineFieldType() {
}
}

private String getField(BibEntry entry) {
for (String aField : field) {
Optional<String> o = entry.getFieldOrAlias(aField);
if (o.isPresent()) {
return o.get();
}
}
return null;
}

@Override
public int compare(BibEntry e1, BibEntry e2) {
String f1;
Expand Down Expand Up @@ -154,16 +145,6 @@ public int compare(BibEntry e1, BibEntry e2) {
return COLLATOR.compare(ours, theirs) * multiplier;
}

private String getField(BibEntry entry) {
for (String aField : field) {
Optional<String> o = entry.getFieldOrAlias(aField);
if (o.isPresent()) {
return o.get();
}
}
return null;
}

/**
* Returns the field this Comparator compares by.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
27 changes: 14 additions & 13 deletions src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2423,7 +2423,7 @@ Required_field_"%0"_is_empty.=Erforederliches_Feld_"%0"_ist_leer.

%0_driver_not_available.=%0-Treiber_nicht_verfügbar.

The_connection_to_the_server_has_been_determinated.=Verbindung_zum_Server_wurde_abgebrochen.
The_connection_to_the_server_has_been_terminated.=Verbindung_zum_Server_wurde_abgebrochen.

Connection_lost.=Verbindung_verloren.
Reconnect=Neu_verbinden.
Expand Down Expand Up @@ -2457,18 +2457,19 @@ You_must_enter_at_least_one_field_name=Sie_müssen_mindestens_einen_Feldnamen_an

Non-ASCII_encoded_character_found=Nicht_ASCII-kodiertes_Zeichen_gefunden

Toggle_web_search_interface=
Background_color_for_resolved_fields=
Color_code_for_resolved_fields=
Toggle_web_search_interface=Websuche_ein-/ausschalten
Background_color_for_resolved_fields=Hintergrundfarbe_für_referenzierte_Felder
Color_code_for_resolved_fields=Farbanzeige_für_referenzierte_Felder

%0_files_found=%0_Dateien_gefunden
%0_of_%1=%0_von_%1
One_file_found=Eine_Datei_gefunden
The_import_finished_with_warnings\:=Der Import_wurde_mit_Warnungen_abgeschlossen\:
There_was_one_file_that_could_not_be_imported.=Eine_Datei_konnte_nicht_importiert_werden.
There_were_%0_files_which_could_not_be_imported.=%0_Dateien_konnten_nicht_importiert_werden.

%0_files_found=
%0_of_%1=
One_file_found=
The_import_finished_with_warnings\:=
There_was_one_file_that_could_not_be_imported.=
There_were_%0_files_which_could_not_be_imported.=
Migration_help_information=Hilfe_zur_Migration
Entered_database_has_obsolete_structure_and_is_no_longer_supported.=Die_eingegebene_Datenbank_ist_veraltet_und_wird_nicht_mehr_unterstützt.
However,_a_new_database_was_created_alongside_the_pre-3.6_one.=Eine_nebenläufige_Datenbank_wurde_erzeugt.
Entered_database_has_obsolete_structure_and_is_no_longer_supported.=Die_gewählte_Datenbank_nutzt_eine_veraltete,_nicht_mehr_unterstützte_Struktur.
However,_a_new_database_was_created_alongside_the_pre-3.6_one.=Dennoch_wurde_eine_neue_Datenbank_neben_der_alten_Datenbank_erzeugt.

Click_here_to_learn_about_the_migration_of_pre-3.6_databases.=
Click_here_to_learn_about_the_migration_of_pre-3.6_databases.=Klicken_um_Informationen_zur_Migration_von_vor-3.6-Datenbanken_zu_erhalten.
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ Driver_error=Driver_error
Connection_to_%0_server_stablished.=Connection_to_%0_server_stablished.
Required_field_"%0"_is_empty.=Required_field_"%0"_is_empty.
%0_driver_not_available.=%0_driver_not_available.
The_connection_to_the_server_has_been_determinated.=The_connection_to_the_server_has_been_determinated.
The_connection_to_the_server_has_been_terminated.=The_connection_to_the_server_has_been_terminated.
Connection_lost.=Connection_lost.
Reconnect=Reconnect
Work_offline=Work_offline
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ Required_field_"%0"_is_empty.=Le_champ_requis_"%0"_est_vide;

%0_driver_not_available.=Pilote_%0_non_disponible.

The_connection_to_the_server_has_been_determinated.=La_connexion_au_serveur_a_été_interrompue.
The_connection_to_the_server_has_been_terminated.=La_connexion_au_serveur_a_été_interrompue.

Connection_lost.=Connexion_perdue.
Reconnect=Reconnexion
Expand Down Expand Up @@ -1706,8 +1706,8 @@ One_file_found=Un_fichier_trouvé
The_import_finished_with_warnings\:=L'importation_s'est_terminée_avec_des_messages_d'avertissement\:
There_was_one_file_that_could_not_be_imported.=Un_fichier_n'a_pas_pu_être_importé.
There_were_%0_files_which_could_not_be_imported.=%0_fichiers_n'ont_pas_pu_être_importés.
Migration_help_information=
Entered_database_has_obsolete_structure_and_is_no_longer_supported.=
However,_a_new_database_was_created_alongside_the_pre-3.6_one.=
Migration_help_information=Aide_sur_la_migration
Entered_database_has_obsolete_structure_and_is_no_longer_supported.=Cette_base_de_données_a_une_structure_obsolète_qui_n'est_plus_gérée.
However,_a_new_database_was_created_alongside_the_pre-3.6_one.=Ainsi,_une_nouvelle_base_a_été_créée_en_parallèle_de_celle_antérieure_à_la_version_3.6.

Click_here_to_learn_about_the_migration_of_pre-3.6_databases.=
Click_here_to_learn_about_the_migration_of_pre-3.6_databases.=Cliquer_ici_pour_plus_de_détails_sur_la_migration_des_bases_antérieures_à_la_version_3.6.
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2796,7 +2796,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2373,7 +2373,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ Required_field_"%0"_is_empty.=Det_obligatoriska_fältet_"%0"_är_tomt.

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=Anslutningen_till_servern_avbröts.
The_connection_to_the_server_has_been_terminated.=Anslutningen_till_servern_avbröts.

Connection_lost.=Anslutningen_förlorades.
Reconnect=Anslut_igen
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ Required_field_"%0"_is_empty.=Gerekli_alan_"%0"_boş.

%0_driver_not_available.=%0_sürücüsü_yok

The_connection_to_the_server_has_been_determinated.=Sunucuyla_olan_bağlantı_sonlandırıldı.
The_connection_to_the_server_has_been_terminated.=Sunucuyla_olan_bağlantı_sonlandırıldı.

Connection_lost.=Bağlantı_koptu.
Reconnect=Yeniden_bağlan
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ Required_field_"%0"_is_empty.=

%0_driver_not_available.=

The_connection_to_the_server_has_been_determinated.=
The_connection_to_the_server_has_been_terminated.=

Connection_lost.=
Reconnect=
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ Disable_highlight_groups_matching_entries=Keine_Gruppen_hervorheben

Online_help_forum=Online-Hilfeforum

Manage_protected_terms=
Manage_protected_terms=Geschützte_Terme_verwalten
Loading

0 comments on commit c45bf6b

Please sign in to comment.