Localise warning messages

This commit is contained in:
Dev 2023-07-19 13:16:45 +01:00
parent 129fe0dc97
commit d1d3674332
15 changed files with 45 additions and 22 deletions

View File

@ -46,6 +46,9 @@
"bot-weapons_required_slot_missing_item": "Required slot '{{modSlot}}' on {{modName}} {{slotId}} was empty on {{botRole}}", "bot-weapons_required_slot_missing_item": "Required slot '{{modSlot}}' on {{modName}} {{slotId}} was empty on {{botRole}}",
"bot-item_missing_props_property": "Item {{itemTpl}} {{name}} is missing a _props property", "bot-item_missing_props_property": "Item {{itemTpl}} {{name}} is missing a _props property",
"bot-unable_to_fill_camora_slot_mod_pool_empty": "Unable to fill weapon camora slot for {{weaponId}} {{weaponName}} mod pool for item was empty", "bot-unable_to_fill_camora_slot_mod_pool_empty": "Unable to fill weapon camora slot for {{weaponId}} {{weaponName}} mod pool for item was empty",
"bot-unable_to_edit_limits_of_unknown_map": "Unable to edit bot limits of map: %s as it cannot be found",
"bot-unable_to_find_loot_n_value_for_bot": "Unable to find loot N value for bot: %s, using scav n value instead",
"bot-unable_to_find_bot_in_cache": "Unable to find bot in cache with name: %s",
"client_request": "[Client Request] %s", "client_request": "[Client Request] %s",
"customisation-item_already_purchased": "Clothing item {{itemId}} {{itemName}} already purchased", "customisation-item_already_purchased": "Clothing item {{itemId}} {{itemName}} already purchased",
"customisation-unable_to_find_suit_by_id": "Unable to find trader suit offer with id: %s", "customisation-unable_to_find_suit_by_id": "Unable to find trader suit offer with id: %s",
@ -93,6 +96,8 @@
"inventory-return_default_size": "Defaulting item %s to size 1x1", "inventory-return_default_size": "Defaulting item %s to size 1x1",
"inventory-item_missing_props_property": "Item tpl: {{itemTpl}} name: {{itemName}} is missing a props property, a size for it cannot be acquired", "inventory-item_missing_props_property": "Item tpl: {{itemTpl}} name: {{itemName}} is missing a props property, a size for it cannot be acquired",
"inventory-get_item_size_item_not_found_by_tpl": "getSizeByInventoryItemHash() Item with tpl: %s not found", "inventory-get_item_size_item_not_found_by_tpl": "getSizeByInventoryItemHash() Item with tpl: %s not found",
"inventory-item_to_toggle_missing_upd": "Inventory item with _id: %s is missing a upd object, adding",
"inventory-unable_to_toggle_item_not_found": "Unable to toggle inventory item with id: %s, item not found",
"item-durability_value_invalid_use_default": "getRepairableItemQualityValue() weapon tpl: %s durability value is invalid, defaulting to 1", "item-durability_value_invalid_use_default": "getRepairableItemQualityValue() weapon tpl: %s durability value is invalid, defaulting to 1",
"linux_use_priviledged_port_non_root": "Non-root processes cannot bind to ports below 1024", "linux_use_priviledged_port_non_root": "Non-root processes cannot bind to ports below 1024",
"location-containers_generated_success": "A total of %s static containers generated", "location-containers_generated_success": "A total of %s static containers generated",
@ -104,7 +109,9 @@
"location-spawn_point_count_requested_vs_found": "{{requested}} spawnpoints were requested while {{found}} are available {{mapName}}", "location-spawn_point_count_requested_vs_found": "{{requested}} spawnpoints were requested while {{found}} are available {{mapName}}",
"location-unable_to_reparent_item": "createItem() failed, unable to reparent {{tpl}}, parentId: {{parentId}}", "location-unable_to_reparent_item": "createItem() failed, unable to reparent {{tpl}}, parentId: {{parentId}}",
"location-unable_to_find_airdrop_drop_config_of_type": "Unable to find airdrop config settings for type: %s, falling back to drop type: mixed ", "location-unable_to_find_airdrop_drop_config_of_type": "Unable to find airdrop config settings for type: %s, falling back to drop type: mixed ",
"location-unable_to_fix_broken_waves_missing_base": "%s lacks a base json, skipping map wave fixes",
"loot-item_missing_parentid": "Item: %s lacks a parentId value, unable to use item as loot", "loot-item_missing_parentid": "Item: %s lacks a parentId value, unable to use item as loot",
"loot-non_item_picked_as_sealed_weapon_crate_reward": "Invalid weapon: %s, was picked as reward for sealed weapon crate, unable to create loot",
"mod-send_bundle_url": "[BUNDLE]: %s", "mod-send_bundle_url": "[BUNDLE]: %s",
"modloader-checked": "checked", "modloader-checked": "checked",
"modloader-checking_mod": "checking: %s", "modloader-checking_mod": "checking: %s",
@ -143,6 +150,7 @@
"port_already_in_use": "Port %s is already in use, check if the server is already running", "port_already_in_use": "Port %s is already in use, check if the server is already running",
"profile_saved": "Profile changes saved", "profile_saved": "Profile changes saved",
"profile_save_callback_error": "Error while executing onBeforeSaveCallback: {{callback}}, {{error}}", "profile_save_callback_error": "Error while executing onBeforeSaveCallback: {{callback}}, {{error}}",
"profile-unable_to_find_profile_by_id_cannot_delete": "Unable to delete profile with id: %s, no profile with id found",
"quest-compare_operator_unhandled": "loyaltyRequirementCheck() operator %s not handled, defaulting to false", "quest-compare_operator_unhandled": "loyaltyRequirementCheck() operator %s not handled, defaulting to false",
"quest-item_not_found_in_inventory": "changeItemStack() Item with _id: %s not found in inventory", "quest-item_not_found_in_inventory": "changeItemStack() Item with _id: %s not found in inventory",
"quest-no_skill_found": "Skill %s not found", "quest-no_skill_found": "Skill %s not found",
@ -163,6 +171,11 @@
"ragfair-unable_to_purchase_0_count_item": "Unable to purchase item: %s with a count of 0", "ragfair-unable_to_purchase_0_count_item": "Unable to purchase item: %s with a count of 0",
"ragfair-unable_to_place_offer_with_no_requirements": "Unable to place offer with no requirements", "ragfair-unable_to_place_offer_with_no_requirements": "Unable to place offer with no requirements",
"ragfair-unable_to_find_locale_by_key": "Unable to find EFT locale with key: %s", "ragfair-unable_to_find_locale_by_key": "Unable to find EFT locale with key: %s",
"ragfair-unable_to_adjust_stack_count_assort_not_found": "Trader: {traderId} flea offer: {{offerId}} could not have its stack count adjusted to match traders assort value (assort not found)",
"ragfair-unable_to_remove_offer_not_found_in_profile": "Unable to find offer: {{offerId}} in profile: {{profileId}} as offers is undefined, creating",
"ragfair-unable_to_find_item_price_for_item_in_flea_handbook": "Unable to find live-flea or handbook price for {{tplId}}, defaulting to 1, if this is a modded item contact the mod author",
"ragfair-unable_to_find_preset_with_id": "Unable to find preset with id: %s, using existing price of existing weapon base",
"ragfair-unable_to_remove_offer_doesnt_exist": "Unable to remove offer with id: %s as it cannot be found in flea market",
"repeatable-accepted_repeatable_quest_not_found_in_active_quests": "Accepted a repeatable quest: %s which could not be found in the activeQuests array. Please report this bug", "repeatable-accepted_repeatable_quest_not_found_in_active_quests": "Accepted a repeatable quest: %s which could not be found in the activeQuests array. Please report this bug",
"repeatable-completion_quest_whitelist_too_small_or_blacklist_too_restrictive": "Generate Completion Quest: No items remain. Either Whitelist is too small or Blacklist too restrictive", "repeatable-completion_quest_whitelist_too_small_or_blacklist_too_restrictive": "Generate Completion Quest: No items remain. Either Whitelist is too small or Blacklist too restrictive",
"repeatable-difficulty_was_nan": "Repeatable Reward Generation: Difficulty was NaN. Setting to 1.", "repeatable-difficulty_was_nan": "Repeatable Reward Generation: Difficulty was NaN. Setting to 1.",
@ -491,6 +504,7 @@
"pmcresponse-killer_plead_10": "Typical {{playerSide}} behaviour", "pmcresponse-killer_plead_10": "Typical {{playerSide}} behaviour",
"pmcresponse-killer_plead_11": "i need to kill {{playerSide}}, i hope you understand", "pmcresponse-killer_plead_11": "i need to kill {{playerSide}}, i hope you understand",
"pmcresponse-killer_plead_12": "Does nobody in this stupid game have a gas analyser", "pmcresponse-killer_plead_12": "Does nobody in this stupid game have a gas analyser",
"pmcresponse-unable_to_find_key": "Unable to find PMC response pool, none exist for key: %s",
"launcher-profile_standard": "Same as live, basic stash size (10x28), 500,000 roubles", "launcher-profile_standard": "Same as live, basic stash size (10x28), 500,000 roubles",
"launcher-profile_leftbehind": "Same as Standard plus; larger stash size (10x38), extra equipment/items, 500 dollars", "launcher-profile_leftbehind": "Same as Standard plus; larger stash size (10x38), extra equipment/items, 500 dollars",
"launcher-profile_preparetoescape": "Same as Left Behind plus; larger stash size (10x48), extra equipment/items, higher starting reputation with traders, 250 euros", "launcher-profile_preparetoescape": "Same as Left Behind plus; larger stash size (10x48), extra equipment/items, higher starting reputation with traders, 250 euros",

