# HG changeset patch # User František Kučera # Date 1293552128 -3600 # Node ID 8854e172a18fe300b0a1322079ad50305508552c # Parent 29bb4fcbb204da27eb5a6c83661751afae2c9667 Lokalizace + anglický překlad. diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Překlady.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Překlady.properties Tue Dec 28 17:02:08 2010 +0100 @@ -0,0 +1,1 @@ +Překlady_cs.properties \ No newline at end of file diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Překlady_cs.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Překlady_cs.properties Tue Dec 28 17:02:08 2010 +0100 @@ -0,0 +1,14 @@ +titulek=Roz\u0161\u00ed\u0159en\u00e9 stributy souboru: {0} + +chyba.titulek=Chyba +chyba.souborNeexistuje=Soubor neexistuje: {0} +chyba.chyb\u00edParametr=O\u010dek\u00e1v\u00e1m pr\u00e1v\u011b jeden parametr \u2013 n\u00e1zev souboru. +chyba.nepoda\u0159iloSeSmazat=Nepoda\u0159ilo se smazat atribut. +chyba.nepoda\u0159iloSeNa\u010d\u00edst=Nepoda\u0159ilo se na\u010d\u00edst atributy + +tabulka.n\u00e1zev=N\u00e1zev +tabulka.hodnota=Hodnota + +p\u0159idatAtribut=P\u0159idat atribut +smazatAtribut=Smazat atribut +znovuNa\u010d\u00edst=Znovu na\u010d\u00edst diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Překlady_en.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Překlady_en.properties Tue Dec 28 17:02:08 2010 +0100 @@ -0,0 +1,14 @@ +titulek=Extended Attributes of file: {0} + +chyba.titulek=Error +chyba.souborNeexistuje=File does not exist: {0} +chyba.chyb\u00edParametr=Expecting one parameter \u2013 file name. +chyba.nepoda\u0159iloSeSmazat=Failed to delete the attribute. +chyba.nepoda\u0159iloSeNa\u010d\u00edst=Failed to load attributes. + +tabulka.n\u00e1zev=Name +tabulka.hodnota=Value + +p\u0159idatAtribut=Add attribute +smazatAtribut=Delete attribute +znovuNa\u010d\u00edst=Reload all diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Startér.java --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Startér.java Thu Dec 16 01:31:11 2010 +0100 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Startér.java Tue Dec 28 17:02:08 2010 +0100 @@ -8,6 +8,8 @@ import java.awt.event.KeyEvent; import java.io.File; import java.io.IOException; +import java.text.MessageFormat; +import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JComponent; @@ -30,6 +32,7 @@ public class Startér { private static final Logger log = Logger.getLogger(Startér.class.getSimpleName()); + private static final ResourceBundle překlady = ResourceBundle.getBundle("cz.frantovo.rozsireneAtributy.Překlady"); /** * @param args název souboru @@ -37,6 +40,7 @@ */ public static void main(String[] args) throws IOException { + if (args.length == 1 && args[0].length() > 0) { File soubor = new File(args[0]); @@ -60,21 +64,21 @@ }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - f.setTitle("Rozšířené stributy souboru: " + soubor); + f.setTitle(MessageFormat.format(překlady.getString("titulek"), soubor)); f.setSize(640, 240); f.setLocationRelativeTo(null); f.setVisible(true); } else { - ukončiChybou("Soubor neexistuje: " + soubor); + ukončiChybou(MessageFormat.format(překlady.getString("chyba.souborNeexistuje"), soubor)); } } else { - ukončiChybou("Očekávám právě jeden parametr – název souboru."); + ukončiChybou(překlady.getString("chyba.chybíParametr")); } } private static void ukončiChybou(String hláška) { log.log(Level.SEVERE, hláška); - JOptionPane.showMessageDialog(null, hláška, "Chyba", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, hláška, překlady.getString("chyba.titulek"), JOptionPane.ERROR_MESSAGE); System.exit(1); } } diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Model.java --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Model.java Thu Dec 16 01:31:11 2010 +0100 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Model.java Tue Dec 28 17:02:08 2010 +0100 @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.event.TableModelEvent; @@ -22,7 +23,8 @@ public class Model implements TableModel { private static final Logger log = Logger.getLogger(Model.class.getSimpleName()); - private String[] sloupečky = {"Název", "Hodnota"}; + private static final ResourceBundle překlady = ResourceBundle.getBundle("cz.frantovo.rozsireneAtributy.Překlady"); + private String[] sloupečky = {překlady.getString("tabulka.název"), překlady.getString("tabulka.hodnota")}; private HashSet posluchače = new HashSet(); private UserDefinedFileAttributeView souborovýSystém; private ArrayList atributy = new ArrayList(); diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.form --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.form Thu Dec 16 01:31:11 2010 +0100 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.form Tue Dec 28 17:02:08 2010 +0100 @@ -68,7 +68,9 @@ - + + + @@ -77,7 +79,9 @@ - + + + @@ -87,7 +91,9 @@ - + + + diff -r 29bb4fcbb204 -r 8854e172a18f java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java Thu Dec 16 01:31:11 2010 +0100 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java Tue Dec 28 17:02:08 2010 +0100 @@ -2,6 +2,7 @@ import cz.frantovo.rozsireneAtributy.Atribut; import java.io.IOException; +import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; @@ -15,6 +16,7 @@ public class Panel extends javax.swing.JPanel { private static final Logger log = Logger.getLogger(Panel.class.getSimpleName()); + private static final ResourceBundle překlady = ResourceBundle.getBundle("cz.frantovo.rozsireneAtributy.Překlady"); private Model model; private Atribut vybranýAtribut; @@ -44,7 +46,7 @@ } private void zobrazChybovouHlášku(String hláška, Throwable chyba) { - JOptionPane.showMessageDialog(this, hláška, "Chyba", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(this, hláška, překlady.getString("chyba"), JOptionPane.ERROR_MESSAGE); log.log(Level.WARNING, hláška, chyba); } @@ -73,7 +75,8 @@ posuvnýPanel.setViewportView(tabulka); tlačítkoPřidat.setMnemonic('p'); - tlačítkoPřidat.setText("Přidat atribut"); + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("cz/frantovo/rozsireneAtributy/Překlady"); // NOI18N + tlačítkoPřidat.setText(bundle.getString("přidatAtribut")); // NOI18N tlačítkoPřidat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tlačítkoPřidatActionPerformed(evt); @@ -81,7 +84,7 @@ }); tlačítkoSmazat.setMnemonic('s'); - tlačítkoSmazat.setText("Smazat atribut"); + tlačítkoSmazat.setText(bundle.getString("smazatAtribut")); // NOI18N tlačítkoSmazat.setEnabled(false); tlačítkoSmazat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -90,7 +93,7 @@ }); tlačítkoZnovuNačíst.setMnemonic('z'); - tlačítkoZnovuNačíst.setText("Znovu načíst"); + tlačítkoZnovuNačíst.setText(bundle.getString("znovuNačíst")); // NOI18N tlačítkoZnovuNačíst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tlačítkoZnovuNačístActionPerformed(evt); @@ -132,7 +135,7 @@ try { model.odeberAtribut(vybranýAtribut); } catch (IOException e) { - zobrazChybovouHlášku("Nepodařilo se smazat atribut.", e); + zobrazChybovouHlášku(překlady.getString("chyba.nepodařiloSeSmazat"), e); } }//GEN-LAST:event_tlačítkoSmazatActionPerformed @@ -140,7 +143,7 @@ try { model.načtiAtributy(); } catch (IOException e) { - zobrazChybovouHlášku("Nepodařilo se načíst atributy", e); + zobrazChybovouHlášku(překlady.getString("chyba.nepodařiloSeNačíst"), e); } }//GEN-LAST:event_tlačítkoZnovuNačístActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables diff -r 29bb4fcbb204 -r 8854e172a18f rozšířené-atributy.sh --- a/rozšířené-atributy.sh Thu Dec 16 01:31:11 2010 +0100 +++ b/rozšířené-atributy.sh Tue Dec 28 17:02:08 2010 +0100 @@ -5,4 +5,7 @@ SWING_LAF="-Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"; JAR="java/rozsirene-atributy/dist/rozsirene-atributy.jar"; +# For English localization uncomment this: +# LANG="en_US.utf8"; + ${JAVA_BIN} ${SWING_LAF} -jar ${JAR} "${1}";