From 56f6d76b780cdd3afbc0e6540bc48a952d0c6d3a Mon Sep 17 00:00:00 2001 From: Dunedan Date: Mon, 5 Aug 2024 15:27:12 +0000 Subject: [PATCH] Remove internationalization of log messages As log messages aren't supposed to be translatable, this removes the internationalization of all log messages, which had it enabled. Patch by: @Dunedan Accepted by: @Itms Differential Revision: https://code.wildfiregames.com/D5314 This was SVN commit r28179. --- .../gui/campaigns/default_menu/CampaignMenu.js | 2 +- .../mods/public/gui/gamesetup_mp/gamesetup_mp.js | 2 +- .../data/mods/public/gui/pregame/MainMenuItems.js | 4 ++-- source/graphics/CameraController.cpp | 14 +++++++------- source/ps/Mod.cpp | 7 ++----- source/ps/SavedGame.cpp | 4 ++-- source/renderer/Renderer.cpp | 4 ++-- 7 files changed, 17 insertions(+), 20 deletions(-) diff --git a/binaries/data/mods/public/gui/campaigns/default_menu/CampaignMenu.js b/binaries/data/mods/public/gui/campaigns/default_menu/CampaignMenu.js index dd51f7636b..2d805fa0c0 100644 --- a/binaries/data/mods/public/gui/campaigns/default_menu/CampaignMenu.js +++ b/binaries/data/mods/public/gui/campaigns/default_menu/CampaignMenu.js @@ -243,7 +243,7 @@ function init(initData) run.setCurrent(); g_CampaignMenu = new CampaignMenu(run); } catch (err) { - error(sprintf(translate("Error loading campaign run %s: %s."), CampaignRun.getCurrentRunFilename(), err)); + error(sprintf("Error loading campaign run %s: %s.", CampaignRun.getCurrentRunFilename(), err)); Engine.SwitchGuiPage("page_pregame.xml", {}); } } diff --git a/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js b/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js index afb139b99f..98a4d07da5 100644 --- a/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js +++ b/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js @@ -190,7 +190,7 @@ function pollAndHandleNetworkClient() if (!message) break; - log(sprintf(translate("Net message: %(message)s"), { "message": uneval(message) })); + log(sprintf("Net message: %(message)s", { "message": uneval(message) })); // If we're rejoining an active game, we don't want to actually display // the game setup screen, so perform similar processing to gamesetup.js // in this screen diff --git a/binaries/data/mods/public/gui/pregame/MainMenuItems.js b/binaries/data/mods/public/gui/pregame/MainMenuItems.js index 4ba5d654f4..a5fedec4e6 100644 --- a/binaries/data/mods/public/gui/pregame/MainMenuItems.js +++ b/binaries/data/mods/public/gui/pregame/MainMenuItems.js @@ -70,7 +70,7 @@ var g_MainMenuItems = [ } catch(err) { - error(translate("Error opening campaign run:")); + error("Error opening campaign run:"); error(err.toString()); } }, @@ -127,7 +127,7 @@ var g_MainMenuItems = [ } catch(err) { - error(translate("Error opening campaign run:")); + error("Error opening campaign run:"); error(err.toString()); } }, diff --git a/source/graphics/CameraController.cpp b/source/graphics/CameraController.cpp index e2db3c6a7c..c1344744a5 100644 --- a/source/graphics/CameraController.cpp +++ b/source/graphics/CameraController.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2024 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -658,39 +658,39 @@ InReaction CCameraController::HandleEvent(const SDL_Event_* ev) else if (hotkey == "camera.scroll.speed.increase") { m_ViewScrollSpeed *= m_ViewScrollSpeedModifier; - LOGMESSAGERENDER(g_L10n.Translate("Scroll speed increased to %.1f"), m_ViewScrollSpeed); + LOGMESSAGERENDER("Scroll speed increased to %.1f", m_ViewScrollSpeed); return IN_HANDLED; } else if (hotkey == "camera.scroll.speed.decrease") { m_ViewScrollSpeed /= m_ViewScrollSpeedModifier; - LOGMESSAGERENDER(g_L10n.Translate("Scroll speed decreased to %.1f"), m_ViewScrollSpeed); + LOGMESSAGERENDER("Scroll speed decreased to %.1f", m_ViewScrollSpeed); return IN_HANDLED; } else if (hotkey == "camera.rotate.speed.increase") { m_ViewRotateXSpeed *= m_ViewRotateSpeedModifier; m_ViewRotateYSpeed *= m_ViewRotateSpeedModifier; - LOGMESSAGERENDER(g_L10n.Translate("Rotate speed increased to X=%.3f, Y=%.3f"), m_ViewRotateXSpeed, m_ViewRotateYSpeed); + LOGMESSAGERENDER("Rotate speed increased to X=%.3f, Y=%.3f", m_ViewRotateXSpeed, m_ViewRotateYSpeed); return IN_HANDLED; } else if (hotkey == "camera.rotate.speed.decrease") { m_ViewRotateXSpeed /= m_ViewRotateSpeedModifier; m_ViewRotateYSpeed /= m_ViewRotateSpeedModifier; - LOGMESSAGERENDER(g_L10n.Translate("Rotate speed decreased to X=%.3f, Y=%.3f"), m_ViewRotateXSpeed, m_ViewRotateYSpeed); + LOGMESSAGERENDER("Rotate speed decreased to X=%.3f, Y=%.3f", m_ViewRotateXSpeed, m_ViewRotateYSpeed); return IN_HANDLED; } else if (hotkey == "camera.zoom.speed.increase") { m_ViewZoomSpeed *= m_ViewZoomSpeedModifier; - LOGMESSAGERENDER(g_L10n.Translate("Zoom speed increased to %.1f"), m_ViewZoomSpeed); + LOGMESSAGERENDER("Zoom speed increased to %.1f", m_ViewZoomSpeed); return IN_HANDLED; } else if (hotkey == "camera.zoom.speed.decrease") { m_ViewZoomSpeed /= m_ViewZoomSpeedModifier; - LOGMESSAGERENDER(g_L10n.Translate("Zoom speed decreased to %.1f"), m_ViewZoomSpeed); + LOGMESSAGERENDER("Zoom speed decreased to %.1f", m_ViewZoomSpeed); return IN_HANDLED; } return IN_PASS; diff --git a/source/ps/Mod.cpp b/source/ps/Mod.cpp index cbf13726c6..7062bbf3a5 100644 --- a/source/ps/Mod.cpp +++ b/source/ps/Mod.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2024 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -89,10 +89,7 @@ bool LoadModJSON(const PIVFS& vfs, OsPath modsPath, OsPath mod, std::string& tex else { // Print a warning - we'll keep trying, which could have adverse effects. - if (L10n::IsInitialised()) - LOGWARNING(g_L10n.Translate("Could not write external mod.json for zipped mod '%s'. The mod should be reinstalled."), mod.string8()); - else - LOGWARNING("Could not write external mod.json for zipped mod '%s'. The mod should be reinstalled.", mod.string8()); + LOGWARNING("Could not write external mod.json for zipped mod '%s'. The mod should be reinstalled.", mod.string8()); } return true; } diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp index 68c0a87296..5e3135200e 100644 --- a/source/ps/SavedGame.cpp +++ b/source/ps/SavedGame.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2024 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -139,7 +139,7 @@ Status SavedGames::Save(const CStrW& name, const CStrW& description, CSimulation OsPath realPath; WARN_RETURN_STATUS_IF_ERR(g_VFS->GetRealPath(filename, realPath)); - LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%s'"), realPath.string8()); + LOGMESSAGERENDER("Saved game to '%s'", realPath.string8()); debug_printf("Saved game to '%s'\n", realPath.string8().c_str()); return INFO::OK; diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 1b26aa73a7..dfc60385fa 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -684,7 +684,7 @@ void CRenderer::RenderScreenShot(const bool needsPresent) OsPath realPath; g_VFS->GetRealPath(filename, realPath); - LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%s'"), realPath.string8()); + LOGMESSAGERENDER("Screenshot written to '%s'", realPath.string8()); debug_printf( CStr(g_L10n.Translate("Screenshot written to '%s'") + "\n").c_str(), @@ -810,7 +810,7 @@ void CRenderer::RenderBigScreenShot(const bool needsPresent) OsPath realPath; g_VFS->GetRealPath(filename, realPath); - LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%s'"), realPath.string8()); + LOGMESSAGERENDER("Screenshot written to '%s'", realPath.string8()); debug_printf( CStr(g_L10n.Translate("Screenshot written to '%s'") + "\n").c_str(),