View File

@ -129,7 +129,7 @@ export class MatchCallbacks
if (output === false) if (output === false)
{ {
return this.httpResponse.getBody(null, 420, "Please play as PMC and go through the offline settings screen before pressing ready."); return this.httpResponse.getBody(null, 420, "Please play as PMC and go through the offline settings screen before pressing ready");
} }
return this.httpResponse.getBody(output); return this.httpResponse.getBody(output);

View File

@ -186,7 +186,7 @@ export class GameController
const map: ILocationData = mapsDb[mapId]; const map: ILocationData = mapsDb[mapId];
if (!map) if (!map)
{ {
this.logger.warning(`Unable to edit bot limits of map: ${mapId} as it cannot be found`); this.logger.warning(this.localisationService.getText("bot-unable_to_edit_limits_of_unknown_map", mapId));
} }
for (const botToLimit of this.locationConfig.botTypeLimits[mapId]) for (const botToLimit of this.locationConfig.botTypeLimits[mapId])
@ -428,7 +428,7 @@ export class GameController
const location: ILocationData = this.databaseServer.getTables().locations[locationKey]; const location: ILocationData = this.databaseServer.getTables().locations[locationKey];
if (!location.base) if (!location.base)
{ {
this.logger.warning(`Map ${locationKey} lacks a base json, skipping map wave fixes`); this.logger.warning(this.localisationService.getText("location-unable_to_fix_broken_waves_missing_base", locationKey));
continue; continue;
} }

