Skip to content

Commit 9205aca

Browse files
committed
Replace \\n by \n in texts .property file.
1 parent daf2842 commit 9205aca

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

adventure-editor/src/main/java/com/bladecoder/engineeditor/common/I18NUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ public boolean accept(File arg0, String arg1) {
112112

113113
for (Properties p : props) {
114114
if(p.getProperty((String) key) == null) {
115-
writer.write(SEPARATOR + "**" + props[0].getProperty((String) key));
115+
writer.write(SEPARATOR + "**" + props[0].getProperty((String) key).replace("\n", "\\n"));
116116
System.out.println("KEY NOT FOUND: " + key);
117117
} else {
118-
writer.write(SEPARATOR + p.getProperty((String) key));
118+
writer.write(SEPARATOR + p.getProperty((String) key).replace("\n", "\\n"));
119119
}
120120
}
121121

adventure-editor/src/main/java/com/bladecoder/engineeditor/scneditor/ToolsWindow.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ private void addCutMode() {
225225
Message.showMsg(getStage(), "VERBS PROCESSED SUSCESSFULLY", 4);
226226
}
227227

228-
@SuppressWarnings("unused")
229228
private void extractDialogs() {
230229
HashMap<String, Scene> scenes = World.getInstance().getScenes();
231230

@@ -335,6 +334,7 @@ private void extractDialogs() {
335334
Message.showMsg(getStage(), "DIALOGS EXTRACTED", 4);
336335
}
337336

337+
@SuppressWarnings("restriction")
338338
private void exportTSV() {
339339
Platform.runLater(new Runnable() {
340340
@Override
@@ -353,16 +353,15 @@ public void run() {
353353
Ctx.project.getChapter().getId(), "default");
354354

355355
Message.showMsg(getStage(), outFile.getName() + " exported sucessfully.", 4);
356-
357-
I18NUtils.compare(Ctx.project.getProjectDir().getAbsolutePath(), Ctx.project.getChapter().getId(),
358-
null, "en");
359356
} catch (IOException e) {
360357
Message.showMsg(getStage(), "There was a problem generating the .tsv file.", 4);
358+
e.printStackTrace();
361359
}
362360
}
363361
});
364362
}
365363

364+
@SuppressWarnings("restriction")
366365
private void importTSV() {
367366
Platform.runLater(new Runnable() {
368367
@Override

adventure-editor/src/main/java/com/bladecoder/engineeditor/ui/ActionList.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ protected String getCellSubTitle(Action a) {
616616

617617
// Check world Scope for translations
618618
if (scope.equals(ScopePanel.WORLD_SCOPE))
619-
sb.append(name).append(": ").append(Ctx.project.getI18N().getWorldTranslation(v)).append(' ');
619+
sb.append(name).append(": ").append(Ctx.project.getI18N().getWorldTranslation(v).replace("\n", "|")).append(' ');
620620
else
621-
sb.append(name).append(": ").append(Ctx.project.translate(v)).append(' ');
621+
sb.append(name).append(": ").append(Ctx.project.translate(v).replace("\n", "|")).append(' ');
622622

623623
f.setAccessible(accessible);
624624
} catch (IllegalArgumentException | IllegalAccessException e) {

adventure-editor/src/main/java/com/bladecoder/engineeditor/ui/OptionList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected String getCellSubTitle(DialogOption e) {
236236
String response = e.getResponseText();
237237

238238
if (response != null && !response.isEmpty())
239-
sb.append("R: ").append(Ctx.project.translate(response)).append(' ');
239+
sb.append("R: ").append(Ctx.project.translate(response).replace("\n", "|")).append(' ');
240240

241241
if (e.getVerbId() != null)
242242
sb.append(" verb: ").append(e.getVerbId());

adventure-editor/src/main/java/com/bladecoder/engineeditor/ui/components/TextInputPanel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ public class TextInputPanel extends InputPanel {
3232
}
3333

3434
public String getText() {
35-
return input.getText().replaceAll("\n", "\\\\n");
35+
// return input.getText().replace("\n", "\\\\n");
36+
return input.getText();
3637
}
3738

3839
public void setText(String s) {
3940
if (s == null) s = "";
40-
input.setText(s.replaceAll("\\\\n", "\n"));
41+
input.setText(s.replace("\\n", "\n"));
4142
}
4243

4344
public void setRows(float rows) {

blade-engine/src/com/bladecoder/engine/assets/EngineAssetManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public FileHandle getUserFile(String filename) {
471471

472472
if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet) {
473473
String dir = Config.getProperty(Config.TITLE_PROP, DESKTOP_PREFS_DIR);
474-
dir.replaceAll(" ", "");
474+
dir.replace(" ", "");
475475

476476
StringBuilder sb = new StringBuilder();
477477
sb.append(".").append(dir).append("/").append(filename);
@@ -488,7 +488,7 @@ public FileHandle getUserFolder() {
488488

489489
if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet) {
490490
String dir = Config.getProperty(Config.TITLE_PROP, DESKTOP_PREFS_DIR);
491-
dir.replaceAll(" ", "");
491+
dir.replace(" ", "");
492492

493493
StringBuilder sb = new StringBuilder(".");
494494
file = Gdx.files.external(sb.append(dir).toString());

0 commit comments

Comments
 (0)