Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make chat & betterfps warnings translatable #377

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public ItemBlockDecorationWorkbench(Block p_i45328_1_) {

@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List lore, boolean f3h) {
String decorationOnly = I18n.format("efr.decoration.only");
lore.add("\u00a7o" + decorationOnly);
lore.add("\u00a7o" + I18n.format("efr.decoration.only"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.*;
import net.minecraft.world.World;
import net.minecraft.world.WorldProviderHell;
Expand Down Expand Up @@ -153,21 +154,21 @@ public void onClientTick(ClientTickEvent event) {
if (player.ticksExisted == 40) {
if (!EtFuturum.DEV_ENVIRONMENT && EtFuturum.SNAPSHOT_BUILD && !showedDebugWarning) {
if (!forceHideSnapshotWarning) {
ChatComponentText text = new ChatComponentText("\u00a7c\u00a7l[Debug]: \u00a7rYou are using a pre-release version of \u00a7bEt \u00a7bFuturum \u00a7bRequiem\u00a7r. This version might not be stable, click here to go to GitHub to report bugs.");
ChatComponentText text = new ChatComponentText(I18n.format("efr.prerelease.version"));
text.getChatStyle().setChatClickEvent(new ClickEvent(Action.OPEN_URL, "https://github.com/Roadhog360/Et-Futurum-Requiem/issues"));
player.addChatComponentMessage(text);
} else {
System.out.println("WARNING: a pre-release version of Et Futurum Requiem is in use! This build may not be stable, expect more bugs than usual.");
System.out.println("Be sure to report bugs at https://github.com/Roadhog360/Et-Futurum-Requiem/issues");
System.out.println(I18n.format("efr.WARN.prerelease.version"));
System.out.println(I18n.format("efr.WARN.prerelease.version.bugs"));
}
showedDebugWarning = true;
}
if (ModItems.ELYTRA.isEnabled() && Utils.badBetterFPSAlgorithm()) {
ChatComponentText text = new ChatComponentText("\u00a74\u00a7l[CRITICAL]: \u00a7bBetterFPS \u00a7ris configured with a bad math algorithm." +
" \"rivens-half\" or \"taylors\" should not be used to prevent damage to your world. It is highly advised that you go into its config and change \"algorithm\" to something else, preferably \"vanilla\"." +
" This is being shown to you because the aforementioned math algorithms are buggy and generate incorrect numbers, leading to possible save bricking.");
ChatComponentText text = new ChatComponentText(I18n.format("efr.CRITICAL.badBetterFPSAlgorithm1") +
I18n.format("efr.CRITICAL.badBetterFPSAlgorithm2") +
I18n.format("efr.CRITICAL.badBetterFPSAlgorithm3"));
player.addChatComponentMessage(text);
text = new ChatComponentText("Elytra flight has been disabled for your own safety.");
text = new ChatComponentText(I18n.format("efr.elytra.flight.disabled"));
text.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED).setBold(true));
player.addChatComponentMessage(text);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraft.client.resources.I18n;

import java.util.List;

Expand Down Expand Up @@ -104,9 +105,9 @@ public static ItemStack getElytra(EntityLivingBase entity) {
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean debug) {
if (Utils.badBetterFPSAlgorithm()) {
tooltip.add("\u00a7cBetterFPS is configured poorly.");
tooltip.add("\u00a7cCheck the chat warning for more info.");
tooltip.add("\u00a7cElytra flight has been disabled.");
tooltip.add(I18n.format("efr.elytra.BetterFPS.warn1"));
tooltip.add(I18n.format("efr.elytra.BetterFPS.warn2"));
tooltip.add(I18n.format("efr.elytra.BetterFPS.warn3"));
} else if (EtFuturum.hasBaublesExpanded) {
String[] slots;
switch (ConfigModCompat.elytraBaublesExpandedCompat) {
Expand Down
15 changes: 14 additions & 1 deletion src/main/resources/assets/etfuturum/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1756,4 +1756,17 @@ efr.nei.banner=Banners
efr.nei.amount=Amount
efr.nei.weight=Weight

efr.decoration.only=Decoration only
efr.decoration.only=Decoration only

efr.prerelease.version=§c§l[Debug]: §rYou are using a pre-release version of §bEt §bFuturum §bRequiem§r. This version might not be stable, click here to go to GitHub to report bugs.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not describe that it's a warning. Should get "warn" instead of the below key

efr.WARN.prerelease.version=WARNING: a pre-release version of Et Futurum Requiem is in use! This build may not be stable, expect more bugs than usual.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key should contain "log", not "WARN",

efr.WARN.prerelease.version.bugs=Be sure to report bugs at https://github.com/Roadhog360/Et-Futurum-Requiem/issues
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization inconsistency, all keys should follow a lower_snake_case format between each dot

efr.CRITICAL.badBetterFPSAlgorithm1=§4§l[CRITICAL]: §bBetterFPS §ris configured with a bad math algorithm.
efr.CRITICAL.badBetterFPSAlgorithm2= "rivens-half" or "taylors" should not be used to prevent damage to your world. It is highly advised that you go into its config and change "algorithm" to something else, preferably "vanilla".
efr.CRITICAL.badBetterFPSAlgorithm3= This is being shown to you because the aforementioned math algorithms are buggy and generate incorrect numbers, leading to possible save bricking.
efr.elytra.flight.disabled=Elytra flight has been disabled for your own safety.
efr.elytra.BetterFPS.warn1=§cBetterFPS is configured poorly.
efr.elytra.BetterFPS.warn2=§cCheck the chat warning for more info.
efr.elytra.BetterFPS.warn3=§cElytra flight has been disabled.


16 changes: 15 additions & 1 deletion src/main/resources/assets/etfuturum/lang/ru_RU.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,21 @@ item.banner.straight_cross.yellow=Жёлтый крест
efr.nei.smoker=Копчение
efr.nei.blast_furnace=Дутьё
efr.nei.composter=Компостирование
efr.nei.banner=Флаг
efr.nei.amount=Количество
efr.nei.weight=Вес

efr.decoration.only=Только декоративный
efr.nei.banner=Флаг

efr.prerelease.version=§c§l[Отладка]: §rВы используете предварительную версию §bEt §bFuturum §bRequiem§r. Эта версия может быть нестабильной. Нажмите здесь, чтобы перейти на GitHub и сообщить об ошибках.
efr.WARN.prerelease.version=ВНИМАНИЕ: используется предварительная версия Et Futurum Requiem! Эта сборка может быть нестабильной, ожидайте больше ошибок, чем обычно.
efr.WARN.prerelease.version.bugs=Обязательно сообщайте об ошибках по адресу https://github.com/Roadhog360/Et-Futurum-Requiem/issues.
efr.CRITICAL.badBetterFPSAlgorithm1=§4§l[КРИТИЧНО]: §bBetterFPS §rнастроен с плохим алгоритмом.
efr.CRITICAL.badBetterFPSAlgorithm2= "rivens-half" или "taylors" не должны использоваться для предотвращения ущерба вашему миру. Настоятельно рекомендуется зайти в его конфигурацию и изменить "алгоритм" на что-нибудь другое, желательно "vanilla".
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"алгоритм" in quotes should be "algorithm", config values are not translated, there is only a "algorithm" option, no "алгоритм" option

efr.CRITICAL.badBetterFPSAlgorithm3= Это показано вам, потому что вышеупомянутые математические алгоритмы содержат ошибки и генерируют неверные числа, что приводит к возможному блокированию сохранения.
efr.elytra.flight.disabled=Полет элитр отключен в целях вашей безопасности.
efr.elytra.BetterFPS.warn1=§cBetterFPS настроен плохо.
efr.elytra.BetterFPS.warn2=§cПроверьте предупреждение чата для получения дополнительной информации.
efr.elytra.BetterFPS.warn3=§cПолет элитр отключен.