Skip to content

Commit

Permalink
Some translation cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Earthcomputer committed Nov 1, 2024
1 parent 39b2bdf commit 09885b5
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ public static Component getGlowCoordsTextComponent(BlockPos pos) {
String.format("/cglow block %d %d %d 10", pos.getX(), pos.getY(), pos.getZ()));
}

public static Component getGlowCoordsTextComponent(MutableComponent component, BlockPos pos) {
return getCommandTextComponent(component, String.format("/cglow block %d %d %d 10", pos.getX(), pos.getY(), pos.getZ()));
public static Component getGlowButtonTextComponent(BlockPos pos) {
return getCommandTextComponent(Component.translatable("commands.client.glow"), String.format("/cglow block %d %d %d 10", pos.getX(), pos.getY(), pos.getZ()));
}

public static Component getGlowEntityTextComponent(MutableComponent component, Entity entity) {
return getCommandTextComponent(component, "/cglow entities " + entity.getStringUUID());
public static Component getGlowButtonTextComponent(Entity entity) {
return getCommandTextComponent(Component.translatable("commands.client.glow"), "/cglow entities " + entity.getStringUUID());
}

public static Component getCommandTextComponent(@Translatable String translationKey, String command) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,16 @@ public void onCompleted() {
Entity cameraEntity = Objects.requireNonNullElse(Minecraft.getInstance().cameraEntity, Minecraft.getInstance().player);

String foundRadius = "%.2f".formatted(Math.sqrt(closestBlock.distToCenterSqr(cameraEntity.getEyePosition(0))));
sendFeedback(Component.translatable("commands.cfindblock.success.left", foundRadius)
.append(getLookCoordsTextComponent(closestBlock))
.append(" ")
.append(getGlowCoordsTextComponent(Component.translatable("commands.cfindblock.success.glow"), closestBlock))
.append(Component.translatable("commands.cfindblock.success.right", foundRadius)));
sendFeedback(
Component.translatable(
"commands.cfindblock.success",
Component.empty()
.append(getLookCoordsTextComponent(closestBlock))
.append(" ")
.append(getGlowButtonTextComponent(closestBlock)),
foundRadius
)
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ private static int listEntities(FabricClientCommandSource source, CEntitySelecto

private static void sendEntityFoundMessage(FabricClientCommandSource source, Entity entity) {
String distance = "%.2f".formatted(Math.sqrt(entity.distanceToSqr(source.getPosition())));
source.sendFeedback(Component.translatable("commands.cfind.found.left", entity.getName(), distance)
.append(getLookCoordsTextComponent(entity.blockPosition()))
.append(Component.translatable("commands.cfind.found.right", entity.getName(), distance)));
source.sendFeedback(Component.translatable(
"commands.cfind.found",
entity.getName(),
getLookCoordsTextComponent(entity.blockPosition()),
distance
));
}

private static class FindTask extends LongTask {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,23 @@ protected int countItems(ListTag inventory) {
}

protected void printEntityLocation(Entity entity, int count) {
sendFeedback(Component.translatable("commands.cfinditem.match.entity.left", count, searchingForName, entity.getName())
.append(getLookCoordsTextComponent(BlockPos.containing(entity.position())))
.append(Component.translatable("commands.cfinditem.match.entity.right", count, searchingForName, entity.getName()))
.append(" ")
.append(getGlowEntityTextComponent(Component.translatable("commands.cfindblock.success.glow"), entity)));
sendFeedback(
Component.translatable(
"commands.cfinditem.match.entity",
count,
searchingForName,
entity.getName(),
getLookCoordsTextComponent(BlockPos.containing(entity.position()))
)
.append(" ")
.append(getGlowButtonTextComponent(entity))
);
}

protected void printLocation(BlockPos pos, int count) {
sendFeedback(Component.translatable("commands.cfinditem.match.left", count, searchingForName)
.append(getLookCoordsTextComponent(pos))
.append(Component.translatable("commands.cfinditem.match.right", count, searchingForName))
sendFeedback(Component.translatable("commands.cfinditem.match", count, searchingForName, getLookCoordsTextComponent(pos))
.append(" ")
.append(getGlowCoordsTextComponent(Component.translatable("commands.cfindblock.success.glow"), pos)));
.append(getGlowButtonTextComponent(pos)));
}

protected boolean canSearchEntity(Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ private static int convertCoords(FabricClientCommandSource source, BlockPos pos,
String sourceWorldName = getLevelName(sourceLevel);
String targetWorldName = getLevelName(targetLevel);

source.sendFeedback(Component.translatable("commands.cpos.coords.left", sourceWorldName, targetWorldName)
.append(getCoordsTextComponent(pos))
.append(Component.translatable("commands.cpos.coords.middle", sourceWorldName, targetWorldName))
.append(getLookCoordsTextComponent(targetPos))
.append(Component.translatable("commands.cpos.coords.right", sourceWorldName, targetWorldName)));
source.sendFeedback(Component.translatable(
"commands.cpos.coords",
getCoordsTextComponent(pos),
sourceWorldName,
getLookCoordsTextComponent(targetPos),
targetWorldName)
);

return Command.SINGLE_SUCCESS;
}
Expand Down
15 changes: 5 additions & 10 deletions src/main/resources/assets/clientcommands/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,16 @@
"commands.cenchant.success": "Verzauberungsmanipulation beginnt",
"commands.cenchant.uncracked": "Seed muss geknackt sein.",

"commands.cfind.found.left": "Fand %1$s an ",
"commands.cfind.found.right": ", %2$s Blöcke entfernt",
"commands.cfind.found": "Fand %s an %s, %s Blöcke entfernt",
"commands.cfind.keepSearching.success": "Finde Objekte",
"commands.cfind.noMatch": "Keine Objekte haben der Abfrage entsprochen",
"commands.cfind.success": "%s Objekte haben der Abfrage entsprochen",

"commands.cfindblock.notFound": "Kein passender Block gefunden",
"commands.cfindblock.starting": "Suche nach %s",
"commands.cfindblock.success.left": "Nächster passender Block ist an ",
"commands.cfindblock.success.glow": "[Leuchten]",
"commands.cfindblock.success.right": ", %1$s Blöcke entfernt",
"commands.cfindblock.success": "Nächster passender Block ist an %s, %s Blöcke entfernt",

"commands.cfinditem.match.left": "%sx %s wurden an ",
"commands.cfinditem.match.right": " gefunden",
"commands.cfinditem.match": "%sx %s wurden an %s gefunden",
"commands.cfinditem.starting": "Suche nach %s",
"commands.cfinditem.starting.keepSearching": "Suche unendlich lange nach %s.",
"commands.cfinditem.total": "Fand insgesamt %sx %s",
Expand Down Expand Up @@ -173,12 +169,10 @@
"commands.cping.singleplayer": "Du bist in einer Einzelspielerwelt (╯°□°)╯︵ ┻━┻",
"commands.cping.playerNotFound": "Spieler nicht gefunden",

"commands.cpos.coords": "%s in %s ist %s in %s",
"commands.cpos.level.overworld": "die Oberwelt",
"commands.cpos.level.the_end": "das Ende",
"commands.cpos.level.the_nether": "der Nether",
"commands.cpos.coords.left": "",
"commands.cpos.coords.middle": " in %1$s ist ",
"commands.cpos.coords.right": " in %2$s",

"commands.crelog.failed": "Wiedereinloggen gescheitert",

Expand Down Expand Up @@ -245,6 +239,7 @@
"commands.client.crack": "Knacken",
"commands.client.enable": "Aktivieren",
"commands.client.expectedRegex": "Ungültiger Regex %s",
"commands.client.glow": "[Leuchten]",
"commands.client.invalidArgumentException": "Ungültiges Argument '%s'",
"commands.client.invalidClickAction": "Ungültige Klickereignisaktion '%s'",
"commands.client.invalidHoverAction": "Ungültige Hoverereignisaktion '%s'",
Expand Down
20 changes: 7 additions & 13 deletions src/main/resources/assets/clientcommands/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,17 @@
"commands.cenchant.success": "Starting enchantment manipulation.",
"commands.cenchant.uncracked": "Seed needs to be cracked",

"commands.cfind.found.left": "Found %1$s at ",
"commands.cfind.found.right": ", %2$s blocks away",
"commands.cfind.found": "Found %s at %s, %s blocks away",
"commands.cfind.keepSearching.success": "Finding entities",
"commands.cfind.noMatch": "No entities matched your query",
"commands.cfind.success": "%s entities matched your query",

"commands.cfindblock.notFound": "No such block found",
"commands.cfindblock.starting": "Searching for %s",
"commands.cfindblock.success.left": "Closest match is at ",
"commands.cfindblock.success.glow": "[Glow]",
"commands.cfindblock.success.right": ", %1$s blocks away",

"commands.cfinditem.match.entity.left": "%sx %s found in %s at ",
"commands.cfinditem.match.entity.right": "",
"commands.cfinditem.match.left": "%sx %s found at ",
"commands.cfinditem.match.right": "",
"commands.cfindblock.success": "Closest match is at %s, %s blocks away",

"commands.cfinditem.match.entity": "%sx %s found in %s at %s",
"commands.cfinditem.match": "%sx %s found at %s",
"commands.cfinditem.starting": "Searching for %s",
"commands.cfinditem.starting.keepSearching": "Infinitely searching for %s",
"commands.cfinditem.total": "Found %sx %s total",
Expand Down Expand Up @@ -178,12 +173,10 @@
"commands.cping.singleplayer": "You are in a singleplayer world (╯°□°)╯︵ ┻━┻",
"commands.cping.playerNotFound": "Player not found",

"commands.cpos.coords": "%s in %s is %s in %s",
"commands.cpos.level.overworld": "the Overworld",
"commands.cpos.level.the_end": "the End",
"commands.cpos.level.the_nether": "the Nether",
"commands.cpos.coords.left": "",
"commands.cpos.coords.middle": " in %1$s is ",
"commands.cpos.coords.right": " in %2$s",

"commands.crelog.failed": "Failed to relog",

Expand Down Expand Up @@ -262,6 +255,7 @@
"commands.client.crack": "Crack",
"commands.client.enable": "Enable",
"commands.client.expectedRegex": "Invalid regex %s",
"commands.client.glow": "[Glow]",
"commands.client.invalidArgumentException": "Invalid argument '%s'",
"commands.client.invalidClickAction": "Invalid click event action '%s'",
"commands.client.invalidHoverAction": "Invalid hover event action '%s'",
Expand Down
15 changes: 5 additions & 10 deletions src/main/resources/assets/clientcommands/lang/id_id.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,16 @@
"commands.cenchant.success": "Memulai memanipulasi pesona",
"commands.cenchant.uncracked": "Seed butuh diketahui.",

"commands.cfind.found.left": "Menemukan %1$s di ",
"commands.cfind.found.right": ", %2$s block jaraknya",
"commands.cfind.found": "Menemukan %s di %s, %s block jaraknya",
"commands.cfind.keepSearching.success": "Mencari entitas.",
"commands.cfind.noMatch": "Tidak ada entitas yang cocok di kuery anda",
"commands.cfind.success": "%s entitas yang cocok di kuery anda",

"commands.cfindblock.notFound": "Blok tidak dapat ditemukan",
"commands.cfindblock.starting": "Mencari %s",
"commands.cfindblock.success.left": "Hasil paling dekat adalah di ",
"commands.cfindblock.success.glow": "[Sinar]",
"commands.cfindblock.success.right": ", %1$s block",
"commands.cfindblock.success": "Hasil paling dekat adalah di %s, %s block",

"commands.cfinditem.match.left": "%sx %s ketemu di ",
"commands.cfinditem.match.right": "",
"commands.cfinditem.match": "%sx %s ketemu di %s",
"commands.cfinditem.starting": "Mencari benda %s",
"commands.cfinditem.starting.keepSearching": "Mencari benda %s selamanya.",
"commands.cfinditem.total": "Menemukan %sx %s",
Expand Down Expand Up @@ -158,12 +154,10 @@
"commands.cping.singleplayer": "Anda berada di dunia singleplayer (╯°□°)╯︵ ┻━┻",
"commands.cping.playerNotFound": "Pemain tidak ditemukan",

"commands.cpos.coords": "%s di %s sama dengan %s di %s",
"commands.cpos.level.overworld": "Overworld",
"commands.cpos.level.the_end": "End",
"commands.cpos.level.the_nether": "Nether",
"commands.cpos.coords.left": "",
"commands.cpos.coords.middle": " di %1$s sama dengan ",
"commands.cpos.coords.right": " di %2$s",

"commands.crelog.failed": "Gagal relog",

Expand Down Expand Up @@ -230,6 +224,7 @@
"commands.client.crack": "Pecahkan",
"commands.client.enable": "Nyalakan",
"commands.client.expectedRegex": "Regex tidak valid %s",
"commands.client.glow": "[Sinar]",
"commands.client.invalidArgumentException": "Argumen tidak valid '%s'",
"commands.client.invalidClickAction": "Aksi klik tidak valid '%s'",
"commands.client.invalidHoverAction": "Aksi sorot tidak valid '%s'",
Expand Down
14 changes: 4 additions & 10 deletions src/main/resources/assets/clientcommands/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,16 @@
"commands.cenchant.success": "エンチャント操作を開始しています",
"commands.cenchant.uncracked": "シードがクラックされる必要があります。",

"commands.cfind.found.left": " %1$s を次の場所で発見しました: ",
"commands.cfind.found.right": ", %2$s ブロック分離れています",
"commands.cfind.found": " %s を次の場所で発見しました: %s, %s ブロック分離れています",
"commands.cfind.keepSearching.success": "エンティティを検索しています",
"commands.cfind.noMatch": "あなたのクエリにマッチしたエンティティが存在しませんでした",
"commands.cfind.success": "%s のエンティティがマッチしました",

"commands.cfindblock.notFound": "そのようなブロックは見つかりませんでした",
"commands.cfindblock.starting": "%s を探しています",
"commands.cfindblock.success.left": "最も近いマッチは ",
"commands.cfindblock.success.glow": "[Glow]",
"commands.cfindblock.success.right": ", %1$s ブロック分離れています",
"commands.cfindblock.success": "最も近いマッチは %s, %s ブロック分離れています",

"commands.cfinditem.match.left": "%sx %s が次の場所で見つかりました ",
"commands.cfinditem.match.right": "",
"commands.cfinditem.match": "%sx %s が次の場所で見つかりました %s",
"commands.cfinditem.starting": "%s を検索しています",
"commands.cfinditem.starting.keepSearching": "次のブロックをエンドレスに検索しています %s",
"commands.cfinditem.total": "%sx %s がトータルで見つかりました",
Expand Down Expand Up @@ -158,12 +154,10 @@
"commands.cping.singleplayer": "あなたはシングルプレイヤーワールドにいます (╯°□°)╯︵ ┻━┻",
"commands.cping.playerNotFound": "プレイヤーが見つかりませんでした",

"commands.cpos.coords": "%s の %s は %s の %s",
"commands.cpos.level.overworld": "現世",
"commands.cpos.level.the_end": "ジ・エンド",
"commands.cpos.level.the_nether": "ネザー",
"commands.cpos.coords.left": "",
"commands.cpos.coords.middle": " の %1$s は ",
"commands.cpos.coords.right": " の %2$s",

"commands.crelog.failed": "再ログするのに失敗しました",

Expand Down
9 changes: 3 additions & 6 deletions src/main/resources/assets/clientcommands/lang/nl_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@
"commands.cenchant.success": "Betoveringsmanipulatie aan het starten",
"commands.cenchant.uncracked": "De seed moet gekraakt zijn.",

"commands.cfind.found.left": "%1$s gevonden op ",
"commands.cfind.found.right": ", %2$s blokken verwijderd",
"commands.cfind.found": "%s gevonden op %s, %s blokken verwijderd",
"commands.cfind.keepSearching.success": "Entiteiten aan het vinden.",
"commands.cfind.noMatch": "Geen enkele entiteit matchte jouw query",
"commands.cfind.success": "%s entiteiten matchten jouw query",

"commands.cfindblock.notFound": "Een dergelijk blok is niet gevonden",
"commands.cfindblock.success.left": "De dichtstbijzijnde match is op ",
"commands.cfindblock.success.right": ", %1$s blokken verwijderd",
"commands.cfindblock.success": "De dichtstbijzijnde match is op %s, %s blokken verwijderd",

"commands.cfinditem.match.left": "%sx %s gevonden op ",
"commands.cfinditem.match.right": "",
"commands.cfinditem.match": "%sx %s gevonden op %s",
"commands.cfinditem.starting": "Aan het zoeken naar %s",
"commands.cfinditem.starting.keepSearching": "Oneindig zoekend naar %s.",
"commands.cfinditem.total": "In totaal %sx %s gevonden",
Expand Down
11 changes: 4 additions & 7 deletions src/main/resources/assets/clientcommands/lang/pl_pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,15 @@
"commands.cenchant.success": "Rozpoczynam manipulowanie zaklęciami",
"commands.cenchant.uncracked": "Ziarno musi być złamane",

"commands.cfind.found.left": "Znaleziono %1$s na ",
"commands.cfind.found.right": ", %2$s bloków dalej",
"commands.cfind.found": "Znaleziono %s na %s, %s bloków dalej",
"commands.cfind.keepSearching.success": "Szukam obiektów",
"commands.cfind.noMatch": "Żadne obiekty nie pasują twoim wymaganiom",
"commands.cfind.success": "%s obiektów pasuje twoim wymaganiom",

"commands.cfindblock.notFound": "Nie znaleziono takiego bloku",
"commands.cfindblock.success.left": "Najbliższe trafienie jest na ",
"commands.cfindblock.success.glow": "[Podświetl]",
"commands.cfindblock.success.right": ", %1$s bloków dalej",
"commands.cfindblock.success": "Najbliższe trafienie jest na %s, %s bloków dalej",

"commands.cfinditem.match.left": "%sx %s znaleziono na ",
"commands.cfinditem.match.right": "",
"commands.cfinditem.match": "%sx %s znaleziono na %s",
"commands.cfinditem.starting": "Szukam %s",
"commands.cfinditem.starting.keepSearching": "Będę szukać %s",
"commands.cfinditem.total": "Znaleziono %sx %s",
Expand Down Expand Up @@ -158,6 +154,7 @@
"commands.client.crack": "Złam",
"commands.client.enable": "Włącz",
"commands.client.expectedRegex": "Nieprawidłowe wyrażenie regularne %s",
"commands.client.glow": "[Podświetl]",
"commands.client.notClient": "To nie jest polecenie klienta.",
"commands.client.tooFewArguments": "Zbyt mało argumentów",
"commands.client.invalidArgumentException": "Nieprawidłowy argument '%s'",
Expand Down
11 changes: 4 additions & 7 deletions src/main/resources/assets/clientcommands/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,15 @@
"commands.cenchant.success": "Начало манипуляций с чарами",
"commands.cenchant.uncracked": "Сид нужно взломать",

"commands.cfind.found.left": "Найденный %1$s ",
"commands.cfind.found.right": ", %2$s блоков от вас",
"commands.cfind.found": "Найденный %s %s, %s блоков от вас",
"commands.cfind.keepSearching.success": "Поиск сущностей",
"commands.cfind.noMatch": "Нет объектов, соответствующих вашему запросу",
"commands.cfind.success": "%s сущностей соответствуют вашему запросу",

"commands.cfindblock.notFound": "Такой блок не найден",
"commands.cfindblock.success.left": "Ближайший в ",
"commands.cfindblock.success.glow": "[Подсветить]",
"commands.cfindblock.success.right": ", %1$s блоков от вас",
"commands.cfindblock.success": "Ближайший в %s, %s блоков от вас",

"commands.cfinditem.match.left": "%sx %s найдено в ",
"commands.cfinditem.match.right": "",
"commands.cfinditem.match": "%sx %s найдено в %s",
"commands.cfinditem.starting": "Поиск %s",
"commands.cfinditem.starting.keepSearching": "Бесконечный поиск %s",
"commands.cfinditem.total": "Всего найдено %sx %s",
Expand Down Expand Up @@ -176,6 +172,7 @@
"commands.client.crack": "Взломать",
"commands.client.enable": "Включить",
"commands.client.expectedRegex": "Недопустимое регулярное выражение %s",
"commands.client.glow": "[Подсветить]",
"commands.client.notClient": "Не клиентская команда",
"commands.client.tooFewArguments": "Слишком мало аргументов",
"commands.client.invalidArgumentException": "Недействительным аргумент '%s'",
Expand Down
Loading

0 comments on commit 09885b5

Please sign in to comment.