Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent file name casing (and other localization improvements) #1629

Merged
merged 9 commits into from
Jul 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/net/sf/jabref/BibDatabaseContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import net.sf.jabref.preferences.JabRefPreferences;

/**
* Represents everything related to a .bib file.
* Represents everything related to a BIB file.
* <p>
* The entries are stored in BibDatabase, the other data in MetaData and the options relevant for this file in Defaults.
*/
Expand Down Expand Up @@ -117,7 +117,7 @@ public boolean isBiblatexMode() {
* 1. metadata user-specific directory
* 2. metadata general directory
* 3. preferences directory
* 4. bib file directory
* 4. BIB file directory
*
* @param fieldName The field type
* @return The default directory for this field type.
Expand All @@ -143,7 +143,7 @@ public List<String> getFileDirectory(String fieldName) {
fileDirs.add(dir);
}

// 4. bib file directory
// 4. BIB file directory
if (getDatabaseFile() != null) {
String parentDir = getDatabaseFile().getParent();
// Check if we should add it as primary file dir (first in the list) or not:
Expand All @@ -160,7 +160,7 @@ public List<String> getFileDirectory(String fieldName) {
private String getFileDirectoryPath(String directoryName) {
String dir = directoryName;
// If this directory is relative, we try to interpret it as relative to
// the file path of this bib file:
// the file path of this BIB file:
if (!new File(dir).isAbsolute() && (getDatabaseFile() != null)) {
String relDir;
if (".".equals(dir)) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/sf/jabref/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private List<ParserResult> importAndOpenFiles() {
if (!cli.isBlank() && (cli.getLeftOver().length > 0)) {
for (String aLeftOver : cli.getLeftOver()) {
// Leftover arguments that have a "bib" extension are interpreted as
// bib files to open. Other files, and files that could not be opened
// BIB files to open. Other files, and files that could not be opened
// as bib, we try to import instead.
boolean bibExtension = aLeftOver.toLowerCase(Locale.ENGLISH).endsWith("bib");
ParserResult pr = null;
Expand Down Expand Up @@ -294,7 +294,7 @@ private boolean generateAux(List<ParserResult> loaded, String[] data) {
SaveSession session = databaseWriter.saveDatabase(new BibDatabaseContext(newBase, defaults),
prefs);

// Show just a warning message if encoding didn't work for all characters:
// Show just a warning message if encoding did not work for all characters:
if (!session.getWriter().couldEncodeAll()) {
System.err.println(Localization.lang("Warning") + ": "
+ Localization.lang(
Expand Down Expand Up @@ -336,7 +336,7 @@ private void exportFile(List<ParserResult> loaded, String[] data) {
SaveSession session = databaseWriter.saveDatabase(
new BibDatabaseContext(pr.getDatabase(), pr.getMetaData(), defaults), prefs);

// Show just a warning message if encoding didn't work for all characters:
// Show just a warning message if encoding did not work for all characters:
if (!session.getWriter().couldEncodeAll()) {
System.err.println(Localization.lang("Warning") + ": "
+ Localization.lang(
Expand Down Expand Up @@ -438,7 +438,7 @@ private void regenerateBibtexKeys(List<ParserResult> loaded) {
LabelPatternUtil.makeLabel(metaData, database, entry, Globals.prefs);
}
} else {
LOGGER.info(Localization.lang("No meta data present in bibfile. Cannot regenerate BibTeX keys"));
LOGGER.info(Localization.lang("No meta data present in BIB_file. Cannot regenerate BibTeX keys"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Underscore? The other examples use just BIB file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
}
Expand Down Expand Up @@ -483,7 +483,7 @@ private Optional<ParserResult> fetch(String fetchCommand) {
}

String query = split[1];
System.out.println(Localization.lang("Running Query '%0' with fetcher '%1'.", query, engine) + " "
System.out.println(Localization.lang("Running query '%0' with fetcher '%1'.", query, engine) + " "
+ Localization.lang("Please wait..."));
Collection<BibEntry> result = new ImportInspectionCommandLine().query(query, fetcher);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/cli/JabRefCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private Options getOptions() {

options.addOption(Option.builder("a").
longOpt("aux").
desc(String.format("%s: %s[.aux],%s[.bib]", Localization.lang("Subdatabase from aux"),
desc(String.format("%s: %s[.aux],%s[.bib]", Localization.lang("Subdatabase from AUX"),
Localization.lang("file"),
Localization.lang("new"))).
hasArg().
Expand All @@ -214,7 +214,7 @@ private Options getOptions() {

options.addOption(Option.builder("f").
longOpt("fetch").
desc(Localization.lang("Run Fetcher, e.g. \"--fetch=Medline:cancer\"")).
desc(Localization.lang("Run fetcher, e.g. \"--fetch=Medline:cancer\"")).
hasArg().
argName("FILE").
build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void download(URL url, final DownloadCallback callback) throws IOExceptio
if (suggestedType.isPresent()) {
suffix = suggestedType.get().getExtension();
} else {
// If we didn't find a file type from the MIME type, try based on extension:
// If we did not find a file type from the MIME type, try based on extension:
suffix = getSuffix(res);
if (suffix == null) {
suffix = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public TransferableFileLinkSelection(BasePanel panel, BibEntry[] selection) {
String dir = panel.metaData().getFileDirectory(GUIGlobals.FILE_FIELD);
// Include the standard "file" directory:
String fileDir = panel.metaData().getFileDirectory(GUIGlobals.FILE_FIELD);
// Include the directory of the bib file:
// Include the directory of the BIB file:
String[] dirs;
if (panel.metaData().getDatabaseFile() != null) {
String databaseDir = panel.metaData().getDatabaseFile().getParent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void pushEntries(BibDatabase database, List<BibEntry> entries, String key
Runtime.getRuntime().exec(getCommandLine(keyString));
}

// In case it didn't work
// In case it did not work
catch (IOException excep) {
couldNotCall = true;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/sf/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ private JPopupMenu tabPopupMenu() {

// Close actions
JMenuItem close = new JMenuItem(Localization.lang("Close"));
JMenuItem closeOthers = new JMenuItem(Localization.lang("Close Others"));
JMenuItem closeAll = new JMenuItem(Localization.lang("Close All"));
JMenuItem closeOthers = new JMenuItem(Localization.lang("Close others"));
JMenuItem closeAll = new JMenuItem(Localization.lang("Close all"));
close.addActionListener(closeDatabaseAction);
closeOthers.addActionListener(closeOtherDatabasesAction);
closeAll.addActionListener(closeAllDatabasesAction);
Expand Down Expand Up @@ -701,7 +701,7 @@ private void initSidePane() {
}

/**
* The MacAdapter calls this method when a ".bib" file has been double-clicked from the Finder.
* The MacAdapter calls this method when a "BIB" file has been double-clicked from the Finder.
*/
public void openAction(String filePath) {
File file = new File(filePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import net.sf.jabref.preferences.JabRefPreferences;

/**
* The action concerned with generate a new (sub-)database from latex aux file.
* The action concerned with generate a new (sub-)database from latex AUX file.
*/
public class NewSubDatabaseAction extends MnemonicAwareAction {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

*/

// A wizard dialog for generating a new sub database from existing TeX aux file
// A wizard dialog for generating a new sub database from existing TeX AUX file
//
// created by : r.nagel 23.08.2004
//
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static boolean openExternalFileAnyFormat(final BibDatabaseContext databas
openExternalFilePlatformIndependent(type, filePath);
return true;
} else {
// No file matched the name, or we didn't know the file type.
// No file matched the name, or we did not know the file type.
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private boolean handleDraggedFiles(List<File> files, final int dropRow) {
fileNames[i] = file.getAbsolutePath();
i++;
}
// Try to load bib files normally, and import the rest into the current
// Try to load BIB files normally, and import the rest into the current
// database.
// This process must be spun off into a background thread:
JabRefExecutorService.INSTANCE.execute(() -> {
Expand All @@ -336,7 +336,7 @@ private boolean handleDraggedFiles(List<File> files, final int dropRow) {
}

/**
* Take a set of filenames. Those with names indicating bib files are opened as such if possible. All other files we
* Take a set of filenames. Those with names indicating BIB files are opened as such if possible. All other files we
* will attempt to import into the current database.
*
* @param fileNames The names of the files to open.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/help/NewVersionDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public NewVersionDialog(JFrame frame, Version currentVersion, Version latestVers
JLabel lblCurrentVersion = new JLabel(Localization.lang("Installed version") + ": " + currentVersion.getFullVersion());
JLabel lblLatestVersion = new JLabel(Localization.lang("Latest version") + ": " + latestVersion.getFullVersion());

String localization = Localization.lang("To see what's new view the changelog.");
String localization = Localization.lang("To see what is new view the changelog.");
JLabel lblMoreInformation = new JLabel("<HTML><a href=" + latestVersion.getChangelogUrl() + "'>" + localization + "</a></HTML>");
lblMoreInformation.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
lblMoreInformation.addMouseListener(new MouseInputAdapter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

/**
* List event, mouse, key and focus listener for the main table that makes up the
* most part of the BasePanel for a single bib database.
* most part of the BasePanel for a single BIB database.
*/
public class MainTableSelectionListener implements ListEventListener<BibEntry>, MouseListener,
KeyListener, FocusListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import com.jgoodies.forms.layout.FormLayout;

/**
* Tools for automatically detecting jar and executable paths to OpenOffice and/or LibreOffice.
* Tools for automatically detecting JAR and executable paths to OpenOffice and/or LibreOffice.
*/
public class AutoDetectPaths extends AbstractWorker {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/openoffice/OOBibBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public void insertEntry(List<BibEntry> entries, BibDatabase database,
} catch (DisposedException ex) {
// We need to catch this one here because the OpenOfficePanel class is
// loaded before connection, and therefore cannot directly reference
// or catch a DisposedException (which is in a OO jar file).
// or catch a DisposedException (which is in a OO JAR file).
throw new ConnectionLostException(ex.getMessage());
}
}
Expand All @@ -403,7 +403,7 @@ public List<String> refreshCiteMarkers(List<BibDatabase> databases, OOBibStyle s
} catch (DisposedException ex) {
// We need to catch this one here because the OpenOfficePanel class is
// loaded before connection, and therefore cannot directly reference
// or catch a DisposedException (which is in a OO jar file).
// or catch a DisposedException (which is in a OO JAR file).
throw new ConnectionLostException(ex.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private void connect(boolean auto) {
}
}

// Add OO jars to the classpath:
// Add OO JARs to the classpath:
try {
List<File> jarFiles = Arrays.asList(new File(ooJarsDirectory, "unoil.jar"),
new File(ooJarsDirectory, "jurt.jar"), new File(ooJarsDirectory, "juh.jar"),
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/sf/jabref/gui/preftabs/FileTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public FileTab(JabRefFrame frame, JabRefPreferences prefs) {
this.frame = frame;

fileDir = new JTextField(25);
bibLocAsPrimaryDir = new JCheckBox(Localization.lang("Use the bib file location as primary file directory"));
bibLocAsPrimaryDir = new JCheckBox(Localization.lang("Use the BIB file location as primary file directory"));
bibLocAsPrimaryDir.setToolTipText(Localization.lang("When downloading files, or moving linked files to the "
+ "file directory, prefer the bib file location rather than the file directory set above"));
+ "file directory, prefer the BIB file location rather than the file directory set above"));
runAutoFileSearch = new JCheckBox(Localization.lang("When opening file link, search for matching file if no link is defined"));
allowFileAutoOpenBrowse = new JCheckBox(Localization.lang("Automatically open browse dialog when creating new file link"));
regExpTextField = new JTextField(25);
Expand All @@ -104,7 +104,7 @@ public FileTab(JabRefFrame frame, JabRefPreferences prefs) {
autoSaveInterval = new JSpinner(new SpinnerNumberModel(1, 1, 60, 1));
valueDelimiter = new JComboBox<>(new String[] {
Localization.lang("Quotes") + ": \", \"",
Localization.lang("Curly Brackets") + ": {, }"});
Localization.lang("Curly brackets") + ": {, }"});
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 All @@ -114,7 +114,7 @@ public FileTab(JabRefFrame frame, JabRefPreferences prefs) {
// This is sort of a quick hack
newlineSeparator = new JComboBox<>(new String[] {"CR", "CR/LF", "LF"});

reformatFileOnSaveAndExport = new JCheckBox(Localization.lang("Always reformat .bib file on save and export"));
reformatFileOnSaveAndExport = new JCheckBox(Localization.lang("Always reformat BIB file on save and export"));

nonWrappableFields = new JTextField(25);
doNotResolveStringsFor = new JTextField(30);
Expand Down Expand Up @@ -169,7 +169,7 @@ public FileTab(JabRefFrame frame, JabRefPreferences prefs) {
builder.append(useRegExpComboBox);
builder.append(regExpTextField);

builder.append(new HelpAction(Localization.lang("Help on Regular Expression Search"),
builder.append(new HelpAction(Localization.lang("Help on regular expression search"),
HelpFile.REGEX_SEARCH)
.getHelpButton());
builder.nextLine();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/preftabs/GeneralTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void storeSettings() {
if (prefs.getBoolean(JabRefPreferences.MEMORY_STICK_MODE) && !memoryStick.isSelected()) {
JOptionPane.showMessageDialog(null, Localization.lang("To disable the memory stick mode"
+ " rename or remove the jabref.xml file in the same folder as JabRef."),
Localization.lang("Memory Stick Mode"),
Localization.lang("Memory stick mode"),
JOptionPane.INFORMATION_MESSAGE);
}
prefs.putBoolean(JabRefPreferences.MEMORY_STICK_MODE, memoryStick.isSelected());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ public Object getValueAt(int row, int column) {

@Override
public String getColumnName(int col) {
return col == 0 ? Localization.lang("Formatter Name") :
Localization.lang("Format String");
return col == 0 ? Localization.lang("Formatter name") :
Localization.lang("Format string");
}

@Override
Expand Down Expand Up @@ -198,7 +198,7 @@ public void setValueAt(Object value, int row, int col) {

tabPanel.add(toolBar, BorderLayout.EAST);

builder.appendSeparator(Localization.lang("Special Name Formatters"));
builder.appendSeparator(Localization.lang("Special name formatters"));
builder.nextLine();
builder.append(pan);
builder.append(tabPanel);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/worker/VersionWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected Version doInBackground() throws Exception {
try {
return Version.getLatestVersion();
} catch (IOException ioException) {
LOGGER.warn("Couldn't connect to the updateserver.", ioException);
LOGGER.warn("Could not connect to the updateserver.", ioException);
return null;
}
}
Expand All @@ -66,7 +66,7 @@ public void done(){
Version latestVersion = this.get();

if (latestVersion == null){
String couldNotConnect = Localization.lang("Couldn't connect to the update server.");
String couldNotConnect = Localization.lang("Could not connect to the update server.");
String tryLater = Localization.lang("Please try again later and/or check your network connection.");
if (manualExecution) {
JOptionPane.showMessageDialog(this.mainFrame, couldNotConnect + "\n" + tryLater,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void run() {
if (Globals.prefs.getBoolean(JabRefPreferences.PROMPT_BEFORE_USING_AUTOSAVE)) {
int answer = JOptionPane.showConfirmDialog(null, "<html>" +
Localization.lang("An autosave file was found for this database. This could indicate "
+ "that JabRef didn't shut down cleanly last time the file was used.") + "<br>"
+ "that JabRef did not shut down cleanly last time the file was used.") + "<br>"
+ Localization.lang("Do you want to recover the database from the autosave file?") + "</html>",
Localization.lang("Autosave of file '%0'", file.getName()), JOptionPane.YES_NO_OPTION);
tryingAutosave = answer == JOptionPane.YES_OPTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/**
* This action checks whether any new custom entry types were loaded from this
* bib file. If so, an offer to remember these entry types is given.
* BIB file. If so, an offer to remember these entry types is given.
*/
public class CheckForNewEntryTypesAction implements PostOpenAction {

Expand Down
Loading