Refactor translation files
- Add prefixes to all message keys to provide context - Use messages with attributes for some UI elements (dropdowns, dialogs, checkboxes, menus) - Rename some class fields for consistency with translation keys
This commit is contained in:
committed by
Paul Chote
parent
46caa2d889
commit
a0f17b15ec
@@ -22,11 +22,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the developer mode checkbox in the lobby.")]
|
||||
public readonly string CheckboxLabel = "debug-menu.label";
|
||||
public readonly string CheckboxLabel = "checkbox-debug-menu.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the developer mode checkbox in the lobby.")]
|
||||
public readonly string CheckboxDescription = "debug-menu.description";
|
||||
public readonly string CheckboxDescription = "checkbox-debug-menu.description";
|
||||
|
||||
[Desc("Default value of the developer mode checkbox in the lobby.")]
|
||||
public readonly bool CheckboxEnabled = false;
|
||||
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class DeveloperMode : IResolveOrder, ISync, INotifyCreated, IUnlocksRenderPlayer
|
||||
{
|
||||
[TranslationReference("cheat", "player", "suffix")]
|
||||
const string CheatUsed = "cheat-used";
|
||||
const string CheatUsed = "notification-cheat-used";
|
||||
|
||||
readonly DeveloperModeInfo info;
|
||||
public bool Enabled { get; private set; }
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
const string CommandName = "custom-terrain";
|
||||
|
||||
[TranslationReference]
|
||||
const string CommandDescription = "custom-terrain-debug-overlay-description";
|
||||
const string CommandDescription = "description-custom-terrain-debug-overlay";
|
||||
|
||||
public bool Enabled;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
const string CommandName = "triggers";
|
||||
|
||||
[TranslationReference]
|
||||
const string CommandDescription = "cell-trigger-overlay-description";
|
||||
const string CommandDescription = "description-cell-triggers-overlay";
|
||||
|
||||
bool enabled;
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class ColorPickerManagerInfo : TraitInfo<ColorPickerManager>, IRulesetLoaded
|
||||
{
|
||||
[TranslationReference]
|
||||
const string PlayerColorTerrain = "player-color-terrain";
|
||||
const string PlayerColorTerrain = "notification-player-color-terrain";
|
||||
|
||||
[TranslationReference]
|
||||
const string PlayerColorPlayer = "player-color-player";
|
||||
const string PlayerColorPlayer = "notification-player-color-player";
|
||||
|
||||
[TranslationReference]
|
||||
const string InvalidPlayerColor = "invalid-player-color";
|
||||
const string InvalidPlayerColor = "notification-invalid-player-color";
|
||||
|
||||
[Desc("Minimum and maximum saturation levels that are valid for use.")]
|
||||
public readonly float[] HsvSaturationRange = { 0.3f, 0.95f };
|
||||
|
||||
@@ -23,11 +23,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the crates checkbox in the lobby.")]
|
||||
public readonly string CheckboxLabel = "crates.label";
|
||||
public readonly string CheckboxLabel = "checkbox-crates.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the crates checkbox in the lobby.")]
|
||||
public readonly string CheckboxDescription = "crates.description";
|
||||
public readonly string CheckboxDescription = "checkbox-crates.description";
|
||||
|
||||
[Desc("Default value of the crates checkbox in the lobby.")]
|
||||
public readonly bool CheckboxEnabled = true;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
const string CommandName = "exits-overlay";
|
||||
|
||||
[TranslationReference]
|
||||
const string CommandDescription = "exits-debug-overlay-description";
|
||||
const string CommandDescription = "description-exits-overlay";
|
||||
|
||||
public readonly SpriteFont Font;
|
||||
public readonly ExitsDebugOverlayManagerInfo Info;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
const string CommandName = "hpf";
|
||||
|
||||
[TranslationReference]
|
||||
const string CommandDescription = "hpf-overlay-description";
|
||||
const string CommandDescription = "description-hpf-debug-overlay";
|
||||
|
||||
readonly HierarchicalPathFinderOverlayInfo info;
|
||||
readonly SpriteFont font;
|
||||
|
||||
@@ -20,11 +20,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the ally build radius checkbox in the lobby.")]
|
||||
public readonly string AllyBuildRadiusCheckboxLabel = "ally-build-radius.label";
|
||||
public readonly string AllyBuildRadiusCheckboxLabel = "checkbox-ally-build-radius.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the ally build radius checkbox in the lobby.")]
|
||||
public readonly string AllyBuildRadiusCheckboxDescription = "ally-build-radius.description";
|
||||
public readonly string AllyBuildRadiusCheckboxDescription = "checkbox-ally-build-radius.description";
|
||||
|
||||
[Desc("Default value of the ally build radius checkbox in the lobby.")]
|
||||
public readonly bool AllyBuildRadiusCheckboxEnabled = true;
|
||||
@@ -40,11 +40,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the build radius checkbox in the lobby.")]
|
||||
public readonly string BuildRadiusCheckboxLabel = "build-radius.label";
|
||||
public readonly string BuildRadiusCheckboxLabel = "checkbox-build-radius.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the build radius checkbox in the lobby.")]
|
||||
public readonly string BuildRadiusCheckboxDescription = "build-radius.description";
|
||||
public readonly string BuildRadiusCheckboxDescription = "checkbox-build-radius.description";
|
||||
|
||||
[Desc("Default value of the build radius checkbox in the lobby.")]
|
||||
public readonly bool BuildRadiusCheckboxEnabled = true;
|
||||
|
||||
@@ -20,11 +20,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the creeps checkbox in the lobby.")]
|
||||
public readonly string CheckboxLabel = "map-creeps.label";
|
||||
public readonly string CheckboxLabel = "dropdown-map-creeps.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the creeps checkbox in the lobby.")]
|
||||
public readonly string CheckboxDescription = "map-creeps.description";
|
||||
public readonly string CheckboxDescription = "dropdown-map-creeps.description";
|
||||
|
||||
[Desc("Default value of the creeps checkbox in the lobby.")]
|
||||
public readonly bool CheckboxEnabled = true;
|
||||
|
||||
@@ -21,11 +21,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the short game checkbox in the lobby.")]
|
||||
public readonly string ShortGameCheckboxLabel = "short-game.label";
|
||||
public readonly string ShortGameCheckboxLabel = "checkbox-short-game.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the short game checkbox in the lobby.")]
|
||||
public readonly string ShortGameCheckboxDescription = "short-game.description";
|
||||
public readonly string ShortGameCheckboxDescription = "checkbox-short-game.description";
|
||||
|
||||
[Desc("Default value of the short game checkbox in the lobby.")]
|
||||
public readonly bool ShortGameCheckboxEnabled = true;
|
||||
@@ -41,11 +41,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the tech level option in the lobby.")]
|
||||
public readonly string TechLevelDropdownLabel = "tech-level.label";
|
||||
public readonly string TechLevelDropdownLabel = "dropdown-tech-level.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the tech level option in the lobby.")]
|
||||
public readonly string TechLevelDropdownDescription = "tech-level.description";
|
||||
public readonly string TechLevelDropdownDescription = "dropdown-tech-level.description";
|
||||
|
||||
[Desc("Default tech level.")]
|
||||
public readonly string TechLevel = "unrestricted";
|
||||
@@ -61,11 +61,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the game speed option in the lobby.")]
|
||||
public readonly string GameSpeedDropdownLabel = "game-speed.label";
|
||||
public readonly string GameSpeedDropdownLabel = "dropdown-game-speed.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Description of the game speed option in the lobby.")]
|
||||
public readonly string GameSpeedDropdownDescription = "game-speed.description";
|
||||
public readonly string GameSpeedDropdownDescription = "dropdown-game-speed.description";
|
||||
|
||||
[Desc("Default game speed (leave empty to use the default defined in mod.yaml).")]
|
||||
public readonly string GameSpeed = null;
|
||||
|
||||
@@ -27,11 +27,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the spawn positions checkbox in the lobby.")]
|
||||
public readonly string SeparateTeamSpawnsCheckboxLabel = "separate-team-spawns.label";
|
||||
public readonly string SeparateTeamSpawnsCheckboxLabel = "checkbox-separate-team-spawns.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the spawn positions checkbox in the lobby.")]
|
||||
public readonly string SeparateTeamSpawnsCheckboxDescription = "separate-team-spawns.description";
|
||||
public readonly string SeparateTeamSpawnsCheckboxDescription = "checkbox-separate-team-spawns.description";
|
||||
|
||||
[Desc("Default value of the spawn positions checkbox in the lobby.")]
|
||||
public readonly bool SeparateTeamSpawnsCheckboxEnabled = true;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
const string CommandName = "path-debug";
|
||||
|
||||
[TranslationReference]
|
||||
const string CommandDescription = "path-debug-description";
|
||||
const string CommandDescription = "description-path-debug-overlay";
|
||||
|
||||
sealed class Record : PathSearch.IRecorder, IEnumerable<(CPos Source, CPos Destination, int CostSoFar, int EstimatedRemainingCost)>
|
||||
{
|
||||
|
||||
@@ -26,11 +26,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Descriptive label for the starting units option in the lobby.")]
|
||||
public readonly string DropdownLabel = "starting-units.label";
|
||||
public readonly string DropdownLabel = "dropdown-starting-units.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description for the starting units option in the lobby.")]
|
||||
public readonly string DropdownDescription = "starting-units.description";
|
||||
public readonly string DropdownDescription = "dropdown-starting-units.description";
|
||||
|
||||
[Desc("Prevent the starting units option from being changed in the lobby.")]
|
||||
public readonly bool DropdownLocked = false;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
const string CommandName = "terrain-geometry";
|
||||
|
||||
[TranslationReference]
|
||||
const string CommandDescription = "terrain-geometry-overlay";
|
||||
const string CommandDescription = "description-terrain-geometry-overlay";
|
||||
|
||||
public bool Enabled;
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TranslationReference]
|
||||
[Desc("Label that will be shown for the time limit option in the lobby.")]
|
||||
public readonly string TimeLimitLabel = "time-limit.label";
|
||||
public readonly string TimeLimitLabel = "dropdown-time-limit.label";
|
||||
|
||||
[TranslationReference]
|
||||
[Desc("Tooltip description that will be shown for the time limit option in the lobby.")]
|
||||
public readonly string TimeLimitDescription = "time-limit.description";
|
||||
public readonly string TimeLimitDescription = "dropdown-time-limit.description";
|
||||
|
||||
[Desc("Time Limit options that will be shown in the lobby dropdown. Values are in minutes.")]
|
||||
public readonly int[] TimeLimitOptions = { 0, 10, 20, 30, 40, 60, 90 };
|
||||
@@ -77,10 +77,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
[TranslationReference]
|
||||
const string NoTimeLimit = "no-time-limit";
|
||||
const string NoTimeLimit = "options-time-limit.no-limit";
|
||||
|
||||
[TranslationReference("minutes")]
|
||||
const string TimeLimitOption = "time-limit-options";
|
||||
const string TimeLimitOption = "options-time-limit.options";
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class TimeLimitManager : INotifyTimeLimit, ITick, IWorldLoaded
|
||||
{
|
||||
[TranslationReference]
|
||||
const string TimeLimitExpired = "time-limit-expired";
|
||||
const string TimeLimitExpired = "notification-time-limit-expired";
|
||||
|
||||
readonly TimeLimitManagerInfo info;
|
||||
readonly int ticksPerSecond;
|
||||
|
||||
Reference in New Issue
Block a user