Skip to content

Commit ef4655b

Browse files
committed
Tweaks for #3327 plus add asie to credits
1 parent e101173 commit ef4655b

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

docs/Credits.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ Contributors
235235
[Chris 'cwgreene' Greene](https://github.com/cwgreene),
236236
[AdamAboudi](https://github.com/AdamAboudi),
237237
[lgzy](https://github.com/lgzy),
238-
[dave2s](https://github.com/dave2s)
238+
[dave2s](https://github.com/dave2s),
239+
[asiekierka](https://github.com/asiekierka)
239240
* GUI Team:
240241
[Anton "small-jeeper" Kireev](https://github.com/small-jeeper),
241242
[miniME89](https://github.com/miniME89),

engine/src/main/java/org/terasology/rendering/nui/layers/mainMenu/CreditsScreen.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.slf4j.LoggerFactory;
2020
import org.terasology.assets.ResourceUrn;
2121
import org.terasology.config.Config;
22+
import org.terasology.i18n.TranslationSystem;
2223
import org.terasology.registry.In;
2324
import org.terasology.rendering.nui.CoreScreenLayer;
2425
import org.terasology.rendering.nui.WidgetUtil;
@@ -38,6 +39,9 @@ public class CreditsScreen extends CoreScreenLayer {
3839
@In
3940
private Config config;
4041

42+
@In
43+
private TranslationSystem translationSystem;
44+
4145
private UIScrollingText creditsScroll;
4246

4347
@Override
@@ -54,7 +58,7 @@ public void initialise() {
5458
ClassLoader classloader = getClass().getClassLoader();
5559
InputStream is = classloader.getResourceAsStream("Credits.md");
5660
if (is == null) {
57-
credits.append("${engine:menu#error-credits-not-found}");
61+
credits.append(translationSystem.translate("${engine:menu#error-credits-not-found}"));
5862
} else {
5963
try (BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
6064
String line;
@@ -79,7 +83,7 @@ public void initialise() {
7983
Logger logger = LoggerFactory.getLogger(CreditsScreen.class);
8084
logger.info("Could not open Credits file");
8185

82-
credits = new StringBuilder("${engine:menu#error-credits-open");
86+
credits = new StringBuilder(translationSystem.translate("${engine:menu#error-credits-open"));
8387
}
8488
}
8589

facades/PC/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,20 @@ task createVersionFile(type: Copy) {
213213
filter(FixCrLfFilter, eol:FixCrLfFilter.CrLf.newInstance("crlf"))
214214
}
215215

216+
// TODO: This could probably be done more Gradley (engine project resource dir instead of direct path?) and with some variables
217+
task copyCreditsFile(type: Copy) {
218+
description "Copies the credits file into the engine's resource dir where it'll be read at runtime"
219+
from "$rootDir/docs"
220+
into "$rootDir/engine/src/main/resources"
221+
include "Credits.md"
222+
}
223+
216224
// Main application dist target. Does NOT include any modules.
217225
task distApp (type: Sync) {
218226
description = "Creates an application package for distribution"
219227

220228
dependsOn createVersionFile
229+
dependsOn copyCreditsFile
221230
dependsOn rootProject.extractNatives
222231
dependsOn jar
223232

0 commit comments

Comments
 (0)