Resx Folder Location

This commit is contained in:
Enner Pérez 2024-03-17 22:34:24 -05:00
parent 14550655f3
commit aa4c7be813
6 changed files with 13 additions and 9 deletions

View file

@ -93,11 +93,11 @@ namespace SourceGit
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(localeKey); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(localeKey);
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture ; Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture ;
Assets.Resources.Culture = Thread.CurrentThread.CurrentUICulture; SourceGit.Resources.Locales.Culture = Thread.CurrentThread.CurrentUICulture;
var locale = new ResourceDictionary(); var locale = new ResourceDictionary();
var res = new Assets.Resources(); var res = new Resources.Locales();
var props = typeof(Assets.Resources).GetProperties() var props = typeof(Resources.Locales).GetProperties()
.Where(m=> m.PropertyType == typeof(string)) .Where(m=> m.PropertyType == typeof(string))
.ToDictionary(k=> k.Name.Replace("_", "."), v=> v.GetValue(res)); .ToDictionary(k=> k.Name.Replace("_", "."), v=> v.GetValue(res));
foreach (var prop in props) foreach (var prop in props)

View file

@ -7,7 +7,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SourceGit.Assets { namespace SourceGit.Resources {
using System; using System;
@ -21,14 +21,14 @@ namespace SourceGit.Assets {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources { public class Locales {
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
public Resources() { public Locales() {
} }
/// <summary> /// <summary>
@ -38,7 +38,7 @@ namespace SourceGit.Assets {
public static global::System.Resources.ResourceManager ResourceManager { public static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SourceGit.Assets.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SourceGit.Resources.Locales", typeof(Locales).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;

View file

@ -48,9 +48,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Assets\Resources.*.resx"> <EmbeddedResource Update="Resources\Locales.*.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Locales.resx</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Locales.*.resx">
<Generator>ResXFileCodeGenerator</Generator>
<DependentUpon>Locales.resx</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>