Big Demo for I18N : ResourceBundle « I18N « Java






Big Demo for I18N

        

/*
Java Internationalization
By Andy Deitsch, David Czarnecki

ISBN: 0-596-00019-7
O'Reilly
*/

import java.awt.*;
import java.awt.event.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;

public class SimpleExample extends JPanel {

  static JFrame frame;
  static Font smallFont;
  static Font mediumFont;
  static Font bigFont;

  private ResourceBundle resources;
  private ComponentOrientation co;

  private static void applyComponentOrientation(Component c, ComponentOrientation o) {

    c.setComponentOrientation(o);

    if (c instanceof JMenu) {
      JMenu menu = (JMenu)c;
      int ncomponents = menu.getMenuComponentCount();
      for (int i = 0 ; i < ncomponents ; ++i) {
        applyComponentOrientation( menu.getMenuComponent(i), o );
      }
    } else if (c instanceof Container) {
      Container container = (Container)c;
      int ncomponents = container.getComponentCount();
      for (int i = 0 ; i < ncomponents ; ++i) {
        applyComponentOrientation( container.getComponent(i), o );
      }
    }
  }

  private void loadResources() {
    try {
      resources = ResourceBundle.getBundle("Simple",
                        Locale.getDefault());
    } catch (MissingResourceException mre) {
      mre.printStackTrace();
      System.exit(1);
    }
  }

  private static JFrame getFrame() {
    return frame;
  }

