Skip to content

Commit

Permalink
Write all field keys in lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Dec 21, 2015
1 parent 8cbd1c4 commit 52d21cb
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 176 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by
- Icons are shown as Header for icon columns in the entry table (#315)
- Tooltips are shown for header columns and contents which are too wide to be displayed in the entry table (#384)
- Default order in entry table: # | all file based icons (file, URL/DOI, ...) | all bibtex field based icons (bibtexkey, entrytype, author, title, ...) | all activated special field icons (ranking, quality, ...)
- Write all field keys in lower case. No more camel casing of field names. E.g., `title` is written instead of `Title`, `howpublished` instead of `HowPublished`, and `doi` instead of `DOI`. The configuration option `Use camel case for field names (e.g., "HowPublished" instead of "howpublished")` is gone.

### Fixed
- Fixed #479: Import works again
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/net/sf/jabref/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ public class JabRefPreferences {
public static final String OVERWRITE_OWNER = "overwriteOwner";
public static final String USE_OWNER = "useOwner";
public static final String WRITEFIELD_ADDSPACES = "writeFieldAddSpaces";
public static final String WRITEFIELD_CAMELCASENAME = "writeFieldCamelCase";
public static final String WRITEFIELD_SORTSTYLE = "writefieldSortStyle";
public static final String WRITEFIELD_USERDEFINEDORDER = "writefieldUserdefinedOrder";
public static final String WRITEFIELD_WRAPFIELD = "wrapFieldLine";
Expand Down Expand Up @@ -694,9 +693,8 @@ private JabRefPreferences() {

defaults.put(GENERATE_KEYS_BEFORE_SAVING, Boolean.FALSE);

// behavior of JabRef before 2.10: both: false
// behavior of JabRef before 2.10: false
defaults.put(WRITEFIELD_ADDSPACES, Boolean.TRUE);
defaults.put(WRITEFIELD_CAMELCASENAME, Boolean.TRUE);

//behavior of JabRef before LWang_AdjustableFieldOrder 1
//0 sorted order (2.10 default), 1 unsorted order (2.9.2 default), 2 user defined
Expand Down
19 changes: 8 additions & 11 deletions src/main/java/net/sf/jabref/bibtex/BibtexEntryWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class BibtexEntryWriter {

private final LatexFieldFormatter fieldFormatter;
private final boolean write;
private final boolean writeFieldCameCaseName = Globals.prefs.getBoolean(JabRefPreferences.WRITEFIELD_CAMELCASENAME);
private final boolean writeFieldAddSpaces = Globals.prefs.getBoolean(JabRefPreferences.WRITEFIELD_ADDSPACES);
private final boolean includeEmptyFields = Globals.prefs.getBoolean(JabRefPreferences.INCLUDE_EMPTY_FIELDS);
private final int writeFieldSortStyle = Globals.prefs.getInt(JabRefPreferences.WRITEFIELD_SORTSTYLE);
Expand Down Expand Up @@ -307,11 +306,12 @@ private boolean writeField(BibEntry entry, Writer out, String name, boolean prep
* Get display version of a entry field.
* <p>
* BibTeX is case-insensitive therefore there is no difference between:
* howpublished, HOWPUBLISHED, HowPublished, etc. Since the camel case
* version is the most easy to read this should be the one written in the
* *.bib file. Since there is no way how do detect multi-word strings by
* default the first character will be made uppercase. In other characters
* case needs to be changed the {@link #tagDisplayNameMap} will be used.
* howpublished, HOWPUBLISHED, HowPublished, etc.
*
* The was a long discussion about how JabRef should write the fields.
* See https://github.com/JabRef/jabref/issues/116
*
* The team decided to do the biber way and use lower case for the field names.
*
* @param field The name of the field.
* @return The display version of the field name.
Expand All @@ -331,11 +331,8 @@ private String getFieldDisplayName(String field) {
String suffix = suffixSB.toString();

String result;
if (writeFieldCameCaseName) {
result = CamelCaser.toCamelCase(field) + suffix;
} else {
result = field + suffix;
}
result = field.toLowerCase() + suffix;

return result;
}
}
101 changes: 0 additions & 101 deletions src/main/java/net/sf/jabref/bibtex/CamelCaser.java

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/java/net/sf/jabref/gui/preftabs/FileTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class FileTab extends JPanel implements PrefsTab {
private final JCheckBox autoSave;
private final JCheckBox promptBeforeUsingAutoSave;
private final JCheckBox includeEmptyFields;
private final JCheckBox camelCase;
private final JCheckBox sameColumn;
private final JComboBox<String> valueDelimiter;
private final JComboBox<String> newlineSeparator;
Expand Down Expand Up @@ -93,7 +92,6 @@ public FileTab(JabRefFrame frame, JabRefPreferences prefs) {
Localization.lang("Curly Brackets") + ": {, }"});
includeEmptyFields = new JCheckBox(Localization.lang("Include empty fields"));
sameColumn = new JCheckBox(Localization.lang("Start field contents in same column"));
camelCase = new JCheckBox(Localization.lang("Use camel case for field names (e.g., \"HowPublished\" instead of \"howpublished\")"));
resolveStringsAll = new JRadioButton(Localization.lang("Resolve strings for all fields except") + ":");
resolveStringsStandard = new JRadioButton(Localization.lang("Resolve strings for standard BibTeX fields only"));
ButtonGroup bg = new ButtonGroup();
Expand Down Expand Up @@ -166,8 +164,6 @@ public void stateChanged(ChangeEvent changeEvent) {
builder.nextLine();
builder.appendSeparator(Localization.lang("Field saving options"));
builder.nextLine();
builder.append(camelCase);
builder.nextLine();
builder.append(sameColumn);
builder.append(new JPanel());
builder.nextLine();
Expand Down Expand Up @@ -279,7 +275,6 @@ public void setValues() {
origAutoSaveSetting = autoSave.isSelected();
valueDelimiter.setSelectedIndex(prefs.getInt(JabRefPreferences.VALUE_DELIMITERS2));
includeEmptyFields.setSelected(prefs.getBoolean(JabRefPreferences.INCLUDE_EMPTY_FIELDS));
camelCase.setSelected(prefs.getBoolean(JabRefPreferences.WRITEFIELD_CAMELCASENAME));
sameColumn.setSelected(prefs.getBoolean(JabRefPreferences.WRITEFIELD_ADDSPACES));

//for LWang_AdjustableFieldOrder
Expand Down Expand Up @@ -315,7 +310,6 @@ public void storeSettings() {
prefs.putInt(JabRefPreferences.AUTO_SAVE_INTERVAL, (Integer) autoSaveInterval.getValue());
prefs.putInt(JabRefPreferences.VALUE_DELIMITERS2, valueDelimiter.getSelectedIndex());
prefs.putBoolean(JabRefPreferences.INCLUDE_EMPTY_FIELDS, includeEmptyFields.isSelected());
prefs.putBoolean(JabRefPreferences.WRITEFIELD_CAMELCASENAME, camelCase.isSelected());
prefs.putBoolean(JabRefPreferences.WRITEFIELD_ADDSPACES, sameColumn.isSelected());
doNotResolveStringsFor.setText(prefs.get(JabRefPreferences.DO_NOT_RESOLVE_STRINGS_FOR));

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,6 @@ Network=
Please_specify_both_hostname_and_port=
Port=
Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,6 @@ Network=Netzwerk
Please_specify_both_hostname_and_port=Bitte_geben_Sie_den_Namen_des_Hosts_und_den_Port_an
Port=Port
Start_field_contents_in_same_column=Feldinhalte_in_derselben_Spalte_beginnen
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Binnenmajuskeln_f\u00fcr_Feldnamen_benutzen_(z._B._"HowPublished"_statt_"howpublished")
Use_custom_proxy_configuration=Benutzerdefinierte_Proxy-Konfiguration_verwenden
Clear_connection_settings=Verbindungseinstellungen_zur\u00fccksetzen
Cleared_connection_settings.=Verbindungseinstellungen_wurden_zur\u00fcckgesetzt.
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,6 @@ Port=Port
Please_specify_both_username_and_password=Please_specify_both_username_and_password

Start_field_contents_in_same_column=Start_field_contents_in_same_column
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")
Use_custom_proxy_configuration=Use_custom_proxy_configuration
Proxy_requires_authentication=Proxy_requires_authentication
Attention\:_Password_is_stored_in_plain_text!=Attention\:_Password_is_stored_in_plain_text!
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,6 @@ Network=Red
Please_specify_both_hostname_and_port=Especifique_tanto_nombre_de_host_como_puerto
Port=Puerto
Start_field_contents_in_same_column=Comenzar_los_contenidos_del_campo_en_la_misma_columna
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Usar_camel_case_para_nombres_de_campo_UEj._"VistaHermosa"_en_lugar_de_"vistahermosa")
Use_custom_proxy_configuration=Usar_configuraci\u00f3n_de_proxy_personalizada
Clear_connection_settings=Limpiar_ajustes_de_conexi\u00c3\u00b3n
Cleared_connection_settings.=Ajustes_de_conexi\u00f3n_limpiados
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,6 @@ Please_specify_both_hostname_and_port=
Port=

Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,6 @@ Network=R\u00e9seau
Please_specify_both_hostname_and_port=Entrez_\u00e0_la_fois_le_nom_de_l'ordinateur_h\u00f4te_et_le_port,_s'il_vous_plait
Port=Port
Start_field_contents_in_same_column=D\u00e9marrer_les_contenus_du_champ_dans_une_m\u00eame_colonne
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Utiliser_des_majuscules_interm\u00e9diaires_pour_les_noms_de_champ_(par_ex.,_"HowPublished"_au_lieu_de_"howpublished")
Use_custom_proxy_configuration=Utiliser_une_configuration_de_proxy_personnalis\u00e9e
Clear_connection_settings=R\u00e9initialiser_les_param\u00e8tres_de_connexion
Cleared_connection_settings.=Param\u00e8tres_de_connexion_r\u00e9initialis\u00e9s.
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,6 @@ Network=
Please_specify_both_hostname_and_port=
Port=
Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,6 @@ Network=Rete
Please_specify_both_hostname_and_port=Specificare_sia_il_nome_dell'host_sia_il_numero_della_porta
Port=Porta
Start_field_contents_in_same_column=Inizia_i_contenuti_del_campo_nella_stessa_colonna
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Utilizza_le_maiuscole_intermedie_(camel_case)_per_i_nomi_dei_campi_(es_"HowPublished"_invece_di_"howpublished")
Use_custom_proxy_configuration=Utilizza_una_configurazione_del_proxy_personalizzata.
Clear_connection_settings=Reinizializza_i_parametri_di_connessione
Cleared_connection_settings.=Parametri_di_connessione_reinizializzati
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,6 @@ Network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af
Please_specify_both_hostname_and_port=\u30db\u30b9\u30c8\u540d\u3068\u30dd\u30fc\u30c8\u306e\u4e21\u65b9\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044
Port=\u30dd\u30fc\u30c8
Start_field_contents_in_same_column=\u30d5\u30a3\u30fc\u30eb\u30c9\u5185\u5bb9\u3092\u540c\u3058\u30b3\u30e9\u30e0\u5185\u3067\u59cb\u3081\u308b
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u306b\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u3092\u7528\u3044\u308b\uff08\u4f8b\uff1a\u300chowpublished\u300d\u3092\u300cHowPublished\u300d\u3068\u3059\u308b\uff09
Use_custom_proxy_configuration=\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u30d7\u30ed\u30ad\u30b7\u8a2d\u5b9a\u3092\u7528\u3044\u308b
Clear_connection_settings=\u63a5\u7d9a\u8a2d\u5b9a\u3092\u6d88\u53bb\u3059\u308b
Cleared_connection_settings.=\u63a5\u7d9a\u8a2d\u5b9a\u3092\u6d88\u53bb\u3057\u307e\u3057\u305f
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,6 @@ Network=Netwerk
Please_specify_both_hostname_and_port=
Port=Poort
Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,6 @@ Network=
Please_specify_both_hostname_and_port=
Port=
Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,6 @@ Network=Rede
Please_specify_both_hostname_and_port=Por_favor,_especifique_o_hostname_e_a_porta
Port=Porta
Start_field_contents_in_same_column=Iniciar_conte\u00fados_do_campo_na_mesma_coluna
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Usar_camel_case_para_nomes_de_campos_(ex._"HowPublished"_ao_inv\u00e9s_de_"howpublished")
Use_custom_proxy_configuration=Usar_configura\u00e7\u00f5es_personalizadas_de_proxy
Clear_connection_settings=Limpar_configura\u00e7\u00f5es_da_conex\u00e3o
Cleared_connection_settings.=Configura\u00e7\u00f5es_de_conex\u00e3o_foram_limpas.
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,6 @@ Please_specify_both_hostname_and_port=Укажите_имя_хоста_и_пор
Port=Порт

Start_field_contents_in_same_column=Запуск_содержимого_поля_в_той_же_колонке
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Использовать_написание_CamelCase_для_имен_полей_(напр.,_"HowPublished"_вместо_"howpublished")
Use_custom_proxy_configuration=Использовать_пользовательские_настройки_прокси
Clear_connection_settings=Удалить_настройки_подключения
Cleared_connection_settings.=Настройки_подключения_удалены.
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,6 @@ Network=A\u011f
Please_specify_both_hostname_and_port=L\u00fctfen_hem_makine_ad\u0131n\u0131_hem_de_ba\u011flant\u0131_noktas\u0131n\u0131_belirtin
Port=Ba\u011flant\u0131_noktas\u0131
Start_field_contents_in_same_column=Alan_i\u00e7eri\u011fini_ayn\u0131_s\u00fctunda_ba\u015flat
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=Alan_adlar\u0131_i\u00e7in_camel_case_kullan_(\u00f6rnek:_"yay\u0131n_\u015fekli"_yerine_"Yay\u0131n\u015eekli")
Use_custom_proxy_configuration=\u00d6zelle\u015ftirilmi\u015f_vekil_konfig\u00fcrasyonu_kullan


Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,6 @@ Network=
Please_specify_both_hostname_and_port=
Port=
Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,6 @@ Network=\u7f51\u7edc
Please_specify_both_hostname_and_port=
Port=\u7aef\u53e3
Start_field_contents_in_same_column=
Use_camel_case_for_field_names_(e.g.,_"HowPublished"_instead_of_"howpublished")=
Use_custom_proxy_configuration=
Clear_connection_settings=
Cleared_connection_settings.=
Expand Down
Loading

0 comments on commit 52d21cb

Please sign in to comment.