2 * jSite2 - I18nMenu.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.jsite.gui;
22 import javax.swing.JMenu;
24 import net.pterodactylus.jsite.i18n.I18n;
25 import net.pterodactylus.jsite.i18n.I18nable;
28 * Menu that receives its properties from {@link I18n}.
30 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
33 public class I18nMenu extends JMenu implements I18nable {
35 /** The {@link I18n} basename. */
36 private final String i18nBasename;
39 * Creates a new menu with the given {@link I18n} basename.
42 * The basename of the {@link I18n} properties
44 public I18nMenu(String i18nBasename) {
45 this.i18nBasename = i18nBasename;
56 public void updateI18n() {
57 setText(I18n.get(i18nBasename + ".name"));
58 setMnemonic(I18n.getKey(i18nBasename + ".mnemonic"));