#Issue 14 use parameters in BUNDLE

This commit is contained in:
Didier Clermonté 2016-06-07 00:21:31 +02:00
parent 5a3c7f863c
commit 481aff9124
7 changed files with 26 additions and 29 deletions

Binary file not shown.

View File

@ -75,16 +75,15 @@ public class SibaCLI
{
boolean result;
result = SibaManager.check(fileToCheck);
String yourFile = BUNDLE.getString("confirmDialogYourString.text"); //$NON-NLS-1$
String good = BUNDLE.getString("confirmDialogGood.text"); //$NON-NLS-1$
String bad = BUNDLE.getString("confirmDialogBad.text"); //$NON-NLS-1$
if (result)
{
System.out.println(yourFile + fileToCheck.getName() + good);
String message = String.format(BUNDLE.getString("confirmDialogGood.text"), fileToCheck.getName());
System.out.println(message);
}
else
{
System.out.println(yourFile + fileToCheck.getName() + bad);
String message = String.format(BUNDLE.getString("confirmDialogBad.text"), fileToCheck.getName());
System.out.println(message);
}
}

View File

@ -1,7 +1,7 @@
confirmDialog.text=Your directory has been backup \n in the file :\n
confirmDialogYourString.text=Your File
confirmDialogGood.text=has been check and is good
confirmDialogBad.text = is corrupted
confirmDialogGood.text=Your File %s has been check and is good
confirmDialogBad.text =Your File %s is corrupted
badUsage.text = Bad usage
missingDirectoryToSave.text = Missing the directory to backup
directoryToSaveNotExist.text = The directory to save do not exist

View File

@ -1,7 +1,7 @@
confirmDialog.text = Votre répertoire a été sauvegardé \n dans le fichier :\n
confirmDialogYourString.text=Votre fichier
confirmDialogGood.text=a été vérifié et ne comporte pas d'erreurs
confirmDialogBad.text = comporte des erreurs
confirmDialogGood.text=Votre fichier %s a été vérifié et ne comporte pas d'erreurs
confirmDialogBad.text = Votre fichier %s comporte des erreurs
badUsage.text = mauvais usage
missingDirectoryToSave.text = Il manque le répertoire à sauvegarder
directoryToSaveNotExist.text = Le répertoire à sauvegarder n'existe pas

View File

@ -85,7 +85,7 @@ public class CheckPanel extends JPanel
{
try
{
CheckPanel.this.choosenFile = choosenDirectory();
CheckPanel.choosenFile = choosenDirectory();
}
catch (IOException e1)
@ -101,9 +101,9 @@ public class CheckPanel extends JPanel
}
});
this.textField = new JTextField();
add(this.textField, "3, 2, fill, default");
this.textField.setColumns(10);
CheckPanel.textField = new JTextField();
add(CheckPanel.textField, "3, 2, fill, default");
CheckPanel.textField.setColumns(10);
add(btnNewButton, "4, 2, left, top");
JButton btnNewButton_1 = new JButton(BUNDLE.getString("CheckPanel.btnNewButton_1.text")); //$NON-NLS-1$
@ -116,22 +116,20 @@ public class CheckPanel extends JPanel
try
{
if (!(CheckPanel.this.choosenFile == null) && CheckPanel.this.choosenFile.exists())
if (!(CheckPanel.choosenFile == null) && CheckPanel.choosenFile.exists())
{
boolean check = SibaManager.check(CheckPanel.this.choosenFile);
boolean check = SibaManager.check(CheckPanel.choosenFile);
String titre = BUNDLE.getString("CheckPanel.confirmDialogTitle.text");
String yourFile = BUNDLE.getString("CheckPanel.confirmDialogYourString.text");
if (check)
{
String message = yourFile + CheckPanel.this.choosenFile.getName() + " "
+ BUNDLE.getString("CheckPanel.confirmDialogGood.text");
String message = String.format(BUNDLE.getString("CheckPanel.confirmDialogGood.text"),
CheckPanel.choosenFile.getName());
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
}
else
{
String message = yourFile + CheckPanel.this.choosenFile.getName() + " "
+ BUNDLE.getString("CheckPanel.confirmDialogBad.text");
String message = String.format(BUNDLE.getString("CheckPanel.confirmDialogBad.text"),
CheckPanel.choosenFile.getName());
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
}
}
@ -157,11 +155,11 @@ public class CheckPanel extends JPanel
{
File result;
this.choosenFile = CheckDirectorySelector.showSelectorDialog(null, null);
if (!(CheckPanel.this.choosenFile == null) && CheckPanel.this.choosenFile.exists())
CheckPanel.choosenFile = CheckDirectorySelector.showSelectorDialog(null, null);
if (!(CheckPanel.choosenFile == null) && CheckPanel.choosenFile.exists())
{
this.textField.setText(this.choosenFile.getName());
result = this.choosenFile;
CheckPanel.textField.setText(CheckPanel.choosenFile.getName());
result = CheckPanel.choosenFile;
}
else
{

View File

@ -18,8 +18,8 @@ BackupPanel.targetFileChooserButton.text=Target Directory
CheckDirectorySelector.this.dialogTitle=Directory where is the backup
CheckPanel.btnNewButton.text=\u2026
CheckPanel.btnNewButton_1.text=Check
CheckPanel.confirmDialogBad.text=is corrupted
CheckPanel.confirmDialogGood.text=has been check and is good
CheckPanel.confirmDialogBad.text=Your File %s is corrupted
CheckPanel.confirmDialogGood.text=Your File %s has been check and is good
CheckPanel.confirmDialogTitle.text=Check done
CheckPanel.confirmDialogYourString.text=Your File
CheckPanel.lblNewLabel.text=File to be Checked

View File

@ -23,8 +23,8 @@ BackupPanel.confirmDialogTitle.text = Sauvegarde faite
BackupPanel.confirmDialogMessage.text = Votre répertoire a été sauvegardé \n dans le fichier :\n
CheckPanel.confirmDialogTitle.text = Vérification faite
CheckPanel.confirmDialogYourString.text = Votre fichier
CheckPanel.confirmDialogGood.text = a été vérifié et ne comporte pas d'erreurs
CheckPanel.confirmDialogBad.text = comporte des erreurs
CheckPanel.confirmDialogGood.text = Votre fichier %s a été vérifié et ne comporte pas d'erreurs
CheckPanel.confirmDialogBad.text = Votre fichier %s comporte des erreurs
BackupPanel.dataMissing.text = Données incomplètes
BackupPanel.TitleWarning.text = Attention
SibaGUI.mnFile.text=Fichier