Rename Fluent-related code to be more precise.
This commit is contained in:
@@ -23,49 +23,49 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class DisplaySettingsLogic : ChromeLogic
|
||||
{
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Close = "options-camera.close";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Medium = "options-camera.medium";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Far = "options-camera.far";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Furthest = "options-camera.furthest";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Windowed = "options-display-mode.windowed";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string LegacyFullscreen = "options-display-mode.legacy-fullscreen";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Fullscreen = "options-display-mode.fullscreen";
|
||||
|
||||
[TranslationReference("number")]
|
||||
[FluentReference("number")]
|
||||
const string Display = "label-video-display-index";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Standard = "options-status-bars.standard";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string ShowOnDamage = "options-status-bars.show-on-damage";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string AlwaysShow = "options-status-bars.always-show";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Automatic = "options-target-lines.automatic";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Manual = "options-target-lines.manual";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Disabled = "options-target-lines.disabled";
|
||||
|
||||
[TranslationReference("fps")]
|
||||
[FluentReference("fps")]
|
||||
const string FrameLimiter = "checkbox-frame-limiter";
|
||||
static readonly int OriginalVideoDisplay;
|
||||
static readonly WindowMode OriginalGraphicsMode;
|
||||
@@ -106,17 +106,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
this.modData = modData;
|
||||
viewportSizes = modData.Manifest.Get<WorldViewportSizes>();
|
||||
|
||||
legacyFullscreen = TranslationProvider.GetString(LegacyFullscreen);
|
||||
fullscreen = TranslationProvider.GetString(Fullscreen);
|
||||
legacyFullscreen = FluentProvider.GetString(LegacyFullscreen);
|
||||
fullscreen = FluentProvider.GetString(Fullscreen);
|
||||
|
||||
registerPanel(panelID, label, InitPanel, ResetPanel);
|
||||
|
||||
showOnDamage = TranslationProvider.GetString(ShowOnDamage);
|
||||
alwaysShow = TranslationProvider.GetString(AlwaysShow);
|
||||
showOnDamage = FluentProvider.GetString(ShowOnDamage);
|
||||
alwaysShow = FluentProvider.GetString(AlwaysShow);
|
||||
|
||||
automatic = TranslationProvider.GetString(Automatic);
|
||||
manual = TranslationProvider.GetString(Manual);
|
||||
disabled = TranslationProvider.GetString(Disabled);
|
||||
automatic = FluentProvider.GetString(Automatic);
|
||||
manual = FluentProvider.GetString(Manual);
|
||||
disabled = FluentProvider.GetString(Disabled);
|
||||
}
|
||||
|
||||
public static string GetViewportSizeName(ModData modData, WorldViewport worldViewport)
|
||||
@@ -124,13 +124,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
switch (worldViewport)
|
||||
{
|
||||
case WorldViewport.Close:
|
||||
return TranslationProvider.GetString(Close);
|
||||
return FluentProvider.GetString(Close);
|
||||
case WorldViewport.Medium:
|
||||
return TranslationProvider.GetString(Medium);
|
||||
return FluentProvider.GetString(Medium);
|
||||
case WorldViewport.Far:
|
||||
return TranslationProvider.GetString(Far);
|
||||
return FluentProvider.GetString(Far);
|
||||
case WorldViewport.Native:
|
||||
return TranslationProvider.GetString(Furthest);
|
||||
return FluentProvider.GetString(Furthest);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@@ -166,12 +166,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var windowModeDropdown = panel.Get<DropDownButtonWidget>("MODE_DROPDOWN");
|
||||
windowModeDropdown.OnMouseDown = _ => ShowWindowModeDropdown(windowModeDropdown, ds, scrollPanel);
|
||||
windowModeDropdown.GetText = () => ds.Mode == WindowMode.Windowed
|
||||
? TranslationProvider.GetString(Windowed)
|
||||
? FluentProvider.GetString(Windowed)
|
||||
: ds.Mode == WindowMode.Fullscreen ? legacyFullscreen : fullscreen;
|
||||
|
||||
var displaySelectionDropDown = panel.Get<DropDownButtonWidget>("DISPLAY_SELECTION_DROPDOWN");
|
||||
displaySelectionDropDown.OnMouseDown = _ => ShowDisplaySelectionDropdown(displaySelectionDropDown, ds);
|
||||
var displaySelectionLabel = new CachedTransform<int, string>(i => TranslationProvider.GetString(Display, Translation.Arguments("number", i + 1)));
|
||||
var displaySelectionLabel = new CachedTransform<int, string>(i => FluentProvider.GetString(Display, FluentBundle.Arguments("number", i + 1)));
|
||||
displaySelectionDropDown.GetText = () => displaySelectionLabel.Update(ds.VideoDisplay);
|
||||
displaySelectionDropDown.IsDisabled = () => Game.Renderer.DisplayCount < 2;
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var statusBarsDropDown = panel.Get<DropDownButtonWidget>("STATUS_BAR_DROPDOWN");
|
||||
statusBarsDropDown.OnMouseDown = _ => ShowStatusBarsDropdown(statusBarsDropDown, gs);
|
||||
statusBarsDropDown.GetText = () => gs.StatusBars == StatusBarsType.Standard
|
||||
? TranslationProvider.GetString(Standard)
|
||||
? FluentProvider.GetString(Standard)
|
||||
: gs.StatusBars == StatusBarsType.DamageShow
|
||||
? showOnDamage
|
||||
: alwaysShow;
|
||||
@@ -242,7 +242,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var frameLimitGamespeedCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_GAMESPEED_CHECKBOX");
|
||||
var frameLimitCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_CHECKBOX");
|
||||
var frameLimitLabel = new CachedTransform<int, string>(fps => TranslationProvider.GetString(FrameLimiter, Translation.Arguments("fps", fps)));
|
||||
var frameLimitLabel = new CachedTransform<int, string>(fps => FluentProvider.GetString(FrameLimiter, FluentBundle.Arguments("fps", fps)));
|
||||
frameLimitCheckbox.GetText = () => frameLimitLabel.Update(ds.MaxFramerate);
|
||||
frameLimitCheckbox.IsDisabled = () => ds.CapFramerateToGameFps;
|
||||
|
||||
@@ -350,9 +350,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var options = new Dictionary<string, WindowMode>()
|
||||
{
|
||||
{ TranslationProvider.GetString(Fullscreen), WindowMode.PseudoFullscreen },
|
||||
{ TranslationProvider.GetString(LegacyFullscreen), WindowMode.Fullscreen },
|
||||
{ TranslationProvider.GetString(Windowed), WindowMode.Windowed },
|
||||
{ FluentProvider.GetString(Fullscreen), WindowMode.PseudoFullscreen },
|
||||
{ FluentProvider.GetString(LegacyFullscreen), WindowMode.Fullscreen },
|
||||
{ FluentProvider.GetString(Windowed), WindowMode.Windowed },
|
||||
};
|
||||
|
||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||
@@ -399,9 +399,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var options = new Dictionary<string, StatusBarsType>()
|
||||
{
|
||||
{ TranslationProvider.GetString(Standard), StatusBarsType.Standard },
|
||||
{ TranslationProvider.GetString(ShowOnDamage), StatusBarsType.DamageShow },
|
||||
{ TranslationProvider.GetString(AlwaysShow), StatusBarsType.AlwaysShow },
|
||||
{ FluentProvider.GetString(Standard), StatusBarsType.Standard },
|
||||
{ FluentProvider.GetString(ShowOnDamage), StatusBarsType.DamageShow },
|
||||
{ FluentProvider.GetString(AlwaysShow), StatusBarsType.AlwaysShow },
|
||||
};
|
||||
|
||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||
@@ -454,9 +454,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var options = new Dictionary<string, TargetLinesType>()
|
||||
{
|
||||
{ TranslationProvider.GetString(Automatic), TargetLinesType.Automatic },
|
||||
{ TranslationProvider.GetString(Manual), TargetLinesType.Manual },
|
||||
{ TranslationProvider.GetString(Disabled), TargetLinesType.Disabled },
|
||||
{ FluentProvider.GetString(Automatic), TargetLinesType.Automatic },
|
||||
{ FluentProvider.GetString(Manual), TargetLinesType.Manual },
|
||||
{ FluentProvider.GetString(Disabled), TargetLinesType.Disabled },
|
||||
};
|
||||
|
||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||
|
||||
@@ -19,10 +19,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class HotkeysSettingsLogic : ChromeLogic
|
||||
{
|
||||
[TranslationReference("key")]
|
||||
[FluentReference("key")]
|
||||
const string OriginalNotice = "label-original-notice";
|
||||
|
||||
[TranslationReference("key", "context")]
|
||||
[FluentReference("key", "context")]
|
||||
const string DuplicateNotice = "label-duplicate-notice";
|
||||
|
||||
readonly ModData modData;
|
||||
@@ -229,7 +229,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
duplicateNotice.IsVisible = () => !isHotkeyValid;
|
||||
var duplicateNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
|
||||
hd != null ?
|
||||
TranslationProvider.GetString(DuplicateNotice, Translation.Arguments("key", hd.Description,
|
||||
FluentProvider.GetString(DuplicateNotice, FluentBundle.Arguments("key", hd.Description,
|
||||
"context", hd.Contexts.First(c => selectedHotkeyDefinition.Contexts.Contains(c)))) :
|
||||
"");
|
||||
duplicateNotice.GetText = () => duplicateNoticeText.Update(duplicateHotkeyDefinition);
|
||||
@@ -238,7 +238,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
originalNotice.TextColor = ChromeMetrics.Get<Color>("NoticeInfoColor");
|
||||
originalNotice.IsVisible = () => isHotkeyValid && !isHotkeyDefault;
|
||||
var originalNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
|
||||
TranslationProvider.GetString(OriginalNotice, Translation.Arguments("key", hd?.Default.DisplayString())));
|
||||
FluentProvider.GetString(OriginalNotice, FluentBundle.Arguments("key", hd?.Default.DisplayString())));
|
||||
originalNotice.GetText = () => originalNoticeText.Update(selectedHotkeyDefinition);
|
||||
|
||||
var readonlyNotice = panel.Get<LabelWidget>("READONLY_NOTICE");
|
||||
|
||||
@@ -18,37 +18,37 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class InputSettingsLogic : ChromeLogic
|
||||
{
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Classic = "options-control-scheme.classic";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Modern = "options-control-scheme.modern";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Disabled = "options-mouse-scroll-type.disabled";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Standard = "options-mouse-scroll-type.standard";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Inverted = "options-mouse-scroll-type.inverted";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Joystick = "options-mouse-scroll-type.joystick";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Alt = "options-zoom-modifier.alt";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Ctrl = "options-zoom-modifier.ctrl";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Meta = "options-zoom-modifier.meta";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string Shift = "options-zoom-modifier.shift";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string None = "options-zoom-modifier.none";
|
||||
|
||||
static InputSettingsLogic() { }
|
||||
@@ -59,8 +59,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
[ObjectCreator.UseCtor]
|
||||
public InputSettingsLogic(Action<string, string, Func<Widget, Func<bool>>, Func<Widget, Action>> registerPanel, string panelID, string label)
|
||||
{
|
||||
classic = TranslationProvider.GetString(Classic);
|
||||
modern = TranslationProvider.GetString(Modern);
|
||||
classic = FluentProvider.GetString(Classic);
|
||||
modern = FluentProvider.GetString(Modern);
|
||||
|
||||
registerPanel(panelID, label, InitPanel, ResetPanel);
|
||||
}
|
||||
@@ -163,8 +163,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var options = new Dictionary<string, bool>()
|
||||
{
|
||||
{ TranslationProvider.GetString(Classic), true },
|
||||
{ TranslationProvider.GetString(Modern), false },
|
||||
{ FluentProvider.GetString(Classic), true },
|
||||
{ FluentProvider.GetString(Modern), false },
|
||||
};
|
||||
|
||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||
@@ -183,10 +183,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var options = new Dictionary<string, MouseScrollType>()
|
||||
{
|
||||
{ TranslationProvider.GetString(Disabled), MouseScrollType.Disabled },
|
||||
{ TranslationProvider.GetString(Standard), MouseScrollType.Standard },
|
||||
{ TranslationProvider.GetString(Inverted), MouseScrollType.Inverted },
|
||||
{ TranslationProvider.GetString(Joystick), MouseScrollType.Joystick },
|
||||
{ FluentProvider.GetString(Disabled), MouseScrollType.Disabled },
|
||||
{ FluentProvider.GetString(Standard), MouseScrollType.Standard },
|
||||
{ FluentProvider.GetString(Inverted), MouseScrollType.Inverted },
|
||||
{ FluentProvider.GetString(Joystick), MouseScrollType.Joystick },
|
||||
};
|
||||
|
||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||
@@ -205,11 +205,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var options = new Dictionary<string, Modifiers>()
|
||||
{
|
||||
{ TranslationProvider.GetString(Alt), Modifiers.Alt },
|
||||
{ TranslationProvider.GetString(Ctrl), Modifiers.Ctrl },
|
||||
{ TranslationProvider.GetString(Meta), Modifiers.Meta },
|
||||
{ TranslationProvider.GetString(Shift), Modifiers.Shift },
|
||||
{ TranslationProvider.GetString(None), Modifiers.None }
|
||||
{ FluentProvider.GetString(Alt), Modifiers.Alt },
|
||||
{ FluentProvider.GetString(Ctrl), Modifiers.Ctrl },
|
||||
{ FluentProvider.GetString(Meta), Modifiers.Meta },
|
||||
{ FluentProvider.GetString(Shift), Modifiers.Shift },
|
||||
{ FluentProvider.GetString(None), Modifiers.None }
|
||||
};
|
||||
|
||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||
|
||||
@@ -19,37 +19,37 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class SettingsLogic : ChromeLogic
|
||||
{
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string SettingsSaveTitle = "dialog-settings-save.title";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string SettingsSavePrompt = "dialog-settings-save.prompt";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string SettingsSaveCancel = "dialog-settings-save.cancel";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string RestartTitle = "dialog-settings-restart.title";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string RestartPrompt = "dialog-settings-restart.prompt";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string RestartAccept = "dialog-settings-restart.confirm";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string RestartCancel = "dialog-settings-restart.cancel";
|
||||
|
||||
[TranslationReference("panel")]
|
||||
[FluentReference("panel")]
|
||||
const string ResetTitle = "dialog-settings-reset.title";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string ResetPrompt = "dialog-settings-reset.prompt";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string ResetAccept = "dialog-settings-reset.confirm";
|
||||
|
||||
[TranslationReference]
|
||||
[FluentReference]
|
||||
const string ResetCancel = "dialog-settings-reset.cancel";
|
||||
|
||||
readonly Dictionary<string, Func<bool>> leavePanelActions = new();
|
||||
@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
ConfirmationDialogs.ButtonPrompt(modData,
|
||||
title: ResetTitle,
|
||||
text: ResetPrompt,
|
||||
titleArguments: Translation.Arguments("panel", panels[activePanel]),
|
||||
titleArguments: FluentBundle.Arguments("panel", panels[activePanel]),
|
||||
onConfirm: Reset,
|
||||
confirmText: ResetAccept,
|
||||
onCancel: () => { },
|
||||
|
||||
Reference in New Issue
Block a user