Skip to content

Commit

Permalink
v3.9.1 dev. progress
Browse files Browse the repository at this point in the history
More work on handling translatable texts.
  • Loading branch information
TheCSDev committed Feb 27, 2024
1 parent 8a49fe9 commit fb96c20
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.github.thecsdev.tcdcommons.api.client.util.interfaces.IParentScreenProvider;
import io.github.thecsdev.tcdcommons.api.util.enumerations.HorizontalAlignment;
import io.github.thecsdev.tcdcommons.client.TCDCommonsClient;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.tooltip.Tooltip;

Expand Down Expand Up @@ -102,7 +103,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
final var config_builder = TConfigPanelBuilder.builder(panel_config);
{
//configs for client-sided features
config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
config_builder.addLabelB(TCDCT.tcdc_term_clientSide()).setTextColor(0xFFFFFF00);
{
//debug mode
config_builder.addCheckbox(
Expand Down Expand Up @@ -132,7 +133,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
}

//configs for server-sided features
config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
config_builder.addLabelB(TCDCT.tcdc_term_serverSide()).setTextColor(0xFFFFFF00);
{
//register commands
config_builder.addCheckbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.github.thecsdev.betterstats.util.BST;
import io.github.thecsdev.tcdcommons.api.client.gui.config.TConfigPanelBuilder;
import io.github.thecsdev.tcdcommons.api.client.gui.widget.TButtonWidget;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.text.Text;

Expand All @@ -36,7 +37,7 @@ public final class BSConfigTab extends StatsTab
this.config_builder = TConfigPanelBuilder.builder(panel);

//configs for client-sided features
this.config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
this.config_builder.addLabelB(TCDCT.tcdc_term_clientSide()).setTextColor(0xFFFFFF00);
{
//debug mode
this.config_builder.addCheckbox(
Expand Down Expand Up @@ -66,7 +67,7 @@ public final class BSConfigTab extends StatsTab
}

//configs for server-sided features
this.config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
this.config_builder.addLabelB(TCDCT.tcdc_term_serverSide()).setTextColor(0xFFFFFF00);
{
//register commands
this.config_builder.addCheckbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.github.thecsdev.tcdcommons.api.client.gui.panel.TPanelElement;
import io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext;
import io.github.thecsdev.tcdcommons.api.util.enumerations.HorizontalAlignment;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import io.github.thecsdev.tcdcommons.util.io.http.TcdCommonsWebApi;
import io.github.thecsdev.tcdcommons.util.io.http.TcdWebApiPerson;
import net.minecraft.text.Text;
Expand All @@ -30,11 +31,11 @@ public final class BSCreditsTab extends StatsTab
// ==================================================
private static final Text TEXT_TITLE = translatable("credits_and_attribution.button.credits");
private static final Text TEXT_CONTRIBUTORS = BST.bss_contributors_title();
private static final Text TEXT_SPONSORS = translatable("tcdcommons.github.sponsors");
private static final Text TEXT_SPECIAL_THANKS = translatable("tcdcommons.special_thanks");
private static final Text TEXT_FEATURED = translatable("tcdcommons.featured");
private static final Text TEXT_FEATURED_NOONE = translatable("tcdcommons.featured.no_one");
private static final Text TEXT_FETCH_FAIL = translatable("tcdcommons.fetch_fail");
private static final Text TEXT_SPONSORS = TCDCT.tcdc_term_ghSponsors();
private static final Text TEXT_SPECIAL_THANKS = TCDCT.tcdc_term_specialThanks();
private static final Text TEXT_FEATURED = TCDCT.tcdc_term_featured();
private static final Text TEXT_FEATURED_NOONE = TCDCT.tcdc_term_featured_noOne();
private static final Text TEXT_FETCH_FAIL = TCDCT.tcdc_term_fetchFail();
// ==================================================
public final @Override Text getName() { return TEXT_TITLE; }
public final @Override boolean isAvailable() { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ private BST() {}
public static final MutableText bss_translators_title() { return translatable("betterstats.translators.title"); }
public static final MutableText bss_contributors_title() { return translatable("betterstats.contributors.title"); }
// --------------------------------------------------
public static final MutableText cmd_stats_edit_out(Text stat, Text affectedPlayerCount) { return translatable("commands.statistics.edit.output"); }
public static final MutableText cmd_stats_edit_out(Text stat, Text affectedPlayerCount) { return translatable("commands.statistics.edit.output", stat, affectedPlayerCount); }
public static final MutableText cmd_stats_clear_kick() { return translatable("commands.statistics.clear.kick"); }
public static final MutableText cmd_stats_clear_out(Text affectedPlayerCount) { return translatable("commands.statistics.clear.output"); }
public static final MutableText cmd_stats_query_out(Text player, Text stat, Text value) { return translatable("commands.statistics.query.output"); }
public static final MutableText cmd_stats_clear_out(Text affectedPlayerCount) { return translatable("commands.statistics.clear.output", affectedPlayerCount); }
public static final MutableText cmd_stats_query_out(Text player, Text stat, Text value) { return translatable("commands.statistics.query.output", player, stat, value); }
// --------------------------------------------------
public static final MutableText stp_mc_killed() { return translatable("betterstats.stattype_phrase.minecraft.killed"); }
public static final MutableText stp_mc_killedBy() { return translatable("betterstats.stattype_phrase.minecraft.killed_by"); }
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"name": "notlin4",
"contact": { "homepage": "https://github.com/notlin4" }
},
{
"name": "Atakku",
"contact": { "homepage": "https://github.com/Atakku" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.github.thecsdev.tcdcommons.api.client.util.interfaces.IParentScreenProvider;
import io.github.thecsdev.tcdcommons.api.util.enumerations.HorizontalAlignment;
import io.github.thecsdev.tcdcommons.client.TCDCommonsClient;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.tooltip.Tooltip;

Expand Down Expand Up @@ -102,7 +103,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
final var config_builder = TConfigPanelBuilder.builder(panel_config);
{
//configs for client-sided features
config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
config_builder.addLabelB(TCDCT.tcdc_term_clientSide()).setTextColor(0xFFFFFF00);
{
//debug mode
config_builder.addCheckbox(
Expand Down Expand Up @@ -132,7 +133,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
}

//configs for server-sided features
config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
config_builder.addLabelB(TCDCT.tcdc_term_serverSide()).setTextColor(0xFFFFFF00);
{
//register commands
config_builder.addCheckbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.github.thecsdev.betterstats.util.BST;
import io.github.thecsdev.tcdcommons.api.client.gui.config.TConfigPanelBuilder;
import io.github.thecsdev.tcdcommons.api.client.gui.widget.TButtonWidget;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.text.Text;

Expand All @@ -36,7 +37,7 @@ public final class BSConfigTab extends StatsTab
this.config_builder = TConfigPanelBuilder.builder(panel);

//configs for client-sided features
this.config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
this.config_builder.addLabelB(TCDCT.tcdc_term_clientSide()).setTextColor(0xFFFFFF00);
{
//debug mode
this.config_builder.addCheckbox(
Expand Down Expand Up @@ -66,7 +67,7 @@ public final class BSConfigTab extends StatsTab
}

//configs for server-sided features
this.config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
this.config_builder.addLabelB(TCDCT.tcdc_term_serverSide()).setTextColor(0xFFFFFF00);
{
//register commands
this.config_builder.addCheckbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.github.thecsdev.tcdcommons.api.client.gui.panel.TPanelElement;
import io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext;
import io.github.thecsdev.tcdcommons.api.util.enumerations.HorizontalAlignment;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import io.github.thecsdev.tcdcommons.util.io.http.TcdCommonsWebApi;
import io.github.thecsdev.tcdcommons.util.io.http.TcdWebApiPerson;
import net.minecraft.text.Text;
Expand All @@ -28,11 +29,11 @@ public final class BSCreditsTab extends StatsTab
// ==================================================
private static final Text TEXT_TITLE = translatable("credits_and_attribution.button.credits");
private static final Text TEXT_CONTRIBUTORS = BST.bss_contributors_title();
private static final Text TEXT_SPONSORS = translatable("tcdcommons.github.sponsors");
private static final Text TEXT_SPECIAL_THANKS = translatable("tcdcommons.special_thanks");
private static final Text TEXT_FEATURED = translatable("tcdcommons.featured");
private static final Text TEXT_FEATURED_NOONE = translatable("tcdcommons.featured.no_one");
private static final Text TEXT_FETCH_FAIL = translatable("tcdcommons.fetch_fail");
private static final Text TEXT_SPONSORS = TCDCT.tcdc_term_ghSponsors();
private static final Text TEXT_SPECIAL_THANKS = TCDCT.tcdc_term_specialThanks();
private static final Text TEXT_FEATURED = TCDCT.tcdc_term_featured();
private static final Text TEXT_FEATURED_NOONE = TCDCT.tcdc_term_featured_noOne();
private static final Text TEXT_FETCH_FAIL = TCDCT.tcdc_term_fetchFail();
// ==================================================
public final @Override Text getName() { return TEXT_TITLE; }
public final @Override boolean isAvailable() { return false; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.thecsdev.betterstats.util;

import static io.github.thecsdev.tcdcommons.api.util.TextUtils.translatable;

import org.jetbrains.annotations.ApiStatus.Internal;

import io.github.thecsdev.betterstats.BetterStats;
Expand All @@ -20,10 +21,10 @@ private BST() {}
public static final MutableText bss_translators_title() { return translatable("betterstats.translators.title"); }
public static final MutableText bss_contributors_title() { return translatable("betterstats.contributors.title"); }
// --------------------------------------------------
public static final MutableText cmd_stats_edit_out(Text stat, Text affectedPlayerCount) { return translatable("commands.statistics.edit.output"); }
public static final MutableText cmd_stats_edit_out(Text stat, Text affectedPlayerCount) { return translatable("commands.statistics.edit.output", stat, affectedPlayerCount); }
public static final MutableText cmd_stats_clear_kick() { return translatable("commands.statistics.clear.kick"); }
public static final MutableText cmd_stats_clear_out(Text affectedPlayerCount) { return translatable("commands.statistics.clear.output"); }
public static final MutableText cmd_stats_query_out(Text player, Text stat, Text value) { return translatable("commands.statistics.query.output"); }
public static final MutableText cmd_stats_clear_out(Text affectedPlayerCount) { return translatable("commands.statistics.clear.output", affectedPlayerCount); }
public static final MutableText cmd_stats_query_out(Text player, Text stat, Text value) { return translatable("commands.statistics.query.output", player, stat, value); }
// --------------------------------------------------
public static final MutableText stp_mc_killed() { return translatable("betterstats.stattype_phrase.minecraft.killed"); }
public static final MutableText stp_mc_killedBy() { return translatable("betterstats.stattype_phrase.minecraft.killed_by"); }
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"betterstats.stattype_phrase.minecraft.killed": "Killed",
"betterstats.stattype_phrase.minecraft.killed_by": "Died to",
"betterstats.stattype_phrase.morestats.damaged": "Damage dealt",
"betterstats.stattype_phrase.morestats.damaged_by": "Damage taken",
"betterstats.stattype_phrase.morestats.damaged": "Damage dealt (x10)",
"betterstats.stattype_phrase.morestats.damaged_by": "Damage taken (x10)",
"betterstats.stattype_phrase.morestats.totem_popped_by": "Totems popped by",


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"name": "notlin4",
"contact": { "homepage": "https://github.com/notlin4" }
},
{
"name": "Atakku",
"contact": { "homepage": "https://github.com/Atakku" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.github.thecsdev.tcdcommons.api.client.util.interfaces.IParentScreenProvider;
import io.github.thecsdev.tcdcommons.api.util.enumerations.HorizontalAlignment;
import io.github.thecsdev.tcdcommons.client.TCDCommonsClient;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.tooltip.Tooltip;

Expand Down Expand Up @@ -102,7 +103,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
final var config_builder = TConfigPanelBuilder.builder(panel_config);
{
//configs for client-sided features
config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
config_builder.addLabelB(TCDCT.tcdc_term_clientSide()).setTextColor(0xFFFFFF00);
{
//debug mode
config_builder.addCheckbox(
Expand Down Expand Up @@ -132,7 +133,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
}

//configs for server-sided features
config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
config_builder.addLabelB(TCDCT.tcdc_term_serverSide()).setTextColor(0xFFFFFF00);
{
//register commands
config_builder.addCheckbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.github.thecsdev.betterstats.util.BST;
import io.github.thecsdev.tcdcommons.api.client.gui.config.TConfigPanelBuilder;
import io.github.thecsdev.tcdcommons.api.client.gui.widget.TButtonWidget;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.text.Text;

Expand All @@ -36,7 +37,7 @@ public final class BSConfigTab extends StatsTab
this.config_builder = TConfigPanelBuilder.builder(panel);

//configs for client-sided features
this.config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
this.config_builder.addLabelB(TCDCT.tcdc_term_clientSide()).setTextColor(0xFFFFFF00);
{
//debug mode
this.config_builder.addCheckbox(
Expand Down Expand Up @@ -66,7 +67,7 @@ public final class BSConfigTab extends StatsTab
}

//configs for server-sided features
this.config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
this.config_builder.addLabelB(TCDCT.tcdc_term_serverSide()).setTextColor(0xFFFFFF00);
{
//register commands
this.config_builder.addCheckbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.github.thecsdev.tcdcommons.api.client.gui.panel.TPanelElement;
import io.github.thecsdev.tcdcommons.api.client.gui.util.TDrawContext;
import io.github.thecsdev.tcdcommons.api.util.enumerations.HorizontalAlignment;
import io.github.thecsdev.tcdcommons.util.TCDCT;
import io.github.thecsdev.tcdcommons.util.io.http.TcdCommonsWebApi;
import io.github.thecsdev.tcdcommons.util.io.http.TcdWebApiPerson;
import net.minecraft.text.Text;
Expand All @@ -28,11 +29,11 @@ public final class BSCreditsTab extends StatsTab
// ==================================================
private static final Text TEXT_TITLE = translatable("credits_and_attribution.button.credits");
private static final Text TEXT_CONTRIBUTORS = BST.bss_contributors_title();
private static final Text TEXT_SPONSORS = translatable("tcdcommons.github.sponsors");
private static final Text TEXT_SPECIAL_THANKS = translatable("tcdcommons.special_thanks");
private static final Text TEXT_FEATURED = translatable("tcdcommons.featured");
private static final Text TEXT_FEATURED_NOONE = translatable("tcdcommons.featured.no_one");
private static final Text TEXT_FETCH_FAIL = translatable("tcdcommons.fetch_fail");
private static final Text TEXT_SPONSORS = TCDCT.tcdc_term_ghSponsors();
private static final Text TEXT_SPECIAL_THANKS = TCDCT.tcdc_term_specialThanks();
private static final Text TEXT_FEATURED = TCDCT.tcdc_term_featured();
private static final Text TEXT_FEATURED_NOONE = TCDCT.tcdc_term_featured_noOne();
private static final Text TEXT_FETCH_FAIL = TCDCT.tcdc_term_fetchFail();
// ==================================================
public final @Override Text getName() { return TEXT_TITLE; }
public final @Override boolean isAvailable() { return false; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.thecsdev.betterstats.util;

import static io.github.thecsdev.tcdcommons.api.util.TextUtils.translatable;

import org.jetbrains.annotations.ApiStatus.Internal;

import io.github.thecsdev.betterstats.BetterStats;
Expand All @@ -20,10 +21,10 @@ private BST() {}
public static final MutableText bss_translators_title() { return translatable("betterstats.translators.title"); }
public static final MutableText bss_contributors_title() { return translatable("betterstats.contributors.title"); }
// --------------------------------------------------
public static final MutableText cmd_stats_edit_out(Text stat, Text affectedPlayerCount) { return translatable("commands.statistics.edit.output"); }
public static final MutableText cmd_stats_edit_out(Text stat, Text affectedPlayerCount) { return translatable("commands.statistics.edit.output", stat, affectedPlayerCount); }
public static final MutableText cmd_stats_clear_kick() { return translatable("commands.statistics.clear.kick"); }
public static final MutableText cmd_stats_clear_out(Text affectedPlayerCount) { return translatable("commands.statistics.clear.output"); }
public static final MutableText cmd_stats_query_out(Text player, Text stat, Text value) { return translatable("commands.statistics.query.output"); }
public static final MutableText cmd_stats_clear_out(Text affectedPlayerCount) { return translatable("commands.statistics.clear.output", affectedPlayerCount); }
public static final MutableText cmd_stats_query_out(Text player, Text stat, Text value) { return translatable("commands.statistics.query.output", player, stat, value); }
// --------------------------------------------------
public static final MutableText stp_mc_killed() { return translatable("betterstats.stattype_phrase.minecraft.killed"); }
public static final MutableText stp_mc_killedBy() { return translatable("betterstats.stattype_phrase.minecraft.killed_by"); }
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"betterstats.stattype_phrase.minecraft.killed": "Killed",
"betterstats.stattype_phrase.minecraft.killed_by": "Died to",
"betterstats.stattype_phrase.morestats.damaged": "Damage dealt",
"betterstats.stattype_phrase.morestats.damaged_by": "Damage taken",
"betterstats.stattype_phrase.morestats.damaged": "Damage dealt (x10)",
"betterstats.stattype_phrase.morestats.damaged_by": "Damage taken (x10)",
"betterstats.stattype_phrase.morestats.totem_popped_by": "Totems popped by",


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"name": "notlin4",
"contact": { "homepage": "https://github.com/notlin4" }
},
{
"name": "Atakku",
"contact": { "homepage": "https://github.com/Atakku" }
}
]
}

0 comments on commit fb96c20

Please sign in to comment.