  public SimpleExample() {

    // Load our resource bundle
    loadResources();

    JRadioButton oneButton, twoButton, threeButton;
    JButton button;

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    ge.getAllFonts();

    // Setup the fonts
    smallFont = new Font("Bitstream Cyberbit", Font.PLAIN, 14);
    mediumFont = new Font("Bitstream Cyberbit", Font.PLAIN, 18);
    bigFont = new Font("Bitstream Cyberbit", Font.PLAIN, 20);

    co = ComponentOrientation.getOrientation(Locale.getDefault());

    setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
    String language = Locale.getDefault().getLanguage();

    // Create the buttons
    button = new JButton(resources.getString("Hello"));
    button.setToolTipText(resources.getString("HelloToolTip"));
    button.setFont(mediumFont);

    // Setup the buttons
    oneButton = new JRadioButton(resources.getString("One"));
    oneButton.setFont(mediumFont);
    oneButton.setMnemonic(resources.getString("OneMnemonic").charAt(0));
    oneButton.setHorizontalAlignment(JButton.TRAILING);
    oneButton.setHorizontalTextPosition(JButton.TRAILING);

    twoButton = new JRadioButton(resources.getString("Two"));
    twoButton.setFont(mediumFont);
    twoButton.setMnemonic(resources.getString("TwoMnemonic").charAt(0));
    twoButton.setHorizontalAlignment(JButton.TRAILING);
    twoButton.setHorizontalTextPosition(JButton.TRAILING);

    threeButton = new JRadioButton(resources.getString("Three"));
    threeButton.setFont(mediumFont);
    threeButton.setMnemonic(resources.getString("ThreeMnemonic").charAt(0));
    threeButton.setHorizontalAlignment(JButton.TRAILING);
    threeButton.setHorizontalTextPosition(JButton.TRAILING);

    // Group the radio buttons
    ButtonGroup group = new ButtonGroup();
    group.add(oneButton);
    group.add(twoButton);
    group.add(threeButton);

    // Register a listener for the radio buttons
    RadioListener myListener = new RadioListener();
    oneButton.addActionListener(myListener);
    twoButton.addActionListener(myListener);
    threeButton.addActionListener(myListener);

    // Setup the button panel
    JPanel buttonPanel = new JPanel();
    buttonPanel.setMaximumSize(new Dimension(Short.MAX_VALUE,100));
    TitledBorder tb = new TitledBorder(resources.getString("Numbers"));
    tb.setTitleFont(smallFont);
    tb.setTitleJustification(
        co.isLeftToRight() ? TitledBorder.LEFT : TitledBorder.RIGHT);

    buttonPanel.setBorder(tb);
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(button);
    buttonPanel.add(oneButton);
    buttonPanel.add(twoButton);
    buttonPanel.add(threeButton);

    add(buttonPanel, BorderLayout.CENTER);

    // Setup the date panel
    JPanel datePanel = new JPanel();
    datePanel.setMaximumSize(new Dimension(Short.MAX_VALUE,100));
    tb = new TitledBorder(resources.getString("Dates"));
    tb.setTitleFont(smallFont);
    tb.setTitleJustification(
        co.isLeftToRight() ? TitledBorder.LEFT : TitledBorder.RIGHT);

    datePanel.setBorder(tb);
    datePanel.setLayout(new BoxLayout(datePanel,BoxLayout.X_AXIS));
    datePanel.add(Box.createRigidArea(new Dimension(5,1)));

    DateFormatSymbols dfs = new DateFormatSymbols();

    JComboBox months = new JComboBox(dfs.getMonths());
    months.setFont(mediumFont);

    String weekDays[] = dfs.getWeekdays();
    JComboBox days = new JComboBox();
    days.setFont(mediumFont);

    // Determine what day is the first day of the week
    GregorianCalendar cal = new GregorianCalendar();

    int firstDayOfWeek = cal.getFirstDayOfWeek();
    int dayOfWeek;

    for (dayOfWeek = firstDayOfWeek; dayOfWeek < weekDays.length; dayOfWeek++)
      days.addItem(weekDays[dayOfWeek]);

    for (dayOfWeek = 0; dayOfWeek < firstDayOfWeek; dayOfWeek++)
      days.addItem(weekDays[dayOfWeek]);

    if (!co.isLeftToRight()) {
      datePanel.add(days);
      datePanel.add(Box.createRigidArea(new Dimension(5,1)));

      datePanel.add(months);
      datePanel.add(Box.createRigidArea(new Dimension(5,1)));
    } else {
      datePanel.add(months);
      datePanel.add(Box.createRigidArea(new Dimension(5,1)));

      datePanel.add(days);
      datePanel.add(Box.createRigidArea(new Dimension(5,1)));
    }
    add(datePanel);

    // Setup the formatting panel
    JPanel formatPanel = new JPanel();
    formatPanel.setMaximumSize(new Dimension(Short.MAX_VALUE,100));
    tb = new TitledBorder(resources.getString("Formats"));
    tb.setTitleFont(smallFont);
    tb.setTitleJustification(co.isLeftToRight() ?
          TitledBorder.LEFT : TitledBorder.RIGHT);

    formatPanel.setBorder(tb);
    formatPanel.setLayout(new BoxLayout(formatPanel,BoxLayout.X_AXIS));
    formatPanel.add(Box.createRigidArea(new Dimension(5,1)));

    double theNumber = 1234.56;
    NumberFormat nFormat = NumberFormat.getInstance();
    NumberFormat cFormat = NumberFormat.getCurrencyInstance();
    NumberFormat pFormat = NumberFormat.getPercentInstance();
    DateFormat dFormat = DateFormat.getDateInstance();

    JLabel numberLabel = new JLabel(nFormat.format(theNumber));
    numberLabel.setForeground(Color.black);
    numberLabel.setFont(bigFont);

    JLabel percentLabel = new JLabel(pFormat.format(theNumber));
    percentLabel.setForeground(Color.black);
    percentLabel.setFont(bigFont);

    JLabel currencyLabel = new JLabel(cFormat.format(theNumber));
    currencyLabel.setForeground(Color.black);
    currencyLabel.setFont(bigFont);

    JLabel dateLabel = new JLabel(dFormat.format(new Date()));
    dateLabel.setForeground(Color.black);
    dateLabel.setFont(bigFont);

    formatPanel.add(Box.createRigidArea(new Dimension(25,1)));

    if (co.isLeftToRight()) {
      formatPanel.add(numberLabel);
      formatPanel.add(Box.createRigidArea(new Dimension(25,1)));
      formatPanel.add(percentLabel);
      formatPanel.add(Box.createRigidArea(new Dimension(25,1)));
      formatPanel.add(currencyLabel);
      formatPanel.add(Box.createRigidArea(new Dimension(25,1)));
      formatPanel.add(dateLabel);
    } else {
      formatPanel.add(dateLabel);
      formatPanel.add(Box.createRigidArea(new Dimension(25,1)));
      formatPanel.add(currencyLabel);
      formatPanel.add(Box.createRigidArea(new Dimension(25,1)));
      formatPanel.add(percentLabel);
      formatPanel.add(Box.createRigidArea(new Dimension(25,1)));
      formatPanel.add(numberLabel);
    }
    formatPanel.add(Box.createRigidArea(new Dimension(25,1)));

    add(formatPanel);
  }

