Mark non-moddable translation strings as constant.

This commit is contained in:
Matthias Mailänder
2022-11-17 21:54:39 +01:00
committed by Gustas
parent 4f016f149f
commit 760a1245c5
58 changed files with 807 additions and 795 deletions

View File

@@ -23,40 +23,40 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class DownloadPackageLogic : ChromeLogic
{
static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
[TranslationReference("title")]
static readonly string Downloading = "downloading";
const string Downloading = "downloading";
[TranslationReference]
static readonly string FetchingMirrorList = "fetching-mirror-list";
const string FetchingMirrorList = "fetching-mirror-list";
[TranslationReference]
static readonly string UnknownHost = "unknown-host";
const string UnknownHost = "unknown-host";
[TranslationReference("host", "received", "suffix")]
static readonly string DownloadingFrom = "downloading-from";
const string DownloadingFrom = "downloading-from";
[TranslationReference("host", "received", "total", "suffix", "progress")]
static readonly string DownloadingFromProgress = "downloading-from-progress";
const string DownloadingFromProgress = "downloading-from-progress";
[TranslationReference]
static readonly string VerifyingArchive = "verifying-archive";
const string VerifyingArchive = "verifying-archive";
[TranslationReference]
static readonly string ArchiveValidationFailed = "archive-validation-failed";
const string ArchiveValidationFailed = "archive-validation-failed";
[TranslationReference]
static readonly string Extracting = "extracting";
const string Extracting = "extracting";
[TranslationReference("entry")]
static readonly string ExtractingEntry = "extracting-entry";
const string ExtractingEntry = "extracting-entry";
[TranslationReference]
static readonly string ArchiveExtractionFailed = "archive-extraction-failed";
const string ArchiveExtractionFailed = "archive-extraction-failed";
[TranslationReference]
static readonly string MirrorSelectionFailed = "mirror-selection-failed";
const string MirrorSelectionFailed = "mirror-selection-failed";
static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
readonly ModData modData;
readonly ModContent.ModDownload download;

View File

@@ -21,6 +21,63 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class InstallFromSourceLogic : ChromeLogic
{
[TranslationReference]
const string DetectingSources = "detecting-sources";
[TranslationReference]
const string CheckingSources = "checking-sources";
[TranslationReference("title")]
const string SearchingSourceFor = "searching-source-for";
[TranslationReference]
const string ContentPackageInstallation = "content-package-installation";
[TranslationReference]
const string GameSources = "game-sources";
[TranslationReference]
const string DigitalInstalls = "digital-installs";
[TranslationReference]
const string GameContentNotFound = "game-content-not-found";
[TranslationReference]
const string AlternativeContentSources = "alternative-content-sources";
[TranslationReference]
const string InstallingContent = "installing-content";
[TranslationReference("filename")]
public const string CopyingFilename = "copying-filename";
[TranslationReference("filename", "progress")]
public const string CopyingFilenameProgress = "copying-filename-progress";
[TranslationReference]
const string InstallationFailed = "installation-failed";
[TranslationReference]
const string CheckInstallLog = "check-install-log";
[TranslationReference("filename")]
public const string Extracing = "extracting-filename";
[TranslationReference("filename", "progress")]
public const string ExtracingProgress = "extracting-filename-progress";
[TranslationReference]
public const string Continue = "continue";
[TranslationReference]
const string Cancel = "cancel";
[TranslationReference]
const string Retry = "retry";
[TranslationReference]
const string Back = "back";
// Hide percentage indicators for files smaller than 25 MB
public const int ShowPercentageThreshold = 26214400;
@@ -53,63 +110,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Mode visible = Mode.Progress;
[TranslationReference]
static readonly string DetectingSources = "detecting-sources";
[TranslationReference]
static readonly string CheckingSources = "checking-sources";
[TranslationReference("title")]
static readonly string SearchingSourceFor = "searching-source-for";
[TranslationReference]
static readonly string ContentPackageInstallation = "content-package-installation";
[TranslationReference]
static readonly string GameSources = "game-sources";
[TranslationReference]
static readonly string DigitalInstalls = "digital-installs";
[TranslationReference]
static readonly string GameContentNotFound = "game-content-not-found";
[TranslationReference]
static readonly string AlternativeContentSources = "alternative-content-sources";
[TranslationReference]
static readonly string InstallingContent = "installing-content";
[TranslationReference("filename")]
public static readonly string CopyingFilename = "copying-filename";
[TranslationReference("filename", "progress")]
public static readonly string CopyingFilenameProgress = "copying-filename-progress";
[TranslationReference]
static readonly string InstallationFailed = "installation-failed";
[TranslationReference]
static readonly string CheckInstallLog = "check-install-log";
[TranslationReference("filename")]
public static readonly string Extracing = "extracting-filename";
[TranslationReference("filename", "progress")]
public static readonly string ExtracingProgress = "extracting-filename-progress";
[TranslationReference]
static readonly string Continue = "continue";
[TranslationReference]
static readonly string Cancel = "cancel";
[TranslationReference]
static readonly string Retry = "retry";
[TranslationReference]
static readonly string Back = "back";
[ObjectCreator.UseCtor]
public InstallFromSourceLogic(Widget widget, ModData modData, ModContent content, Dictionary<string, ModContent.ModSource> sources)
{

View File

@@ -20,6 +20,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class ModContentLogic : ChromeLogic
{
[TranslationReference]
const string ManualInstall = "manual-install";
readonly ModData modData;
readonly ModContent content;
readonly ScrollPanelWidget scrollPanel;
@@ -30,9 +33,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
bool sourceAvailable;
[TranslationReference]
static readonly string ManualInstall = "manual-install";
[ObjectCreator.UseCtor]
public ModContentLogic(ModData modData, Widget widget, Manifest mod, ModContent content, Action onCancel)
{

View File

@@ -20,15 +20,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class ModContentPromptLogic : ChromeLogic
{
[TranslationReference]
const string Continue = "continue";
[TranslationReference]
const string Quit = "quit";
readonly ModContent content;
bool requiredContentInstalled;
[TranslationReference]
static readonly string Continue = "continue";
[TranslationReference]
static readonly string Quit = "quit";
[ObjectCreator.UseCtor]
public ModContentPromptLogic(ModData modData, Widget widget, Manifest mod, ModContent content, Action continueLoading)
{