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

@@ -131,6 +131,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public class RegisteredProfileTooltipLogic : ChromeLogic
{
[TranslationReference]
static readonly string LoadingPlayerProfile = "loading-player-profile";
[TranslationReference]
static readonly string LoadingPlayerProfileFailed = "loading-player-profile-failed";
readonly PlayerDatabase playerDatabase;
PlayerProfile profile;
bool profileLoaded;
@@ -154,7 +160,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var profileWidth = 0;
var maxProfileWidth = widget.Bounds.Width;
var messageText = "Loading player profile...";
var messageText = modData.Translation.GetString(LoadingPlayerProfile);
var messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left;
Task.Run(async () =>
@@ -243,7 +249,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
if (profile == null)
{
messageText = "Failed to load player profile.";
messageText = modData.Translation.GetString(LoadingPlayerProfileFailed);
messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left;
header.Bounds.Width = widget.Bounds.Width = messageWidth;
}