  public JMenuBar createMenuBar() {
    JMenuBar menuBar = new JMenuBar();

    JMenu file =
      (JMenu) menuBar.add(new JMenu(resources.getString("FileMenu")));
    file.setFont(mediumFont);
      file.setMnemonic(resources.getString("FileMenuMnemonic").charAt(0));

    JMenuItem exitItem = (JMenuItem)
      file.add(new JMenuItem(resources.getString("FileMenuExit")));
    exitItem.setFont(mediumFont);
      exitItem.setMnemonic(resources.getString("FileMenuExitMnemonic").charAt(0));
    exitItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          System.exit(0);
        }
      });

    menuBar.add(new LocaleChanger());

    return menuBar;
  }

  public void reloadResources() {
    try {
      resources = ResourceBundle.getBundle("resources.Simple", Locale.getDefault());
    } catch (MissingResourceException mre) {
      mre.printStackTrace();
      System.exit(1);
    }
  }

  /**
   * An ActionListener that listens to the radio buttons
   */
  class RadioListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      String lnfName = e.getActionCommand();

      Object[] options = { resources.getString("OK"), resources.getString("CANCEL") };
      Object[] arguments = { new Integer(3), lnfName };

      JOptionPane.showOptionDialog(null,
      MessageFormat.format(resources.getString("WarningMsg"), arguments),
          resources.getString("WarningTitle"),
          JOptionPane.DEFAULT_OPTION,
          JOptionPane.WARNING_MESSAGE,
          null, options, options[0]);
      try {
      } catch (Exception exc) {
        JRadioButton button = (JRadioButton)e.getSource();
        button.setEnabled(false);
      }
    }
  }

  /**
   * A class to change the locale for the application
   */
  class LocaleChanger extends JMenu implements ItemListener {

    public LocaleChanger() {
      super();
      setText(resources.getString("LanguageMenu"));
      setFont(mediumFont);
      setMnemonic(resources.getString("LanguageMenuMnemonic").charAt(0));

      ButtonGroup langGroup = new ButtonGroup();
      String language = Locale.getDefault().getLanguage();

      // Sort the language names according to the rules specific to each locale
      RuleBasedCollator rbc = (RuleBasedCollator)Collator.getInstance();
      ArrayList al = new ArrayList();
      al.add(resources.getString("Arabic"));
      al.add(resources.getString("Chinese"));
      al.add(resources.getString("English"));
      al.add(resources.getString("German"));
      al.add(resources.getString("Italian"));
      al.add(resources.getString("French"));
      al.add(resources.getString("Hebrew"));
      al.add(resources.getString("Japanese"));
      al.add(resources.getString("Russian"));

      Collections.sort(al, rbc);

      String langName = Locale.getDefault().getDisplayLanguage();
      for (int i = 0; i < al.size(); i++) {
        JRadioButtonMenuItem mi;
        mi = (JRadioButtonMenuItem)
          add(new JRadioButtonMenuItem((String)al.get(i)));
        mi.setFont(mediumFont);
        if (langName.equalsIgnoreCase((String)al.get(i)))
          mi.setSelected(true);
        mi.addItemListener(this);
        langGroup.add(mi);
      }
    }

    public void itemStateChanged(ItemEvent e) {
      JRadioButtonMenuItem rb = (JRadioButtonMenuItem) e.getSource();
      if (rb.isSelected()) {
        String selected = rb.getText();
        if (selected.equals(resources.getString("Arabic"))) {
          Locale.setDefault(new Locale("ar", "EG"));
          co = ComponentOrientation.RIGHT_TO_LEFT;
        } else if (selected.equals(resources.getString("English"))) {
          Locale.setDefault(Locale.US);
          co = ComponentOrientation.LEFT_TO_RIGHT;
        } else if (selected.equals(resources.getString("German"))) {
          Locale.setDefault(Locale.GERMANY);
          co = ComponentOrientation.LEFT_TO_RIGHT;
        } else if (selected.equals(resources.getString("Italian"))) {
          Locale.setDefault(Locale.ITALY);
          co = ComponentOrientation.LEFT_TO_RIGHT;
        } else if (selected.equals(resources.getString("French"))) {
          Locale.setDefault(Locale.FRANCE);
          co = ComponentOrientation.LEFT_TO_RIGHT;
        } else if (selected.equals(resources.getString("Hebrew"))) {
          Locale.setDefault(new Locale("iw", "IL"));
          co = ComponentOrientation.RIGHT_TO_LEFT;
        } else if (selected.equals(resources.getString("Chinese"))) {
          Locale.setDefault(Locale.CHINA);
          co = ComponentOrientation.LEFT_TO_RIGHT;
        } else if (selected.equals(resources.getString("Japanese"))) {
          Locale.setDefault(Locale.JAPAN);
          co = ComponentOrientation.LEFT_TO_RIGHT;
        } else if (selected.equals(resources.getString("Russian"))) {
          Locale.setDefault(new Locale("ru", "RU"));
          co = ComponentOrientation.LEFT_TO_RIGHT;
        }
      }

      SimpleExample panel = new SimpleExample();
      SimpleExample.frame.setVisible(false);
      SimpleExample.frame.getContentPane().removeAll();
      SimpleExample.frame.setJMenuBar(panel.createMenuBar());
      SimpleExample.frame.getContentPane().add("Center", panel);
      SimpleExample.frame.pack();
      SimpleExample.frame.show();
      applyComponentOrientation(SimpleExample.getFrame(), co);
    }
  }

  public static void main(String [] argv) {

    SimpleExample panel = new SimpleExample();

    frame = new JFrame("Simple Example");
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });
    frame.setJMenuBar(panel.createMenuBar());
    frame.getContentPane().add("Center", panel);
    frame.pack();
    frame.setVisible(true);
  }
}



