Fixing error message handling for the Import dialog. Also updated the

TextBundle#get method to check for the key. If the key does not exist,
return a string indicating was is missing to help track this down in the
future.
This commit is contained in:
Rob Greene 2022-01-09 17:14:43 -06:00
parent 680c7abac9
commit 366c921ed5
2 changed files with 8 additions and 3 deletions

View File

@ -66,7 +66,12 @@ public class TextBundle {
* Retrieve a value for the given resource name.
*/
public String get(String name) {
return resourceBundle.getString(name);
if (resourceBundle.containsKey(name)) {
return resourceBundle.getString(name);
}
else {
return String.format("KeyNotFound: %s", name);
}
}
/**

View File

@ -23,9 +23,9 @@ DeleteFileHoverText=Delete a file (CTRL+D)
DeleteFileErrorTitle=Unable to view a deleted file!
ResizeDiskTitle = Resize disk?
ResizeDiskMessage = This disk needs to be resized to match the formatted capacity. This should be an ApplePC HDV disk image - they typically start at 0 bytes and grow to the maximum capacity (32MB). Resize the disk?
ImportFileTitle = Unable to import file(s)!
ImportMenuItem=Import...\tCTRL+I
ImportFileMessage = An error occurred during import!\n\nException was "{0}".
ImportErrorTitle = Unable to import file(s)!
ImportErrorMessage = An error occurred during import!\n\nException was "{0}".
FilesTab=Files
ExpandMenuItem=Expand\t+
CollapseMenuItem=Collapse\t-