fix: fix missing language

This commit is contained in:
2026-06-21 12:38:48 +08:00
Unverified
parent abdf889ed5
commit 6f99dfe9b2
3 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -87,6 +87,8 @@ DeathMessageResult makeDeathMessage(
}
if (!DeathMessages::Entry::getInstance().isResourceI18nLoaded) {
res.first=tr(res.first, res.second);
logger->info("原消息name为 {}", res.first);
res.second = {};
}
return res;
@@ -131,7 +133,7 @@ DeathMessageResult tryTranslateHardCodedFallingDeathMessage(
} else {
deathMessage.first = "death.attack.generic";
}
return makeDeathMessage((int)SharedTypes::Legacy::ActorDamageCause::Fall, deathMessage, name, killer, weaponName, isEscaping, true);
return makeDeathMessage((int)SharedTypes::Legacy::ActorDamageCause::Fall, deathMessage, name, killer, weaponName, false, true);
}
std::optional<DeathMessageResult> tryTranslateHardCodedDeathMessage(
+1 -1
View File
@@ -92,7 +92,7 @@ void Entry::loadI18n() {
void Entry::loadResourcePack() {
auto mResource = std::make_unique<gmlib::i18n::ResourceI18n>(getSelf().getModDir() / u8"lang", MOD_NAME, 0, 16, 0);
auto mResource = std::make_unique<gmlib::i18n::ResourceI18n>(getSelf().getModDir() / u8"lang", MOD_NAME, 0, 16, 1);
mResource->addLanguage("en_US", en_US);
mResource->addLanguage("zh_CN", zh_CN);
mResource->loadAllLanguages();
+13 -2
View File
@@ -35,6 +35,7 @@ death.attack.flyIntoWall.item=%1 felt the force of kinetic energy while trying t
death.attack.generic=%1$s died
death.attack.generic.player=%1$s died from %2$s
death.attack.indirectMagic=%1$s was killed by magic used by %2$s
death.attack.indirectMagic.player=%1$s was killed by magic used by %2$s
death.attack.indirectMagic.item=%1$s was killed by %2$s using %3$s
death.attack.inFire=%1$s was consumed by fire
death.attack.inFire.player=%1$s accidentally walked into fire while fighting %2$s
@@ -72,8 +73,10 @@ death.attack.sweetBerry=%1$s was pricked to death by sweet berry bushes
death.attack.sweetBerry.player=%1$s was pricked to death by sweet berry bushes while trying to escape %2$s
death.attack.sweetBerry.item=%1$s was pricked to death by sweet berry bushes while trying to escape %2$s holding %3$s
death.attack.thorns=%1$s was killed trying to hurt %2$s
death.attack.thorns.player=%1$s was killed trying to hurt %2$s
death.attack.thorns.item=%1$s was killed by %3$s when trying to hurt %2$s
death.attack.thrown=%1$s was pummeled by %2$s
death.attack.thrown.player=%1$s was pummeled by %2$s
death.attack.thrown.item=%1$s was pummeled by %2$s using %3$s
death.attack.trident=%1$s was impaled by %2$s
death.attack.trident.item=%1$s was impaled by %2$s using %3$s
@@ -84,6 +87,7 @@ death.attack.freeze=%1$s froze to death
death.attack.freeze.player=%1$s was frozen to death by %2$s
death.attack.freeze.item=%1$s was frozen to death by %2$s holding %3$s
death.attack.sonicBoom=%1$s was obliterated by a sonic boom
death.attack.sonicBoom.item=%1$s was obliterated by a sonic boom while trying to escape %2$s
death.attack.sonicBoom.player=%1$s was obliterated by a sonic boom while trying to escape %2$s
death.attack.stalactite=%1$s was impaled by a falling stalactite
death.attack.stalactite.player=%1$s was impaled by a falling stalactite while battling %2$s
@@ -107,6 +111,7 @@ death.fell.accident.generic=%1$s fell from a high place
death.fell.assist=%1$s was doomed to fall by %2$s
death.fell.assist.item=%1$s was doomed to fall by %2$s using %3$s
death.fell.finish=%1$s fell too far and was finished by %2$s
death.fell.finish.player=%1$s fell too far and was finished by %2$s
death.fell.finish.item=%1$s fell too far and was finished by %2$s using %3$s
death.fell.killer=%1$s was doomed to fall
entity.area_effect_cloud.name=Area Effect Cloud
@@ -274,7 +279,7 @@ death.attack.fall=%1$s 落地过猛
death.attack.fall.player=%1$s %2$s
death.attack.fall.item=%1$s %3$s %2$s
death.attack.fallingBlock=%1$s
death.attack.fallingBlock.player=%1$sz %2$s
death.attack.fallingBlock.player=%1$s %2$s
death.attack.fallingBlock.item=%1$s %3$s %2$s
death.attack.fireball=%1$s被 %2$s
death.attack.fireball.item=%1$s被 %2$s %3$s
@@ -287,6 +292,7 @@ death.attack.flyIntoWall.item=%1$s 在试图逃离持有 %3$s 的 %2$s 时感受
death.attack.generic=%1$s
death.attack.generic.player=%1$s %2$s
death.attack.indirectMagic=%1$s %2$s 使
death.attack.indirectMagic.player=%1$s %2$s 使
death.attack.indirectMagic.item=%1$s %2$s %3$s
death.attack.inFire=%1$s
death.attack.inFire.player=%1$s %2$s
@@ -305,6 +311,7 @@ death.attack.hotFloor=%1$s 发现地板是熔岩做的
death.attack.hotFloor.player=%1$s %2$s
death.attack.hotFloor.item=%1$s %3$s %2$s
death.attack.mob=%1$s %2$s
death.attack.mob.player=%1$s %2$s
death.attack.mob.item=%1$s %2$s %3$s
death.attack.sting=%1$s %2$s
death.attack.sting.item=%1$s %2$s %3$s
@@ -323,9 +330,11 @@ death.attack.starve.item=%1$s 在与持有 %3$s 的 %2$s 战斗时饿死了
death.attack.sweetBerry=%1$s
death.attack.sweetBerry.player=%1$s %2$s
death.attack.sweetBerry.item=%1$s %3$s %2$s
death.attack.thorns=%1$s %2$s
death.attack.thorns=%1$s %2$s
death.attack.thorns.player=%1$s %2$s
death.attack.thorns.item=%1$s %2$s %3$s
death.attack.thrown=%1$s %2$s
death.attack.thrown.player=%1$s %2$s
death.attack.thrown.item=%1$s %2$s %3$s
death.attack.trident=%1$s %2$s 穿
death.attack.trident.item=%1$s %2$s 使 %3$s 穿
@@ -337,6 +346,7 @@ death.attack.freeze.player=%1$s 被 %2$s 冻死了
death.attack.freeze.item=%1$s %3$s %2$s
death.attack.sonicBoom=%1$s
death.attack.sonicBoom.player=%1$s %2$s
death.attack.sonicBoom.item=%1$s %2$s
death.attack.stalactite=%1$s 穿
death.attack.stalactite.player=%1$s %2$s 穿
death.attack.stalactite.item=%1$s %3$s %2$s 穿
@@ -359,6 +369,7 @@ death.fell.accident.generic=%1$s 从高处摔了下来
death.fell.assist=%1$s %2$s
death.fell.assist.item=%1$s %2$s 使 %3$s
death.fell.finish=%1$s %2$s
death.fell.finish.player=%1$s %2$s
death.fell.finish.item=%1$s %2$s %3$s
death.fell.killer=%1$s