//Simple_fr.properties
/*
Hello = Tiens! Mondial
HelloToolTip = Salut!
One = Une
OneMnemonic = u
Two = Deux
TwoMnemonic = d
Three = Troi
ThreeMnemonic = t
Dates = Dater
Numbers = Nombres

# Menus
FileMenu = Dossier
FileMenuMnemonic = D

FileMenuExit = Quitter
FileMenuExitMnemonic = q

LanguageMenu = Langue
LanguageMenuMnemonic = L

Arabic = Arabe
Chinese = Chinoise
English = Anglais
French = Fran\u00e7ais
German = Allemand
Hebrew = H\u00e9breu
Japanese = Japonais
Russian = Russe

WarningMsg = Faire un d\u00e9clic OK \u00e0 reprendre
WarningTitle = Sommation
OK = OK
CANCEL = Annulation

*/

//Simple_kr.properties
/*
Hello = Hello World!
HelloToolTip = Hey there!
One = One
OneMnemonic = o
Two = Two
TwoMnemonic = t
Three = Three
ThreeMnemonic = h
Dates = Dates
Numbers = Numbers

# Menus
FileMenu = File
FileMenuMnemonic = F

FileMenuExit = Exit
FileMenuExitMnemonic = x

LanguageMenu = Language
LanguageMenuMnemonic = L

Arabic = Arabic
Chinese = Chinese
English = English
French = French
German = German
Hebrew = Hebrew
Italian = Italian
Russian = Russian
Korean = \ud55c\uad74

WarningMsg = Click OK to continue
WarningTitle = Warning
OK = OK
CANCEL = CANCEL

*/

