improve internationalization and localization in greek

This commit is contained in:
mtsio
2015-04-17 05:06:54 +03:00
parent 59d32321fd
commit 0ca72d4cc6
13 changed files with 224 additions and 38 deletions
+4 -2
View File
@@ -661,7 +661,8 @@ public abstract class Mode {
}
}
DefaultMutableTreeNode foundationLibraries = new DefaultMutableTreeNode("Core Libraries");
DefaultMutableTreeNode foundationLibraries =
new DefaultMutableTreeNode(Language.text("examples.core_libraries"));
// Get examples for core libraries
for (Library lib : coreLibraries) {
@@ -676,7 +677,8 @@ public abstract class Mode {
}
// Get examples for third party libraries
DefaultMutableTreeNode contributed = new DefaultMutableTreeNode("Libraries");
DefaultMutableTreeNode contributed = new
DefaultMutableTreeNode(Language.text("examples.libraries"));
for (Library lib : contribLibraries) {
if (lib.hasExamples()) {
DefaultMutableTreeNode libNode = new DefaultMutableTreeNode(lib.getName());
+1 -1
View File
@@ -131,7 +131,7 @@ public class ProgressFrame extends JFrame implements PropertyChangeListener {
// to close the progress bar automatically when done, and to
// print that adding file is done in Message Area
editor.statusNotice("One file added to the sketch.");
editor.statusNotice(Language.text("editor.status.drag_and_drop.files_added.1"));
ProgressFrame.this.closeProgressBar();
}
@@ -26,7 +26,7 @@ import java.util.Arrays;
import java.util.List;
import processing.core.PApplet;
import processing.app.Language;
abstract public class Contribution {
static final String SPECIAL_CATEGORY_NAME = "Starred";
@@ -251,6 +251,7 @@ abstract public class Contribution {
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
for (String category : listing) {
if (validCategories.contains(category)) {
category = translateCategory(category);
outgoing.add(category);
}
}
@@ -276,4 +277,55 @@ abstract public class Contribution {
}
return (outgoing.size() > 0) ? outgoing : null;
}
static private String translateCategory(String cat) {
String translated = "";
switch (cat) {
case "3D":
translated = Language.text("contrib.category.3d");
break;
case "Animation":
translated = Language.text("contrib.category.animation");
break;
case "Data":
translated = Language.text("contrib.category.data");
break;
case "Geometry":
translated = Language.text("contrib.category.geometry");
break;
case "GUI":
translated = Language.text("contrib.category.gui");
break;
case "Hardware":
translated = Language.text("contrib.category.hardware");
break;
case "I/O":
translated = Language.text("contrib.category.io");
break;
case "Math":
translated = Language.text("contrib.category.math");
break;
case "Simulation":
translated = Language.text("contrib.category.simulation");
break;
case "Sound":
translated = Language.text("contrib.category.sound");
break;
case "Typography":
translated = Language.text("contrib.category.typography");
break;
case "Utilities":
translated = Language.text("contrib.category.utilities");
break;
case "Video & Vision":
translated = Language.text("contrib.category.video_vision");
break;
case "Other":
translated = Language.text("contrib.category.other");
break;
}
return translated;
}
}
+1 -1
View File
@@ -125,7 +125,7 @@ public class Archiver implements Tool {
e.printStackTrace();
}
} else {
editor.statusNotice("Archive sketch canceled.");
editor.statusNotice(Language.text("editor.status.archiver.cancel"));
}
}
@@ -63,7 +63,8 @@ public class ColorSelector implements Tool {
synchronized(ColorSelector.class) {
if (selector == null) {
selector = new ColorChooser(editor, false, Color.WHITE,
"Copy", new ActionListener() {
Language.text("menu.edit.copy"),
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
+13 -17
View File
@@ -95,10 +95,7 @@ public class CreateFont extends JFrame implements Tool {
pain.setLayout(new BoxLayout(pain, BoxLayout.Y_AXIS));
String labelText =
"Use this tool to create bitmap fonts for your program.\n" +
"Select a font and size, and click 'OK' to generate the font.\n" +
"It will be added to the data folder of the current sketch.";
String labelText = Language.text("create_font.label");
JTextArea textarea = new JTextArea(labelText);
textarea.setBorder(new EmptyBorder(10, 10, 20, 10));
@@ -206,7 +203,7 @@ public class CreateFont extends JFrame implements Tool {
pain.add(new Box.Filler(d2, d2, d2));
JPanel panel = new JPanel();
panel.add(new JLabel("Size:"));
panel.add(new JLabel(Language.text("create_font.size") + ":" ));
sizeSelector = new JTextField(" 48 ");
sizeSelector.getDocument().addDocumentListener(new DocumentListener() {
public void insertUpdate(DocumentEvent e) { update(); }
@@ -215,7 +212,7 @@ public class CreateFont extends JFrame implements Tool {
});
panel.add(sizeSelector);
smoothBox = new JCheckBox("Smooth");
smoothBox = new JCheckBox(Language.text("create_font.smooth"));
smoothBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
smooth = smoothBox.isSelected();
@@ -233,7 +230,7 @@ public class CreateFont extends JFrame implements Tool {
// });
// allBox.setSelected(all);
// panel.add(allBox);
charsetButton = new JButton("Characters...");
charsetButton = new JButton(Language.text("create_font.characters"));
charsetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//showCharacterList();
@@ -245,7 +242,7 @@ public class CreateFont extends JFrame implements Tool {
pain.add(panel);
JPanel filestuff = new JPanel();
filestuff.add(new JLabel("Filename:"));
filestuff.add(new JLabel(Language.text("create_font.filename") + ":"));
filestuff.add(filenameField = new JTextField(20));
filestuff.add(new JLabel(".vlw"));
pain.add(filestuff);
@@ -503,7 +500,7 @@ class CharacterSelector extends JFrame {
public CharacterSelector() {
super("Character Selector");
super(Language.text("create_font.character_selector"));
charsetList = new CheckBoxList();
DefaultListModel<JCheckBox> model = new DefaultListModel<JCheckBox>();
@@ -526,11 +523,7 @@ class CharacterSelector extends JFrame {
pain.setLayout(new BoxLayout(pain, BoxLayout.Y_AXIS));
String labelText =
"Default characters will include most bitmaps for Mac OS\n" +
"and Windows Latin scripts. Including all characters may\n" +
"require large amounts of memory for all of the bitmaps.\n" +
"For greater control, you can select specific Unicode blocks.";
String labelText = Language.text("create_font.character_selector.label");
JTextArea textarea = new JTextArea(labelText);
textarea.setBorder(new EmptyBorder(13, 8, 13, 8));
textarea.setBackground(null);
@@ -546,9 +539,12 @@ class CharacterSelector extends JFrame {
charsetList.setEnabled(unicodeCharsButton.isSelected());
}
};
defaultCharsButton = new JRadioButton("Default Characters");
allCharsButton = new JRadioButton("All Characters");
unicodeCharsButton = new JRadioButton("Specific Unicode Blocks");
defaultCharsButton =
new JRadioButton(Language.text("create_font.default_characters"));
allCharsButton =
new JRadioButton(Language.text("create_font.all_characters"));
unicodeCharsButton =
new JRadioButton(Language.text("create_font.specific_unicode"));
defaultCharsButton.addActionListener(listener);
allCharsButton.addActionListener(listener);
+43
View File
@@ -66,6 +66,7 @@ menu.sketch.add_file = Add File...
# | File | Edit | Sketch | Debug | Tools | Help |
# | Debug |
menu.debug = Debug
menu.debug.enable = Enable Debugger
menu.debug.show_debug_toolbar = Show Debug Toolbar
menu.debug.debug = Debug
menu.debug.continue = Continue
@@ -200,6 +201,8 @@ sketchbook.tree = Sketchbook
# Examples (Frame)
examples = Examples
examples.add_examples = Add Examples...
examples.libraries = Libraries
examples.core_libraries = Core Libraries
# Export (Frame)
export = Export Options
@@ -242,6 +245,16 @@ file = Select an image or other data file to copy to your sketch
# Create Font (Frame)
create_font = Create Font
create_font.label = Use this tool to create bitmap fonts for your program.\nSelect a font and size, and click 'OK' to generate the font.\n It will be added to the data folder of the current sketch.
create_font.size = Size
create_font.smooth = Smooth
create_font.characters = Characters...
create_font.character_selector = Character Selector
create_font.character_selector.label = Default characters will include most bitmaps for Mac OS\nand Windows Latin scripts. Including all characters may\nrequire large amounts of memory for all of the bitmaps.\nFor greater control, you can select specific Unicode blocks.
create_font.default_characters = Default Characters
create_font.all_characters = All Characters
create_font.specific_unicode = Specific Unicode Blocks
create_font.filename = Filename
# Color Selector (Frame)
color_selector = Color Selector
@@ -252,6 +265,16 @@ archive_sketch = Archive sketch as...
# Close (Frame)
close.unsaved_changes = Save changes to
# Tweak Mode
tweak_mode = Tweak Mode
tweak_mode.save_before_tweak = Please save the sketch before running in Tweak Mode.
tweak_mode.keep_changes.line1 = Keep the changes?
tweak_mode.keep_changes.line2 = You changed some values in your sketch. Would you like to keep the changes?
# DebugTray
debugger.name = Name
debugger.value = Value
debugger.type = Type
# ---------------------------------------
# Toolbars
@@ -313,8 +336,11 @@ editor.status.printing.done = Done printing.
editor.status.printing.error = Error while printing.
editor.status.printing.canceled = Printing canceled.
editor.status.copy_as_html = Code formatted as HTML has been copied to the clipboard.
editor.status.debug.busy = Debugger busy...
# Errors
editor.status.warning = Warning
editor.status.error = Error
editor.status.error_on = Error on
editor.status.missing.semi_colon = Missing a semi-colon
editor.status.missing.open_sq_bracket = Missing opening square bracket
@@ -334,6 +360,9 @@ editor.status.undef_class = The class classname doesn't exist
editor.status.undef_var = The variable varname doesn't exist
editor.status.undef_name = The name namefield can't be recognized
editor.status.type_mismatch = Type mismatch, typeA doesn't match with typeB
editor.status.unused_variable = The value of the local variable varname is not used
editor.status.uninitialized_variable = The local variable varname may not have been initialized
editor.status.no_effect_assignment = The assignment to variable varname has no effect
# Footer buttons
editor.footer.errors = Errors
@@ -409,6 +438,20 @@ contrib.progress.starting = Starting
contrib.progress.downloading = Downloading
contrib.download_error = An error occured while downloading the contribution.
contrib.unsupported_operating_system = Your operating system does not appear to be supported. You should visit the %s\'s library for more info.
contrib.category.3d = 3D
contrib.category.animation = Animation
contrib.category.data = Data
contrib.category.geometry = Geometry
contrib.category.gui = GUI
contrib.category.hardware = Hardware
contrib.category.io = I/O
contrib.category.math = Math
contrib.category.simulation = Simulation
contrib.category.sound = Sound
contrib.category.typography = Typography
contrib.category.utilities = Utilities
contrib.category.video_vision = Video & Vision
contrib.category.other = Other
# Install on Startup
contrib.startup.errors.download_install = Error during download and install of %s
+60 -4
View File
@@ -66,6 +66,7 @@ menu.sketch.add_file = Προσθήκη Αρχείου...
# | File | Edit | Sketch | Debug | Tools | Help |
# | Debug |
menu.debug = Αποσφαλμάτωση
menu.debug.enable = Ενεργοποίηση Αποσφαλμάτωσης
menu.debug.show_debug_toolbar = Εμφάνιση Εργαλειοθήκης Αποσφαλμάτωσης
menu.debug.debug = Εκκίνηση Αποσφαλμάτωσης
menu.debug.continue = Συνέχεια
@@ -91,7 +92,7 @@ menu.debug.show_tabs_list = Εμφάνιση Λίστας Καρτελών
# | File | Edit | Sketch | Debug | Tools | Help |
# | Tools |
menu.tools = Εργαλεία
menu.tools.color_selector = Επιλογέας χρωμάτων...
menu.tools.color_selector = Επιλογή Χρώματος...
menu.tools.create_font = Δημιουργία Γραμματοσειράς...
menu.tools.archive_sketch = Αρχειοθέτηση Σχεδίου
menu.tools.fix_the_serial_lbrary = Διόρθωση Σειριακής Βιβλιοθήκης
@@ -200,6 +201,8 @@ sketchbook.tree = Σχεδιοθήκη
# Examples (Frame)
examples = Παραδείγματα
examples.add_examples = Πρόσθεσε Παραδείγματα...
examples.libraries = Βιβλιοθήκες
examples.core_libraries = Κύριες Βιβλιοθήκες
# Export (Frame)
export = Επιλογές εξαγωγής
@@ -242,9 +245,20 @@ file = Επιλέξτε μια εικόνα ή άλλο αρχείο δεδομ
# Create Font (Frame)
create_font = Δημιουργία Γραμματοσειράς
create_font.label = Χρησιμοποιήστε αυτό το εργαλείο για να δημιουργήσετε γραμματοσειρές bitmap για το πρόγραμμά σας.\nΕπιλέξτε γραμματοσειρά και μέγεθος και πατήστε "Εντάξει" για δημιουργηθεί η γραμματοσειρά.\nΘα προστεθεί στο φάκελο "data" του Σχεδίου.
create_font.size = Μέγεθος
create_font.smooth = Εξομάλυνση
create_font.characters = Χαρακτήρες
create_font.character_selector = Επιλογή Χαρακτήρων
create_font.character_selector.label = Οι προεπιλεγμένοι χαρακτήρες θα περιλαμβάνουν τα περισσότερα bitmaps για Mac OS\nκαι Windows Latin scripts. Αν συμπεριληφθούν όλοι οι χαρακτήρες μπορεί να χρειαστεί\nμεγάλη ποσότητα μνήμης για όλα τα bitmaps.\nΓια μεγαλύτερο έλεγχο, μπορείτε να επιλέξετε συγκεκριμένα μπλοκ Unicode.
create_font.default_characters = Προεπιλεγμένοι Χαρακτήρες
create_font.all_characters = Όλοι Οι Χαρακτήρες
create_font.specific_unicode = Συγκεκριμένα Μπλοκ Unicode
create_font.filename = Όνομα Αρχείου
# Color Selector (Frame)
color_selector = Επιλογέας χρωμάτων...
color_selector = Επιλογή Χρώματος...
# Archive Sketch (Frame)
archive_sketch = Αρχειοθέτηση Σχεδίου ως...
@@ -252,6 +266,17 @@ archive_sketch = Αρχειοθέτηση Σχεδίου ως...
# Close (Frame)
close.unsaved_changes = Αποθήκευση αλλαγών στο
# Tweak Mode
tweak_mode = Κατάσταση Τροποποίησης
tweak_mode.save_before_tweak = Παρακαλώ αποθηκεύστε το Σχέδιο πριν το τρέξετε σε Κατάσταση Τροποποίησης.
tweak_mode.keep_changes.line1 = Να διατηρηθούν οι αλλαγές;
tweak_mode.keep_changes.line2 = Έχετε αλλάξει κάποιες τιμές στο Σχέδιο. Θέλετε να κρατήσετε τις αλλαγές;
# DebugTray
debugger.name = Όνομα
debugger.value = Τιμή
debugger.type = Τύπος
# ---------------------------------------
# Toolbars
@@ -313,8 +338,13 @@ editor.status.printing.done = Ολοκλήρωση εκτύπωσης.
editor.status.printing.error = Σφάλμα κατά την εκτύπωση.
editor.status.printing.canceled = Ακύρωση εκτύπωσης.
editor.status.copy_as_html = Ο κώδικας μορφοποιημένος ως HTML έχει αντιγραφεί στο πρόχειρο.
editor.status.debug.busy = Αποσφαλμάτωση σε εξέλιξη...
editor.status.debug.halt = H αποσφαλμάτωση τερματίστηκε.
editor.status.archiver.cancel = H αρχειοθέτηση του Σχεδίου ακυρώθηκε.
# Errors
editor.status.warning = Προειδοποίηση
editor.status.error = Σφάλμα
editor.status.error_on = Σφάλμα στο
editor.status.missing.semi_colon = Λείπει το ερωτηματικό
editor.status.missing.open_sq_bracket = Λείπει η αριστερή αγκύλη
@@ -335,6 +365,9 @@ editor.status.undef_class = Η κλάση classname δεν υπάρχει
editor.status.undef_var = Η μεταβλητή varname δεν υπάρχει
editor.status.undef_name = Το όνομα namefield δεν μπορεί να αναγνωριστεί
editor.status.type_mismatch = Δεν υπάρχει αντιστοιχία τύπων, ο typeA δεν συνδυάζεται με τον typeB
editor.status.unused_variable = Η τιμή της τοπικής μεταβλητής varname δεν χρησιμοποιείται
editor.status.uninitialized_variable = Η τοπική μεταβλητή varname ίσως να μην έχει αρχικοποιηθεί
editor.status.no_effect_assignment = Η ανάθεση στη μεταβλητή varname δεν έχει αποτέλεσμα
# Footer buttons
editor.footer.errors = Σφάλματα
@@ -401,7 +434,7 @@ contrib.errors.contrib_download.timeout = Η σύνδεση εξάντλησε
contrib.errors.no_internet_connection = Μάλλον δεν είσαι συνδεδεμένος στο Internet.
contrib.status.downloading_list = Λήψη λίστας συνεισφορών.
contrib.status.done = Ολοκληρώθηκε.
contrib.status.all = Όλα
contrib.all = Όλα
contrib.undo = Αναίρεση
contrib.remove = Διαγραφή
contrib.install = Εγκατάσταση
@@ -415,6 +448,22 @@ contrib.unsupported_operating_system = Το λειτουργικό σας σύσ
contrib.startup.errors.download_install = Σφάλμα κατά τη λήψη και εγκατάσταση του %s
contrib.startup.errors.temp_dir = Αδύνατη η εγγραφή στον προσωρινό κατάλογο κατά τη λήψη και εγκατάσταση του %s
contrib.startup.errors.new_marker = The unupdated contribution marker seems to not like %s. You may have to install it manually to update...
contrib.category.3d = 3D
contrib.category.animation = Animation
contrib.category.data = Δεδομένα
contrib.category.geometry = Γεωμετρία
contrib.category.gui = GUI
contrib.category.hardware = Υλικό
contrib.category.io = Ε/Ε
contrib.category.math = Μαθηματικά
contrib.category.simulation = Προσομοίωση
contrib.category.sound = Ήχος
contrib.category.special = Starred
contrib.category.typography = Τυπογραφία
contrib.category.utilities = Utilities
contrib.category.video_vision = Βίντεο & Όραση
contrib.category.other = Άλλα
# Install on Import
contrib.import.dialog.title = Missing Libraries Available
@@ -426,8 +475,15 @@ contrib.import.progress.done = %s has been installed.
contrib.import.progress.final_list = The following libraries have been installed:
contrib.import.errors.link = Error: The library %s has a strange looking download link.
# ---------------------------------------
# Warnings
warn.delete = Διαγραφή
warn.delete.sketch = Είσαι σίγουρος ότι θέλεις να διαγραφεί το Σχέδιο;
warn.delete.file = Είσαι σίγουρος ότι θέλεις να διαγράψεις το "%s";
# ---------------------------------------
# Color Chooser
color_chooser = Επιλογέας Χρώματος
color_chooser = Επιλογή Χρώματος
color_chooser.select = Επιλογή
+8 -2
View File
@@ -210,7 +210,11 @@ public class DebugTray extends JFrame {
rootNode = new DefaultMutableTreeNode("root");
builtins = new DefaultMutableTreeNode("Processing");
treeModel = new DefaultTreeModel(rootNode); // model for the tree column
model = DefaultOutlineModel.createOutlineModel(treeModel, new VariableRowModel(), true, "Name"); // model for all columns
// model for all columns
model =
DefaultOutlineModel.createOutlineModel(treeModel, new VariableRowModel(),
true,
Language.text("debugger.name"));
ExpansionHandler expansionHandler = new ExpansionHandler();
model.getTreePathSupport().addTreeWillExpandListener(expansionHandler);
@@ -318,7 +322,9 @@ public class DebugTray extends JFrame {
* http://kickjava.com/src/org/netbeans/swing/outline/DefaultOutlineCellRenderer.java.htm
*/
protected class VariableRowModel implements RowModel {
final String[] columnNames = { "Value", "Type" };
final String column0 = Language.text("debugger.value");
final String column1 = Language.text("debugger.type");
final String[] columnNames = { column0, column1 };
final int[] editableTypes = {
VariableNode.TYPE_BOOLEAN,
VariableNode.TYPE_FLOAT,
+6 -1
View File
@@ -41,6 +41,7 @@ import processing.app.SketchCode;
import processing.mode.java.pdex.ErrorCheckerService;
import processing.mode.java.pdex.ErrorMarker;
import processing.mode.java.pdex.Problem;
import processing.app.Language;
/**
* The bar on the left of the text area which displays all errors as rectangles. <br>
@@ -287,7 +288,11 @@ public class ErrorBar extends JPanel {
if (evt.getY() >= eMarker.getY() - 2 &&
evt.getY() <= eMarker.getY() + 2 + errorMarkerHeight) {
Problem p = eMarker.getProblem();
String msg = (p.isError() ? "Error: " : "Warning: ") + p.getMessage();
String msg = ((p.isError()
? Language.text("editor.status.error")
: Language.text("editor.status.warning")) + ": "
+ p.getMessage());
setToolTipText(msg);
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
break;
@@ -1388,7 +1388,9 @@ public class JavaEditor extends Editor {
JMenuItem item;
// "use the debugger" sounds too colloquial, and "enable" sounds too technical
enableDebug = Toolkit.newJCheckBoxMenuItem("Enable Debugger", KeyEvent.VK_D);
enableDebug =
Toolkit.newJCheckBoxMenuItem(Language.text("menu.debug.enable"),
KeyEvent.VK_D);
//new JCheckBoxMenuItem(Language.text("menu.debug.show_debug_toolbar"));
enableDebug.setSelected(false);
enableDebug.addActionListener(new ActionListener() {
@@ -2378,12 +2380,12 @@ public class JavaEditor extends Editor {
public void statusBusy() {
statusNotice("Debugger busy...");
statusNotice(Language.text("editor.status.debug.busy"));
}
public void statusHalted() {
statusNotice("Debugger halted.");
statusNotice(Language.text("editor.status.debug.halt"));
}
@@ -2584,9 +2586,10 @@ public class JavaEditor extends Editor {
if (modified) {
// ask to keep the values
int ret = Base.showYesNoQuestion(this, "Tweak Mode",
"Keep the changes?",
"You changed some values in your sketch. Would you like to keep the changes?");
int ret =
Base.showYesNoQuestion(this, Language.text("tweak_mode"),
Language.text("tweak_mode.keep_changes.line1"),
Language.text("tweak_mode.keep_changes.line2"));
if (ret == 1) {
// NO! don't keep changes
loadSavedCode();
+3 -2
View File
@@ -171,7 +171,8 @@ public class JavaMode extends Mode {
if (isSketchModified(sketch)) {
editor.deactivateRun();
Base.showMessage("Save", "Please save the sketch before running in Tweak Mode.");
Base.showMessage(Language.text("menu.file.save"),
Language.text("tweak_mode.save_before_tweak"));
return null;
}
@@ -403,4 +404,4 @@ public class JavaMode extends Mode {
static public void main(String[] args) {
processing.app.Base.main(args);
}
}
}
@@ -226,6 +226,27 @@ public class ErrorMessageSimplifier {
result = result.replace("typeB", q(args[1]));
}
break;
case IProblem.LocalVariableIsNeverUsed:
if (args.length > 0) {
result = Language.text("editor.status.unused_variable");
result = result.replace("varname", q(args[0]));
}
break;
case IProblem.UninitializedLocalVariable:
if (args.length > 0) {
result = Language.text("editor.status.uninitialized_variable");
result = result.replace("varname", q(args[0]));
}
break;
case IProblem.AssignmentHasNoEffect:
if (args.length > 0) {
result = Language.text("editor.status.no_effect_assignment");
result = result.replace("varname", q(args[0]));
}
break;
}
//log("Simplified Error Msg: " + result);