From 531248a474a297d7cd0f32e70fcc247f3c7ef341 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sun, 3 Jan 2016 23:41:40 +0200 Subject: [PATCH 1/5] Make editor statusline text translatable --- app/src/processing/app/EditorLineStatus.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/EditorLineStatus.java b/app/src/processing/app/EditorLineStatus.java index b1ad221dfb7..e0ba1c9680b 100644 --- a/app/src/processing/app/EditorLineStatus.java +++ b/app/src/processing/app/EditorLineStatus.java @@ -28,6 +28,7 @@ import processing.app.helpers.OSUtils; import processing.app.helpers.PreferencesMap; +import static processing.app.I18n.tr; /** @@ -105,7 +106,7 @@ public void paintComponent(Graphics g) { g.drawString(text, 6, baseline); g.setColor(messageForeground); - String tmp = name + " on " + serialport; + String tmp = I18n.format(tr("{0} on {1}"), name, serialport); Rectangle2D bounds = g.getFontMetrics().getStringBounds(tmp, null); From d2277fc1c721c3fd6d83a708ba703cb431a2b8d2 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sun, 3 Jan 2016 23:43:03 +0200 Subject: [PATCH 2/5] Convert message to single string to ease a translation --- app/src/processing/app/EditorStatus.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/EditorStatus.java b/app/src/processing/app/EditorStatus.java index abf8987d23c..684b1043f83 100644 --- a/app/src/processing/app/EditorStatus.java +++ b/app/src/processing/app/EditorStatus.java @@ -346,9 +346,9 @@ public void keyTyped(KeyEvent event) { message1 += editor.console.getText(); if (!(PreferencesData.getBoolean("build.verbose"))) { message1 += "\n\n"; - message1 += " " + tr("This report would have more information with") + "\n"; - message1 += " \"" + tr("Show verbose output during compilation") + "\"\n"; - message1 += " " + tr("enabled in File > Preferences.") + "\n"; + message1 += tr(" This report would have more information with\n" + + " \"Show verbose output during compilation\"\n" + + " enabled in File -> Preferences.\n"); } Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); StringSelection data = new StringSelection(message1); From 503cbbd745a7e6fa9e45ee6162e7e8fc258c9e02 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sun, 3 Jan 2016 23:44:57 +0200 Subject: [PATCH 3/5] Use formatted i18n string to ease a translation --- arduino-core/src/cc/arduino/packages/uploaders/SSHUploader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino-core/src/cc/arduino/packages/uploaders/SSHUploader.java b/arduino-core/src/cc/arduino/packages/uploaders/SSHUploader.java index 8f77098c09a..eab7eb2c4d7 100644 --- a/arduino-core/src/cc/arduino/packages/uploaders/SSHUploader.java +++ b/arduino-core/src/cc/arduino/packages/uploaders/SSHUploader.java @@ -203,7 +203,7 @@ private boolean canUploadWWWFiles(File sourcePath, SSH ssh, List warning return false; } if (!www.canExecute()) { - warningsAccumulator.add(tr("Problem accessing files in folder ") + www); + warningsAccumulator.add(I18n.format(tr("Problem accessing files in folder \"{0}\""), www)); return false; } if (!ssh.execSyncCommand("special-storage-available")) { From 7d7a654bd942ec48e5a1f932aab6698dff9a0ef2 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sun, 3 Jan 2016 23:45:50 +0200 Subject: [PATCH 4/5] Make "Retired" translatable --- arduino-core/src/processing/app/I18n.java | 1 + 1 file changed, 1 insertion(+) diff --git a/arduino-core/src/processing/app/I18n.java b/arduino-core/src/processing/app/I18n.java index 98a58c077a9..72b67a8ecd5 100644 --- a/arduino-core/src/processing/app/I18n.java +++ b/arduino-core/src/processing/app/I18n.java @@ -25,6 +25,7 @@ public class I18n { tr("Partner"); tr("Recommended"); tr("Contributed"); + tr("Retired"); tr("Display"); tr("Communication"); From 7aa384db7cbe0f30b586fe0dd16c389553e54d83 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sun, 3 Jan 2016 23:46:59 +0200 Subject: [PATCH 5/5] Add necessary spaces --- arduino-core/src/processing/app/SketchCode.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arduino-core/src/processing/app/SketchCode.java b/arduino-core/src/processing/app/SketchCode.java index 88d2a51965e..28d838a5241 100644 --- a/arduino-core/src/processing/app/SketchCode.java +++ b/arduino-core/src/processing/app/SketchCode.java @@ -198,10 +198,10 @@ private void load() throws IOException { if (program.indexOf('\uFFFD') != -1) { System.err.println( I18n.format( - tr("\"{0}\" contains unrecognized characters." + - "If this code was created with an older version of Arduino," + - "you may need to use Tools -> Fix Encoding & Reload to update" + - "the sketch to use UTF-8 encoding. If not, you may need to" + + tr("\"{0}\" contains unrecognized characters. " + + "If this code was created with an older version of Arduino, " + + "you may need to use Tools -> Fix Encoding & Reload to update " + + "the sketch to use UTF-8 encoding. If not, you may need to " + "delete the bad characters to get rid of this warning."), file.getName() )