//Simple_ru.properties
/*
Hello = \u042d\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439 \u041c\u0438\u0440
HelloToolTip = \u042d\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439
One = \u041e\u0434\u0438\u043d
OneMnemonic = \u041e
Two = \u0414\u0432\u0430
TwoMnemonic = \u0414
Three = \u0422\u0440\u0438
ThreeMnemonic = \u0440
Dates = \u0414\u0430\u0442\u0430
Numbers = \u0427\u0438\u0441\u043b\u0430
Formats = \u0424\u043e\u0440\u043c\u0430\u0442\u044b

# Menus
FileMenu = \u0424\u0430\u0439\u043b
FileMenuMnemonic = \u0424

FileMenuExit = \u0412\u044b\u0445\u043e\u0434
FileMenuExitMnemonic = \u0412

LanguageMenu = \u042f\u0437\u044b\u043a
LanguageMenuMnemonic = \u042f

Arabic = \u0410\u0440\u0430\u0431\u0441\u043a\u0438\u0439
Chinese = \u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439
English = \u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439
French = \u0424\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0439
German = \u041d\u0435\u043c\u0435\u0446\u043a\u0438\u0439
Hebrew = \u0425\u0438\u0431\u0440\u0443
Italian = \u0418\u0442\u0430\u043b\u044c\u044f\u043d\u0441\u043a\u0438\u0439
Russian = \u0420\u0443\u0441\u0441\u043a\u0438\u0439
Japanese = \u042f\u043f\u043e\u043d\u0441\u043a\u0438\u0439
WarningMsg = Click OK to continue
WarningTitle = \u041e\u043f\u0435\u0434\u0441\u043e\u043f\u0435\u0434\u0445\u0440\u0435\u043a\u044d\u043c\u0449\u0438
OK = OK
CANCEL = CANCEL

*/


//Simple_zh.properties
/*
Hello = \u4f60\u597d
HelloToolTip = \u4f60\u597d
One = \u4e00
OneMnemonic = .
Two = \u4e8c
TwoMnemonic = .
Three = \u4e09
ThreeMnemonic = .
Dates = \u65e5\u671f
Numbers = \u6570\u76ee

# Menus
FileMenu = \u6587\u4ef6
FileMenuMnemonic = F

FileMenuExit = \u9000\u51fa
FileMenuExitMnemonic = x

LanguageMenu = \u8bed\u8a00
LanguageMenuMnemonic = L

Arabic = \u963f\u62c9\u4f2f\u8bed
Chinese = \u4e2d\u6587
English = \u82f1\u8bed
French = \u6cd5\u8bed
German = \u5fb7\u8bed
Hebrew = \u5e0c\u4f2f\u6765\u8bed
Italian = \u610f\u5927\u5229\u8bed
Japanese = \u65e5\u672c\u4eba
Russian = \u4fc4\u8bed

*/


//Simple_de.properties
/*
Hello = Guten label Welt!
HelloToolTip = Hallo!
One = Eins
OneMnemonic = e
Two = Zwei
TwoMnemonic = z
Three = Drei
ThreeMnemonic = d
Dates = Daten
Numbers = Anzahlen

# Menus
FileMenu = Datei
FileMenuMnemonic = D

FileMenuExit = Ende
FileMenuExitMnemonic = e

LanguageMenu = Sprachen
LanguageMenuMnemonic = S

Arabic = Arabisch
Chinese = Chinesisch
English = Englisch
French = Franz\u00f6sisch
German = Deutsch
Hebrew = Hebr\u00e4isch
Russian = Russisch
Japanese = Japanisch

WarningMsg = Datei {1} enth\u00e4lt {0,number,integer} Rechtschreibfehler.
WarningTitle = Warnung
OK = OK
CANCEL = CANCEL

*/


