Let's see if this localizes the menu, then
This commit is contained in:
@@ -6,7 +6,23 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Swarmops.Localization
|
||||
{
|
||||
class LocStrings
|
||||
public static class LocStrings
|
||||
{
|
||||
public static string GetString(LocDomain domain, string stringResource)
|
||||
{
|
||||
switch (domain)
|
||||
{
|
||||
case LocDomain.Menu5:
|
||||
return Menu5.ResourceManager.GetString(stringResource);
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("Unimplemented localization domain: " + domain.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum LocString
|
||||
{
|
||||
Unknown = 0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Web.UI;
|
||||
using System.Xml.Serialization;
|
||||
using Swarmops.Frontend;
|
||||
using Swarmops.Interface.Objects;
|
||||
using Swarmops.Localization;
|
||||
using Swarmops.Logic.Support;
|
||||
using Swarmops.Logic.Swarm;
|
||||
|
||||
@@ -104,7 +105,7 @@ namespace Swarmops.Controls.Base
|
||||
|
||||
if (!String.IsNullOrEmpty (menuItem.ResourceKey))
|
||||
{
|
||||
object resourceObject = Resources.Menu5.ResourceManager.GetString("Menu5_" + menuItem.ResourceKey);
|
||||
object resourceObject = LocStrings.GetString(LocDomain.Menu5, "Menu5_" + menuItem.ResourceKey);
|
||||
if (resourceObject != null)
|
||||
{
|
||||
localizedText = resourceObject.ToString();
|
||||
|
||||
Reference in New Issue
Block a user