mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
include languages for osx distribution
This commit is contained in:
@@ -127,6 +127,7 @@
|
||||
<zipfileset filemode="755" dir="${build.dir}/DIYLC.app" prefix="DIYLC.app" />
|
||||
<zipfileset filemode="755" dir="${basedir}/themes" prefix="DIYLC.app/Contents/Resources/themes" />
|
||||
<zipfileset filemode="755" dir="${basedir}/fonts" prefix="DIYLC.app/Contents/Resources/fonts" />
|
||||
<zipfileset filemode="755" dir="${basedir}/lang" prefix="DIYLC.app/Contents/Resources/lang" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -34,7 +34,7 @@ import org.apache.log4j.PropertyConfigurator;
|
||||
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||
import org.diylc.appframework.miscutils.PropertyInjector;
|
||||
import org.diylc.core.IView;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.presenter.Presenter;
|
||||
import org.diylc.swing.gui.MainFrame;
|
||||
import org.diylc.swing.gui.TemplateDialog;
|
||||
@@ -82,7 +82,7 @@ public class DIYLCStarter {
|
||||
|
||||
ConfigurationManager.initialize("diylc");
|
||||
|
||||
TranslateUtil.configure();
|
||||
LangUtil.configure();
|
||||
|
||||
LOG.debug("Java version: " + System.getProperty("java.runtime.version") + " by "
|
||||
+ System.getProperty("java.vm.vendor"));
|
||||
|
||||
@@ -67,7 +67,7 @@ import org.diylc.common.ITask;
|
||||
import org.diylc.common.PropertyWrapper;
|
||||
import org.diylc.core.IView;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.presenter.Presenter;
|
||||
import org.diylc.swing.IDynamicSubmenuHandler;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
@@ -296,7 +296,7 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
@Override
|
||||
public boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties) {
|
||||
PropertyEditorDialog editor =
|
||||
DialogFactory.getInstance().createPropertyEditorDialog(properties, TranslateUtil.translate("Edit Selection"), true);
|
||||
DialogFactory.getInstance().createPropertyEditorDialog(properties, LangUtil.translate("Edit Selection"), true);
|
||||
editor.setVisible(true);
|
||||
defaultedProperties.addAll(editor.getDefaultedProperties());
|
||||
return ButtonDialog.OK.equals(editor.getSelectedButtonCaption());
|
||||
@@ -349,7 +349,7 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
LOG.info(String.format("injectMenuAction(%s, %s)", action == null ? "Separator" : action.getValue(Action.NAME),
|
||||
menuName));
|
||||
if (menuName != null)
|
||||
menuName = TranslateUtil.translate(menuName);
|
||||
menuName = LangUtil.translate(menuName);
|
||||
|
||||
JMenu menu = findOrCreateMenu(menuName);
|
||||
if (action == null) {
|
||||
@@ -358,7 +358,7 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
// translate
|
||||
String name = (String) action.getValue(Action.NAME);
|
||||
if (name != null)
|
||||
action.putValue(Action.NAME, TranslateUtil.translate(name));
|
||||
action.putValue(Action.NAME, LangUtil.translate(name));
|
||||
|
||||
Boolean isCheckBox = (Boolean) action.getValue(IView.CHECK_BOX_MENU_ITEM);
|
||||
String groupName = (String) action.getValue(IView.RADIO_BUTTON_GROUP_KEY);
|
||||
@@ -386,8 +386,8 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
LOG.info(String.format("injectSubmenu(%s, icon, %s)", name, parentMenuName));
|
||||
|
||||
// translate
|
||||
name = TranslateUtil.translate(name);
|
||||
parentMenuName = parentMenuName == null ? null : TranslateUtil.translate(parentMenuName);
|
||||
name = LangUtil.translate(name);
|
||||
parentMenuName = parentMenuName == null ? null : LangUtil.translate(parentMenuName);
|
||||
|
||||
JMenu menu = findOrCreateMenu(parentMenuName);
|
||||
JMenu submenu = new JMenu(name);
|
||||
@@ -406,8 +406,8 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
LOG.info(String.format("injectDynamicSubmenu(%s, icon, %s)", name, parentMenuName));
|
||||
|
||||
// translate
|
||||
name = TranslateUtil.translate(name);
|
||||
parentMenuName = parentMenuName == null ? null : TranslateUtil.translate(parentMenuName);
|
||||
name = LangUtil.translate(name);
|
||||
parentMenuName = parentMenuName == null ? null : LangUtil.translate(parentMenuName);
|
||||
|
||||
final JMenu menu = findOrCreateMenu(parentMenuName);
|
||||
final JMenu submenu = new JMenu(name);
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.diylc.common.IComponentTransformer;
|
||||
import org.diylc.common.IPlugIn;
|
||||
import org.diylc.common.IPlugInPort;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.swing.ActionFactory;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.swing.plugins.help.HelpMenuPlugin;
|
||||
@@ -56,7 +56,7 @@ public class ActionBarPlugin implements IPlugIn {
|
||||
private ConfigToolbar configToolbar;
|
||||
private JLabel donateLabel;
|
||||
|
||||
private static final String DONATE_HTML = "<html><u>" + TranslateUtil.translate("Enjoying DIYLC? Click here to buy me a coffee :)") + "</u></html>";
|
||||
private static final String DONATE_HTML = "<html><u>" + LangUtil.translate("Enjoying DIYLC? Click here to buy me a coffee :)") + "</u></html>";
|
||||
|
||||
public ActionBarPlugin(ISwingUI swingUI) {
|
||||
this.swingUI = swingUI;
|
||||
@@ -122,9 +122,9 @@ public class ActionBarPlugin implements IPlugIn {
|
||||
public ConfigToolbar getConfigToolbar() {
|
||||
if (configToolbar == null) {
|
||||
configToolbar = new ConfigToolbar();
|
||||
configToolbar.add(TranslateUtil.translate("Continuous Creation"), IPlugInPort.CONTINUOUS_CREATION_KEY, IconLoader.Elements.getIcon(), false);
|
||||
configToolbar.add(TranslateUtil.translate("Highlight Connected Areas"), IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, IconLoader.LaserPointer.getIcon(), false);
|
||||
configToolbar.add(TranslateUtil.translate("Sticky Points"), IPlugInPort.STICKY_POINTS_KEY, IconLoader.GraphNodes.getIcon(), true);
|
||||
configToolbar.add(LangUtil.translate("Continuous Creation"), IPlugInPort.CONTINUOUS_CREATION_KEY, IconLoader.Elements.getIcon(), false);
|
||||
configToolbar.add(LangUtil.translate("Highlight Connected Areas"), IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, IconLoader.LaserPointer.getIcon(), false);
|
||||
configToolbar.add(LangUtil.translate("Sticky Points"), IPlugInPort.STICKY_POINTS_KEY, IconLoader.GraphNodes.getIcon(), true);
|
||||
}
|
||||
return configToolbar;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSeparator;
|
||||
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
|
||||
public class ActionToolbar extends JPanel {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ActionToolbar extends JPanel {
|
||||
public void add(final Action action) {
|
||||
final JLabel l = new JLabel();
|
||||
l.setIcon((Icon) action.getValue(AbstractAction.SMALL_ICON));
|
||||
l.setToolTipText(TranslateUtil.translate((String) action.getValue(AbstractAction.NAME)));
|
||||
l.setToolTipText(LangUtil.translate((String) action.getValue(AbstractAction.NAME)));
|
||||
l.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
|
||||
l.addMouseListener(new MouseAdapter() {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import javax.swing.JComboBox;
|
||||
import javax.swing.JList;
|
||||
|
||||
import org.diylc.common.PropertyWrapper;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
public class EnumEditor extends JComboBox {
|
||||
@@ -57,7 +57,7 @@ public class EnumEditor extends JComboBox {
|
||||
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
|
||||
boolean isSelected, boolean cellHasFocus) {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getListCellRendererComponent(list, value == null ? null : TranslateUtil.translate(value.toString()), index, isSelected, cellHasFocus);
|
||||
return super.getListCellRendererComponent(list, value == null ? null : LangUtil.translate(value.toString()), index, isSelected, cellHasFocus);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ import javax.swing.JPanel;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.diylc.common.PropertyWrapper;
|
||||
import org.diylc.core.ValidationException;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.swingframework.ButtonDialog;
|
||||
|
||||
public class PropertyEditorDialog extends ButtonDialog {
|
||||
@@ -52,11 +52,11 @@ public class PropertyEditorDialog extends ButtonDialog {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String ERROR_TITLE = TranslateUtil.translate("Error");
|
||||
private static final String INPUT_ERROR = TranslateUtil.translate("Input error for \"%s\": %s");
|
||||
private static final String ERROR_TITLE = LangUtil.translate("Error");
|
||||
private static final String INPUT_ERROR = LangUtil.translate("Input error for \"%s\": %s");
|
||||
|
||||
private static final String DEFAULT_BOX_TOOLTIP_TEXT =
|
||||
TranslateUtil.translate("If this box is checked application will use the current value as a<br>default when creating new components of the same type");
|
||||
LangUtil.translate("If this box is checked application will use the current value as a<br>default when creating new components of the same type");
|
||||
private static final String DEFAULT_BOX_TOOLTIP =
|
||||
"<html>"
|
||||
+ DEFAULT_BOX_TOOLTIP_TEXT
|
||||
@@ -135,7 +135,7 @@ public class PropertyEditorDialog extends ButtonDialog {
|
||||
gbc.weightx = 0;
|
||||
gbc.insets = new Insets(4, 2, 2, 2);
|
||||
gbc.anchor = GridBagConstraints.WEST;
|
||||
editorPanel.add(new JLabel(TranslateUtil.translate(property.getName()) + ": "), gbc);
|
||||
editorPanel.add(new JLabel(LangUtil.translate(property.getName()) + ": "), gbc);
|
||||
|
||||
gbc.gridx = 1;
|
||||
gbc.fill = GridBagConstraints.HORIZONTAL;
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.diylc.components.autocreate.SolderPadAutoCreator;
|
||||
import org.diylc.core.Theme;
|
||||
import org.diylc.flags.FlagLoader;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.swing.ActionFactory;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.utils.ResourceLoader;
|
||||
@@ -60,9 +60,9 @@ public class ConfigPlugin implements IPlugIn {
|
||||
public static final String COMPONENT_BROWSER = "componentBrowser";
|
||||
public static final String SEARCHABLE_TREE = "Searchable Tree";
|
||||
public static final String TABBED_TOOLBAR = "Tabbed Toolbar";
|
||||
private static final String LANGUAGE_MENU = TranslateUtil.translate("Language");
|
||||
private static final String LANGUAGE_MENU = LangUtil.translate("Language");
|
||||
|
||||
private static final String LANG_RESTART = TranslateUtil.translate("Language selection will be applied after the application is restarted.");
|
||||
private static final String LANG_RESTART = LangUtil.translate("Language selection will be applied after the application is restarted.");
|
||||
|
||||
private ISwingUI swingUI;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class ConfigPlugin implements IPlugIn {
|
||||
false), CONFIG_MENU);
|
||||
|
||||
try {
|
||||
Map<String, Map<String, String>> languages = TranslateUtil.getAvailableLanguages();
|
||||
Map<String, Map<String, String>> languages = LangUtil.getAvailableLanguages();
|
||||
if (languages != null && languages.size() > 0) {
|
||||
swingUI.injectSubmenu(LANGUAGE_MENU, IconLoader.Earth.getIcon(), CONFIG_MENU);
|
||||
for(Map.Entry<String, Map<String, String>> language : languages.entrySet()) {
|
||||
|
||||
@@ -37,7 +37,7 @@ import javax.swing.UIManager;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.event.DocumentListener;
|
||||
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.swingframework.ButtonDialog;
|
||||
|
||||
public class FindDialog extends ButtonDialog {
|
||||
@@ -61,8 +61,8 @@ public class FindDialog extends ButtonDialog {
|
||||
+ "'R\\d+' - matches components starting with R, followed by at least one digit"
|
||||
+ "</html>";
|
||||
|
||||
private static final String FIND = TranslateUtil.translate("Find");
|
||||
private static final String LOOK_FOR = TranslateUtil.translate("Look for");
|
||||
private static final String FIND = LangUtil.translate("Find");
|
||||
private static final String LOOK_FOR = LangUtil.translate("Look for");
|
||||
|
||||
private JPanel mainPanel;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.diylc.common.IPlugIn;
|
||||
import org.diylc.common.IPlugInPort;
|
||||
import org.diylc.core.IView;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.swing.gui.DialogFactory;
|
||||
import org.diylc.swingframework.AboutDialog;
|
||||
@@ -55,8 +55,8 @@ public class HelpMenuPlugin implements IPlugIn {
|
||||
|
||||
private static final String HELP_TITLE = "Help";
|
||||
|
||||
private static final String INFORMATION = TranslateUtil.translate("Information");
|
||||
private static final String HISTORY_NOT_AVAILABLE = TranslateUtil.translate("Version history is not available.");
|
||||
private static final String INFORMATION = LangUtil.translate("Information");
|
||||
private static final String HISTORY_NOT_AVAILABLE = LangUtil.translate("Version history is not available.");
|
||||
|
||||
public static String MANUAL_URL = "https://github.com/bancika/diy-layout-creator/blob/wiki/Manual.md";
|
||||
public static String FAQ_URL = "https://github.com/bancika/diy-layout-creator/blob/wiki/FAQ.md";
|
||||
|
||||
@@ -69,7 +69,7 @@ import org.diylc.common.ITask;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.IView;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.presenter.Presenter;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.swingframework.MemoryBar;
|
||||
@@ -79,27 +79,27 @@ import org.diylc.swingframework.update.UpdateLabel;
|
||||
|
||||
public class StatusBar extends JPanel implements IPlugIn {
|
||||
|
||||
private static final String CLICK_TO_CREATE = TranslateUtil.translate("Click on the canvas to create a new %s or press %s to cancel");
|
||||
private static final String CLICK_TO_CREATE = LangUtil.translate("Click on the canvas to create a new %s or press %s to cancel");
|
||||
private static final String CLICK_TO_SET_POINT =
|
||||
TranslateUtil.translate("Click on the canvas to set the %s control point of a new %s or press %s to cancel");
|
||||
private static final String HOLD_TO_UNSTUCK = TranslateUtil.translate("hold %s and drag to unstuck from");
|
||||
private static final String SELECTION = TranslateUtil.translate("Selection");
|
||||
private static final String DRAG_POINTS_OF = TranslateUtil.translate("Drag control point(s) of");
|
||||
private static final String DRAG_TO_PLACE_A_NEW = TranslateUtil.translate("Drag the mouse over the canvas to place a new");
|
||||
private static final String ZOOM = TranslateUtil.translate("Zoom");
|
||||
private static final String SELECTION_SIZE = TranslateUtil.translate("Selection Size");
|
||||
private static final String SELECTION_IS_EMPTY = TranslateUtil.translate("Selection is empty.");
|
||||
private static final String INFORMATION = TranslateUtil.translate("Information");
|
||||
private static final String NO_HISTORY = TranslateUtil.translate("Version history is not available.");
|
||||
private static final String CLICK_UPDATES = TranslateUtil.translate("Click to show recent changes and updates");
|
||||
private static final String NO_ANNOUNCEMENTS = TranslateUtil.translate("No new public announcements available.");
|
||||
private static final String ERROR_TITLE = TranslateUtil.translate("Error");
|
||||
private static final String PUBLIC_ANNOUNCEMENT = TranslateUtil.translate("Public Announcement");
|
||||
private static final String COULD_NOT_FETCH_ANNOUNCEMENTS = TranslateUtil.translate("Could not fetch public announcements.");
|
||||
private static final String CLICK_TO_FETCH_ANNOUNCEMENT = TranslateUtil.translate("Click to fetch the most recent public announcement");
|
||||
private static final String CLICK_THE_LIGHBULB = TranslateUtil.translate("Click the lighbulb icon in the bottom-right corner of the window for more info.");
|
||||
private static final String NEW_VERSION_AVAILABLE = TranslateUtil.translate("New version available");
|
||||
private static String HIGHLIGHT_CONNECTED_TIP = TranslateUtil.translate("Click on a component to highlight area directly or indirectly connected to the area below the cursor. To continue editing, this mode needs to be switched OFF");
|
||||
LangUtil.translate("Click on the canvas to set the %s control point of a new %s or press %s to cancel");
|
||||
private static final String HOLD_TO_UNSTUCK = LangUtil.translate("hold %s and drag to unstuck from");
|
||||
private static final String SELECTION = LangUtil.translate("Selection");
|
||||
private static final String DRAG_POINTS_OF = LangUtil.translate("Drag control point(s) of");
|
||||
private static final String DRAG_TO_PLACE_A_NEW = LangUtil.translate("Drag the mouse over the canvas to place a new");
|
||||
private static final String ZOOM = LangUtil.translate("Zoom");
|
||||
private static final String SELECTION_SIZE = LangUtil.translate("Selection Size");
|
||||
private static final String SELECTION_IS_EMPTY = LangUtil.translate("Selection is empty.");
|
||||
private static final String INFORMATION = LangUtil.translate("Information");
|
||||
private static final String NO_HISTORY = LangUtil.translate("Version history is not available.");
|
||||
private static final String CLICK_UPDATES = LangUtil.translate("Click to show recent changes and updates");
|
||||
private static final String NO_ANNOUNCEMENTS = LangUtil.translate("No new public announcements available.");
|
||||
private static final String ERROR_TITLE = LangUtil.translate("Error");
|
||||
private static final String PUBLIC_ANNOUNCEMENT = LangUtil.translate("Public Announcement");
|
||||
private static final String COULD_NOT_FETCH_ANNOUNCEMENTS = LangUtil.translate("Could not fetch public announcements.");
|
||||
private static final String CLICK_TO_FETCH_ANNOUNCEMENT = LangUtil.translate("Click to fetch the most recent public announcement");
|
||||
private static final String CLICK_THE_LIGHBULB = LangUtil.translate("Click the lighbulb icon in the bottom-right corner of the window for more info.");
|
||||
private static final String NEW_VERSION_AVAILABLE = LangUtil.translate("New version available");
|
||||
private static String HIGHLIGHT_CONNECTED_TIP = LangUtil.translate("Click on a component to highlight area directly or indirectly connected to the area below the cursor. To continue editing, this mode needs to be switched OFF");
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.IView;
|
||||
import org.diylc.core.Template;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.lang.TranslateUtil;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.presenter.ComponentProcessor;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.swing.plugins.toolbox.ComponentButtonFactory;
|
||||
@@ -96,7 +96,7 @@ public class TreePanel extends JPanel {
|
||||
private static final Logger LOG = Logger.getLogger(TreePanel.class);
|
||||
|
||||
private static final String CLICK_TO_INSTANTIATE =
|
||||
TranslateUtil.translate("Left click to instantiate this component, right click for more options");
|
||||
LangUtil.translate("Left click to instantiate this component, right click for more options");
|
||||
|
||||
public static final String COMPONENT_SHORTCUT_KEY = "componentShortcuts";
|
||||
|
||||
@@ -796,7 +796,7 @@ public class TreePanel extends JPanel {
|
||||
}
|
||||
|
||||
// translate categories
|
||||
setText("<html>" + (payload.getComponentType() == null ? TranslateUtil.translate(payload.forDisplay()) : payload.forDisplay()) + shortCutHtml + variantsHtml + "</html>");
|
||||
setText("<html>" + (payload.getComponentType() == null ? LangUtil.translate(payload.forDisplay()) : payload.forDisplay()) + shortCutHtml + variantsHtml + "</html>");
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user