//Simple_ar.properties
/*
Hello = \u0623\u0647\u0644\u0627\u064b
HelloToolTip = \u0623\u0647\u0644\u0627\u064b
One = \u0648\u0627\u062d\u062f
OneMnemonic = \u0648
Two = \u0625\u062b\u0646\u064a\u0646
TwoMnemonic = \u0625
Three = \u062b\u0644\u0627\u062b\u0629
ThreeMnemonic = \u062b
Dates = \u062a\u0648\u0627\u0631\u064a\u062e
Numbers = \u0623\u0631\u0642\u0627\u0645

# Menus
FileMenu = \u0645\u0627\u0641
#FileMenuMnemonic = \u0645

#FileMenuExit = \u05d9\u05e6\u05d9\u05d0\u05d4
#FileMenuExitMnemonic = \u05d9

LanguageMenu = \u0644\u063a\u0629
LanguageMenuMnemonic = \u0644

Arabic = \u0627\u0644\u0639\u0631\u0628\u064a\u0629
Chinese = \u0627\u0644\u0635\u064a\u0646\u064a\u0629
English = \u0627\u0644\u0625\u0646\u062c\u0644\u064a\u0632\u064a\u0629
French = \u0627\u0644\u0641\u0631\u0646\u0633\u064a\u0629
German = \u0627\u0644\u0623\u0644\u0645\u0627\u0646\u064a\u0629


*/

//Simple.properties
/*
Hello = Hello World!
HelloToolTip = Hey there!
One = One
OneMnemonic = o
Two = Two
TwoMnemonic = t
Three = Three
ThreeMnemonic = h
Dates = Dates
Numbers = Numbers
Formats = Formats

# Menus
FileMenu = File
FileMenuMnemonic = F

FileMenuExit = Exit
FileMenuExitMnemonic = x

LanguageMenu = Language
LanguageMenuMnemonic = L

Arabic = Arabic
Chinese = Chinese
English = English
French = French
German = German
Hebrew = Hebrew
Italian = Italian
Japanese = Japanese
Korean = Korean
Russian = Russian

WarningMsg = There were {0,number,integer} spelling mistakes in file {1}
WarningTitle = Warning
OK = OK
CANCEL = CANCEL

*/

//Simple_ja.properties
/*
Hello = \u4eca\u65e5\u306f
HelloToolTip = \u4eca\u65e5\u306f
One = \u4e00
OneMnemonic = \u4e00
Two = \u4e8c
TwoMnemonic = \u4e8c
Three = \u4e09
ThreeMnemonic = \u4e09
Numbers=\u6570\u5b57
Dates=\u65e5\u6642

# Menus

FileMenu = \u30d5\u30a1\u30a4\u30eb (F)
FileMenuMnemonic = F

FileMenuExit = \u51fa\u5165\u308a\u53e3 (x)
FileMenuExitMnemonic = x

LanguageMenu = \u8a00\u8a9e (L)
LanguageMenuMnemonic = L

Arabic = \u30a2\u30e9\u30d3\u30a2\u8a9e
Chinese= \u4e2d\u56fd\u8a9e
English= \u82f1\u8a9e
French= \u30d5\u30e9\u30f3\u30b9\u8a9e
German= \u30c9\u30a4\u30c4\u8a9e
Hebrew = \u30d2\u30d6\u30e9\u30a4\u8a9e
Italian = \u4f0a\u8a9e
Japanese = \u65e5\u672c\u8a9e
Korean = \u97d3\u56fd\u8a9e
Russian = \u30ed\u30b7\u30a2\u8a9e

WarningMsg = \u30d5\u30a1\u30a4\u30eb\u306b\u306f {0,number,integer}\u30a2\u30a4\u30c6\u30e0\u304c\u3042\u308a\u307e\u3059.
WarningTitle = \u8b66\u543f
OK = \u826f\u3044
CANCEL = \u53d6\u308a\u6d88\u3057

*/

