Merge pull request #5152 from Mailaender/auto-l10n

Automated translation string extraction
This commit is contained in:
Paul Chote
2014-06-12 10:31:07 +12:00
8 changed files with 88 additions and 9 deletions

View File

@@ -20,6 +20,11 @@ namespace OpenRA
{
public static class Exts
{
public static bool IsUppercase(this string str)
{
return string.Compare(str.ToUpperInvariant(), str, false) == 0;
}
public static string F(this string fmt, params object[] args)
{
return string.Format(fmt, args);

View File

@@ -111,9 +111,13 @@ namespace OpenRA
public IEnumerable<Type> GetTypesImplementing<T>()
{
var it = typeof(T);
return GetTypes().Where(t => t != it && it.IsAssignableFrom(t));
}
public IEnumerable<Type> GetTypes()
{
return assemblies.Select(ma => ma.First).Distinct()
.SelectMany(ma => ma.GetTypes()
.Where(t => t != it && it.IsAssignableFrom(t)));
.SelectMany(ma => ma.GetTypes());
}
[AttributeUsage(AttributeTargets.Constructor)]

View File

@@ -46,7 +46,7 @@ namespace OpenRA.Widgets
Lazy<TooltipContainerWidget> tooltipContainer;
public readonly string TooltipContainer;
public readonly string TooltipTemplate = "BUTTON_TOOLTIP";
public string TooltipText;
[Translate] public string TooltipText;
// Equivalent to OnMouseUp, but without an input arg
public Action OnClick = () => {};