diff --git a/Site/App_GlobalResources/Global.designer.cs b/Site/App_GlobalResources/Global.designer.cs index 7a4adedf..69702bbc 100644 --- a/Site/App_GlobalResources/Global.designer.cs +++ b/Site/App_GlobalResources/Global.designer.cs @@ -9,6 +9,7 @@ //------------------------------------------------------------------------------ using System.Globalization; +using System.IO; namespace Resources { using System; @@ -54,6 +55,14 @@ namespace Resources { string prefix = string.Empty; string infix = string.Empty; string suffix = ".resources"; + string resourceAssemblyPath = "/usr/share/swarmops/frontend/bin/"; + + if (Path.DirectorySeparatorChar != '/') + { + // If we're not running on Linux, this is a development environment, + // so use the HttpContext for the running folder + resourceAssemblyPath = "~/"; + } CultureInfo currentCulture = CultureInfo.CurrentUICulture; if (currentCulture != null /* && currentCulture.Name != "neutral" */) @@ -63,7 +72,12 @@ namespace Resources { infix = "." + cultureName; prefix = cultureName + "/"; - return System.Reflection.Assembly.Load(prefix + baseAssemblyName + infix + suffix); + // If specific culture exists, return it, otherwise return neutral culture + + if (File.Exists(resourceAssemblyPath + prefix + baseAssemblyName + infix + suffix)) + { + return System.Reflection.Assembly.Load(resourceAssemblyPath + prefix + baseAssemblyName + suffix + ".dll"); + } } return System.Reflection.Assembly.Load(baseAssemblyName + suffix);