//Simple_iw.properties
/*
Hello = \u05e9\u05dc\u05d5\u05dd \u05e2\u05d5\u05dc\u05dd!
HelloToolTip = \u05e9\u05dc\u05d5\u05dd
One = \u05d0\u05d7\u05ea
OneMnemonic = \u05d0
Two = \u05e9\u05ea\u05d9\u05d9\u05dd
TwoMnemonic = \u05e9
Three = \u05e9\u05dc\u05d5\u05e9
ThreeMnemonic = \u05dc
Dates = \u05ea\u05d0\u05e8\u05d9\u05db\u05d9\u05dd
Numbers = \u05de\u05e1\u05e4\u05e8\u05d9\u05dd

# Menus
FileMenu = \u05e7\u05d5\u05d1\u05e5
FileMenuMnemonic = \u05e7

FileMenuExit = \u05d9\u05e6\u05d9\u05d0\u05d4
FileMenuExitMnemonic = \u05d9

LanguageMenu = \u05e1\u05e4\u05d5\u05ea
LanguageMenuMnemonic = \u05e1

Arabic = \u05e2\u05e8\u05d0\u05d1\u05d9\u05ea
Chinese = \u05e1\u05d9\u05e0\u05d9\u05ea
English = \u05d0\u05e0\u05d2\u05dc\u05d9\u05ea
French = \u05e6\u05e8\u05e4\u05ea\u05d9\u05ea
German = \u05d2\u05e8\u05de\u05e0\u05d9\u05ea
Hebrew = \u05e2\u05d1\u05e8\u05d9\u05ea
Russian = \u05e8\u05d5\u05e1\u05d9\u05ea
Italian = \u05d0\u05d9\u05d8\u05dc\u05e7\u05d9\u05ea
Japanese = \u05d9\u05e4\u05e0\u05d9\u05ea

*/


//Simple_it.properties
/*
Hello = Salve Mondiale!
HelloToolTip = Ciao!
One = Uno
OneMnemonic = u
Two = Due
TwoMnemonic = d
Three = Tre
ThreeMnemonic = t
Dates = Date
Numbers = Numeri

# Menus
FileMenu = Archivio
FileMenuMnemonic = A

FileMenuExit = Uscita
FileMenuExitMnemonic = u

LanguageMenu = Lingua
LanguageMenuMnemonic = L

Arabic = arabic
Chinese = cinese
English = inglese
French = francese
German = tedesco
Hebrew = ebreo
Italian = italiano
Japanese = giapponese
Russian = russo

WarningMsg = Scatto OK verso continuare
WarningTitle = di avvertimento
OK = OK
CANCEL = annullare

*/

           
         
    
    
    
    
    
    
    
  








Java-Internationalization-Chapter-9.zip( 4 k)

Related examples in the same category

1.Java I18N: IntroductionJava I18N: Introduction
2.Load resource with ResourceBundle.getBundle
3.Load a Resource Bundle
4.Localizing Messages with a property-file type resource bundle
5.Matching Line Boundaries in a Regular Expression
6.Convert ResourceBundle to Properties
7.Get resource bundle for a certain localeGet resource bundle for a certain locale
8.Convert ResourceBundle to Map
9.Use ResourceBundle for i18n
10.Load resources based upon client environment at startup
11.Load resources via a resources file
12.Java file based resource bundle
13.Resource Bundle by Locale
14.Resource Bundle in Java code
15.List Resource Bundle Creator
16.Simple Resource Bundle based on Java code
17.Create one button, internationalizedly
18.Java Internationalization: load string from properties Java Internationalization: load string from properties
19.Isolating Locale-Specific Data with Resource Bundles Isolating Locale-Specific Data with Resource Bundles
20.Property To List Resource Bundle
21.Which Bundle Comes First
22.Localized JOptionPane
23.Popup in FrenchPopup in French
24.ResourceBundle with ParametersResourceBundle with Parameters
25.ResourceBundle with parameter positionResourceBundle with parameter position
26.Load a given resource.
27.Helper class for constructing messages from bundles
28.Methods for receving messages from resource bundles
29.Convert Class To Resource Path
30.Transform the class-relative resource name into a global name by appending it to the classes package name.
31.ResourceBundle: avoid a performance penalty by superfluous resource (and classes loaded by Class.forName) lookups on web server in applets.
32.Read ResourceBundles with custom encodings
33.Method to convert a ResourceBundle to a Map object.
34.Method to convert a ResourceBundle to a Properties object.
35.Resource utils