View File

@ -421,7 +421,7 @@ export class InventoryController
{ {
if (!itemToToggle.upd) if (!itemToToggle.upd)
{ {
this.logger.warning(`Item with _id: ${itemToToggle._id} is missing a upd object, adding`); this.logger.warning(this.localisationService.getText("inventory-item_to_toggle_missing_upd", itemToToggle._id));
itemToToggle.upd = {}; itemToToggle.upd = {};
} }
@ -431,7 +431,7 @@ export class InventoryController
} }
else else
{ {
this.logger.warning(`Unable to find inventory item with _id to toggle: ${body.item}`); this.logger.warning(this.localisationService.getText("inventory-unable_to_toggle_item_not_found", body.item));
} }
return { return {

View File

@ -27,6 +27,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
import { ProfileFixerService } from "../services/ProfileFixerService"; import { ProfileFixerService } from "../services/ProfileFixerService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
@ -42,6 +43,7 @@ export class ProfileController
@inject("DatabaseServer") protected databaseServer: DatabaseServer, @inject("DatabaseServer") protected databaseServer: DatabaseServer,
@inject("ItemHelper") protected itemHelper: ItemHelper, @inject("ItemHelper") protected itemHelper: ItemHelper,
@inject("ProfileFixerService") protected profileFixerService: ProfileFixerService, @inject("ProfileFixerService") protected profileFixerService: ProfileFixerService,
@inject("LocalisationService") protected localisationService: LocalisationService,
@inject("PlayerScavGenerator") protected playerScavGenerator: PlayerScavGenerator, @inject("PlayerScavGenerator") protected playerScavGenerator: PlayerScavGenerator,
@inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder, @inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder,
@inject("TraderHelper") protected traderHelper: TraderHelper, @inject("TraderHelper") protected traderHelper: TraderHelper,
@ -210,7 +212,7 @@ export class ProfileController
} }
else else
{ {
this.logger.warning(`Unable to delete profile with id: ${sessionID}, no profile with that id found`); this.logger.warning(this.localisationService.getText("profile-unable_to_find_profile_by_id_cannot_delete", sessionID));
} }
} }

View File

