FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

load mode strings into language bundle by krishnareddy94 · Pull Request #5953 · processing/processing · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
14 changes: 13 additions & 1 deletion app/src/processing/app/Language.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,19 @@ static public Language init() {
return instance;
}



static public void addModeStrings(Mode mode) {
String baseFilename = "languages/mode.properties";
String langFilename = "languages/mode_" + instance.language + ".properties";
File modeBaseFile = new File(mode.getFolder(), baseFilename);
File modeLangFile = new File(mode.getFolder(), langFilename);
if (modeBaseFile.exists() && modeLangFile.exists()) {
instance.bundle.read(modeBaseFile);
instance.bundle.read(modeLangFile);
}
}


static private String get(String key) {
LanguageBundle bundle = init().bundle;

Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;

import processing.app.Base;
import processing.app.Language;
import processing.app.Messages;
import processing.app.Mode;
import processing.app.Util;
Expand Down Expand Up @@ -89,6 +90,7 @@ public ModeContribution(Base base, File folder,
Messages.log("Got mode class " + modeClass);
Constructor con = modeClass.getConstructor(Base.class, File.class);
mode = (Mode) con.newInstance(base, folder);
Language.addModeStrings(mode);
mode.setClassLoader(loader);
if (base != null) {
mode.setupGUI();
Expand Down

Back | FazBrowse Home | New Git URL