Extract translation strings.

This commit is contained in:
Matthias Mailänder
2022-08-29 20:56:25 +02:00
committed by Gustas
parent dfd5a960ed
commit 0b67b5bfae
42 changed files with 1819 additions and 410 deletions

View File

@@ -18,9 +18,20 @@ namespace OpenRA.Mods.Common.Widgets.Logic
[ChromeLogicArgsHotkeys("MuteAudioKey")]
public class MuteHotkeyLogic : SingleHotkeyBaseLogic
{
readonly ModData modData;
[TranslationReference]
static readonly string AudioMuted = "audio-muted";
[TranslationReference]
static readonly string AudioUnmuted = "audio-unmuted";
[ObjectCreator.UseCtor]
public MuteHotkeyLogic(Widget widget, ModData modData, Dictionary<string, MiniYaml> logicArgs)
: base(widget, modData, "MuteAudioKey", "GLOBAL_KEYHANDLER", logicArgs) { }
: base(widget, modData, "MuteAudioKey", "GLOBAL_KEYHANDLER", logicArgs)
{
this.modData = modData;
}
protected override bool OnHotkeyActivated(KeyInput e)
{
@@ -29,12 +40,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (Game.Settings.Sound.Mute)
{
Game.Sound.MuteAudio();
TextNotificationsManager.AddFeedbackLine("Audio muted.");
TextNotificationsManager.AddFeedbackLine(modData.Translation.GetString(AudioMuted));
}
else
{
Game.Sound.UnmuteAudio();
TextNotificationsManager.AddFeedbackLine("Audio unmuted.");
TextNotificationsManager.AddFeedbackLine(modData.Translation.GetString(AudioUnmuted));
}
return true;