@ -257,7 +257,8 @@ export class RagfairController
const assortPurchased = traderAssorts.find(x => x._id === offer._id); const assortPurchased = traderAssorts.find(x => x._id === offer._id);
if (!assortPurchased) if (!assortPurchased)
{ {
this.logger.warning(`Flea offer ${offer._id} could not have its stack count adjusted to match trader ${offer.user.id} value`); this.logger.warning(this.localisationService.getText("ragfair-unable_to_adjust_stack_count_assort_not_found", {offerId: offer._id, traderId: offer.user.id}));
return; return;
} }
@ -551,13 +552,15 @@ export class RagfairController
const offers = this.saveServer.getProfile(sessionID).characters.pmc.RagfairInfo.offers; const offers = this.saveServer.getProfile(sessionID).characters.pmc.RagfairInfo.offers;
if (!offers) if (!offers)
{ {
this.logger.warning(`No offers found in profile ${sessionID}, unable to remove offer ${offerId}`); this.logger.warning(this.localisationService.getText("ragfair-unable_to_remove_offer_not_found_in_profile", {profileId: sessionID, offerId: offerId}));
this.saveServer.getProfile(sessionID).characters.pmc.RagfairInfo.offers = [];
} }
const index = offers.findIndex(offer => offer._id === offerId); const index = offers.findIndex(offer => offer._id === offerId);
if (index === -1) if (index === -1)
{ {
this.logger.warning(this.localisationService.getText("ragfair-offer_not_found_in_profile", {offerId: offerId})); this.logger.error(this.localisationService.getText("ragfair-offer_not_found_in_profile", {offerId: offerId}));
return this.httpResponse.appendErrorToOutput(this.eventOutputHolder.getOutput(sessionID), this.localisationService.getText("ragfair-offer_not_found_in_profile_short")); return this.httpResponse.appendErrorToOutput(this.eventOutputHolder.getOutput(sessionID), this.localisationService.getText("ragfair-offer_not_found_in_profile_short"));
} }

View File

@ -202,7 +202,7 @@ export class RepeatableQuestController
lifeline++; lifeline++;
if (lifeline > 10) if (lifeline > 10)
{ {
this.logger.debug("We were stuck in repeatable quest generation. This should never happen. Please report."); this.logger.debug("We were stuck in repeatable quest generation. This should never happen. Please report");
break; break;
} }
} }
@ -1233,7 +1233,7 @@ export class RepeatableQuestController
lifeline++; lifeline++;
if (lifeline > 10) if (lifeline > 10)
{ {
this.logger.debug("We were stuck in repeatable quest generation. This should never happen. Please report."); this.logger.debug("We were stuck in repeatable quest generation. This should never happen. Please report");
break; break;
} }
} }

View File

@ -332,7 +332,7 @@ export class BotLootGenerator
const result = this.botConfig.lootNValue[botRole]; const result = this.botConfig.lootNValue[botRole];
if (!result) if (!result)
{ {
this.logger.warning(`Bot ${botRole} loot n value missing, using scav value instead`); this.logger.warning(this.localisationService.getText("bot-unable_to_find_loot_n_value_for_bot", botRole));
return this.botConfig.lootNValue["scav"]; return this.botConfig.lootNValue["scav"];
} }

View File

@ -273,7 +273,7 @@ export class LootGenerator
const weaponDetailsDb = this.itemHelper.getItem(chosenWeaponTpl); const weaponDetailsDb = this.itemHelper.getItem(chosenWeaponTpl);
if (!weaponDetailsDb[0]) if (!weaponDetailsDb[0])
{ {
this.logger.warning(`Non-item was picked as reward ${chosenWeaponTpl}, unable to continue`); this.logger.error(this.localisationService.getText("loot-non_item_picked_as_sealed_weapon_crate_reward", chosenWeaponTpl));
return itemsToReturn; return itemsToReturn;
} }

View File

@ -187,7 +187,7 @@ export class RagfairOfferHelper
// No trader assort data // No trader assort data
if (!assortData) if (!assortData)
{ {
this.logger.warning(`Unable to find trader ${offer.user.nickname} assort for item ${this.itemHelper.getItemName(offer.items[0]._tpl)} ${offer.items[0]._tpl}`); this.logger.warning(`Unable to find trader: ${offer.user.nickname} assort for item: ${this.itemHelper.getItemName(offer.items[0]._tpl)} ${offer.items[0]._tpl}, cannot check if buy restriction reached`);
return false; return false;
} }

View File

