Remove I18nService, migrate to renamed ServerLocalisationService (#433)

* Remove I18nService, migrate to renamed ServerLocalisationService

* Revert VS fuckup

* Update using

* Remove unused parameter, update comment

* Fix develop branch not building
This commit is contained in:
Jesse
2025-06-28 20:08:42 +02:00
committed by GitHub
parent 1c83014ed2
commit 5686f4a486
98 changed files with 771 additions and 706 deletions
@@ -28,7 +28,7 @@ public class BotWeaponGenerator(
BotWeaponGeneratorHelper _botWeaponGeneratorHelper,
BotWeaponModLimitService _botWeaponModLimitService,
BotEquipmentModGenerator _botEquipmentModGenerator,
LocalisationService _localisationService,
ServerLocalisationService _serverLocalisationService,
RepairService _repairService,
ICloner _cloner,
ConfigServer _configServer,
@@ -137,7 +137,9 @@ public class BotWeaponGenerator(
if (weaponItemTemplate is null)
{
_logger.Error(_localisationService.GetText("bot-missing_item_template", weaponTpl));
_logger.Error(
_serverLocalisationService.GetText("bot-missing_item_template", weaponTpl)
);
_logger.Error($"WeaponSlot -> {slotName}");
return null;
@@ -146,8 +148,10 @@ public class BotWeaponGenerator(
// Find ammo to use when filling magazines/chamber
if (botTemplateInventory.Ammo is null)
{
_logger.Error(_localisationService.GetText("bot-no_ammo_found_in_bot_json", botRole));
_logger.Error(_localisationService.GetText("bot-generation_failed"));
_logger.Error(
_serverLocalisationService.GetText("bot-no_ammo_found_in_bot_json", botRole)
);
_logger.Error(_serverLocalisationService.GetText("bot-generation_failed"));
}
var ammoTpl = GetWeightedCompatibleAmmo(botTemplateInventory.Ammo, weaponItemTemplate);
@@ -356,7 +360,7 @@ public class BotWeaponGenerator(
{
// Invalid weapon generated, fallback to preset
_logger.Warning(
_localisationService.GetText(
_serverLocalisationService.GetText(
"bot-weapon_generated_incorrect_using_default",
$"{weaponTemplate} - {itemTemplate.Name}"
)
@@ -390,7 +394,7 @@ public class BotWeaponGenerator(
else
{
_logger.Error(
_localisationService.GetText("bot-missing_weapon_preset", weaponTemplate)
_serverLocalisationService.GetText("bot-missing_weapon_preset", weaponTemplate)
);
}
@@ -427,7 +431,7 @@ public class BotWeaponGenerator(
if (!hasWeaponSlotItem)
{
_logger.Warning(
_localisationService.GetText(
_serverLocalisationService.GetText(
"bot-weapons_required_slot_missing_item",
new
{
@@ -474,7 +478,7 @@ public class BotWeaponGenerator(
if (magTemplate is null)
{
_logger.Error(
_localisationService.GetText("bot-unable_to_find_magazine_item", magazineTpl)
_serverLocalisationService.GetText("bot-unable_to_find_magazine_item", magazineTpl)
);
return;
@@ -485,7 +489,7 @@ public class BotWeaponGenerator(
if (!ammoTemplate.Key)
{
_logger.Error(
_localisationService.GetText(
_serverLocalisationService.GetText(
"bot-unable_to_find_ammo_item",
generatedWeaponResult.ChosenAmmoTemplate
)
@@ -628,7 +632,7 @@ public class BotWeaponGenerator(
// Shouldn't happen
{
_logger.Warning(
_localisationService.GetText(
_serverLocalisationService.GetText(
"bot-weapon_missing_magazine_or_chamber",
new { weaponId = weaponTemplate.Id, botRole }
)
@@ -636,6 +640,7 @@ public class BotWeaponGenerator(
}
var defaultMagTplId = weaponTemplate.GetWeaponsDefaultMagazineTpl();
if (_logger.IsLogEnabled(LogLevel.Debug))
{
_logger.Debug(
@@ -669,7 +674,7 @@ public class BotWeaponGenerator(
if (_logger.IsLogEnabled(LogLevel.Debug))
{
_logger.Debug(
_localisationService.GetText(
_serverLocalisationService.GetText(
"bot-no_caliber_data_for_weapon_falling_back_to_default",
new
{
@@ -854,7 +859,10 @@ public class BotWeaponGenerator(
if (magazineTemplate is null)
{
_logger.Error(
_localisationService.GetText("bot-unable_to_find_magazine_item", magazine.Template)
_serverLocalisationService.GetText(
"bot-unable_to_find_magazine_item",
magazine.Template
)
);
return;