Merge pull request #3929 from ScottNZ/translation

Add translation support
This commit is contained in:
Paul Chote
2013-10-13 23:57:12 -07:00
29 changed files with 360 additions and 171 deletions

View File

@@ -104,6 +104,10 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
var windowHeight = generalPane.Get<TextFieldWidget>("WINDOW_HEIGHT");
windowHeight.Text = graphicsSettings.WindowedSize.Y.ToString();
var languageDropDownButton = generalPane.Get<DropDownButtonWidget>("LANGUAGE_DROPDOWNBUTTON");
languageDropDownButton.OnMouseDown = _ => SettingsMenuLogic.ShowLanguageDropdown(languageDropDownButton);
languageDropDownButton.GetText = () => FieldLoader.Translate(Game.Settings.Graphics.Language);
// Audio
var soundSlider = generalPane.Get<SliderWidget>("SOUND_SLIDER");
soundSlider.OnChange += x => { soundSettings.SoundVolume = x; Sound.SoundVolume = x; };

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
nameLabel.GetText = () => tooltip.Name;
var prereqs = buildable.Prerequisites.Select(a => ActorName(a));
var requiresString = prereqs.Any() ? "Requires {0}".F(prereqs.JoinWith(", ")) : "";
var requiresString = prereqs.Any() ? requiresLabel.Text.F(prereqs.JoinWith(", ")) : "";
requiresLabel.GetText = () => requiresString;
var power = bi != null ? bi.Power : 0;

View File

@@ -37,8 +37,8 @@ namespace OpenRA.Mods.Cnc.Widgets
public readonly string TooltipContainer;
public readonly string TooltipTemplate = "PRODUCTION_TOOLTIP";
public readonly string ReadyText = "";
public readonly string HoldText = "";
[Translate] public readonly string ReadyText = "";
[Translate] public readonly string HoldText = "";
public string TooltipActor { get; private set; }
public readonly World World;