@ -2,6 +2,7 @@ import { inject, injectable } from "tsyringe";
import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { LocalisationService } from "./LocalisationService";
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */ /** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
@ -11,7 +12,8 @@ export class MatchBotDetailsCacheService
protected botDetailsCache: Record<string, IBotBase> = {}; protected botDetailsCache: Record<string, IBotBase> = {};
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger @inject("WinstonLogger") protected logger: ILogger,
@inject("LocalisationService") protected localisationService: LocalisationService
) )
{} {}
@ -42,7 +44,7 @@ export class MatchBotDetailsCacheService
const botInCache = this.botDetailsCache[botName]; const botInCache = this.botDetailsCache[botName];
if (!botInCache) if (!botInCache)
{ {
this.logger.warning(`Bot not found in cache with name ${botName}`); this.logger.warning(this.localisationService.getText("", botName));
} }
return botInCache; return botInCache;

View File

@ -121,7 +121,7 @@ export class PmcChatResponseService
const possibleResponseLocaleKeys = this.getResponseLocaleKeys(responseType, isVictim); const possibleResponseLocaleKeys = this.getResponseLocaleKeys(responseType, isVictim);
if (possibleResponseLocaleKeys.length === 0) if (possibleResponseLocaleKeys.length === 0)
{ {
this.logger.warning(`No pmc response keys found for type: ${responseType}`); this.logger.warning(this.localisationService.getText("pmcresponse-unable_to_find_key", responseType));
return undefined; return undefined;
} }

View File

@ -206,7 +206,7 @@ export class ProfileFixerService
const trader = pmcProfile.TradersInfo[traderId]; const trader = pmcProfile.TradersInfo[traderId];
if (trader && trader.salesSum === null) if (trader && trader.salesSum === null)
{ {
this.logger.warning(`trader ${traderId} has a null salesSum value, resetting to 0.`); this.logger.warning(`trader ${traderId} has a null salesSum value, resetting to 0`);
trader.salesSum = 0; trader.salesSum = 0;
} }
} }

View File

@ -118,7 +118,7 @@ export class RagfairOfferService
const offer = this.ragfairOfferHandler.getOfferById(offerId); const offer = this.ragfairOfferHandler.getOfferById(offerId);
if (!offer) if (!offer)
{ {
this.logger.warning(`Unable to remove offer with offer id: ${offerId} as it cannot be found in flea market`); this.logger.warning(this.localisationService.getText("ragfair-unable_to_remove_offer_doesnt_exist", offerId));
return; return;
} }

View File

@ -16,6 +16,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { LocalisationService } from "./LocalisationService";
/** /**
* Stores flea prices for items as well as methods to interact with them * Stores flea prices for items as well as methods to interact with them
@ -40,6 +41,7 @@ export class RagfairPriceService implements OnLoad
@inject("PresetHelper") protected presetHelper: PresetHelper, @inject("PresetHelper") protected presetHelper: PresetHelper,
@inject("TraderHelper") protected traderHelper: TraderHelper, @inject("TraderHelper") protected traderHelper: TraderHelper,
@inject("RandomUtil") protected randomUtil: RandomUtil, @inject("RandomUtil") protected randomUtil: RandomUtil,
@inject("LocalisationService") protected localisationService: LocalisationService,
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer
) )
{ {
@ -123,7 +125,7 @@ export class RagfairPriceService implements OnLoad
let itemPrice = this.getDynamicPriceForItem(tplId) || this.getStaticPriceForItem(tplId); let itemPrice = this.getDynamicPriceForItem(tplId) || this.getStaticPriceForItem(tplId);
if (!itemPrice) if (!itemPrice)
{ {
this.logger.warning(`Missing live flea or handbook item price for ${tplId}, defaulting to 1, if this is a modded item contact the mods author`); this.logger.warning(this.localisationService.getText("ragfair-unable_to_find_item_price_for_item_in_flea_handbook", tplId));
} }
// If no price in dynamic/static, set to 1 // If no price in dynamic/static, set to 1
@ -327,7 +329,7 @@ export class RagfairPriceService implements OnLoad
* @param item base weapon * @param item base weapon
* @param items weapon plus mods * @param items weapon plus mods
* @param existingPrice price of existing base weapon * @param existingPrice price of existing base weapon
* @returns * @returns price of weapon in roubles
*/ */
protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number
{ {
@ -336,7 +338,7 @@ export class RagfairPriceService implements OnLoad
const presets = this.presetHelper.getPresets(item._tpl); const presets = this.presetHelper.getPresets(item._tpl);
if (!presets || presets.length === 0) if (!presets || presets.length === 0)
{ {
this.logger.warning(`Item Id: ${item._tpl} has no presets`); this.logger.warning(this.localisationService.getText("ragfair-unable_to_find_preset_with_id", item._tpl));
return existingPrice; return existingPrice;
} }