mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-16 02:01:29 -07:00
Localize name of icons folder
This commit is contained in:
parent
d9c9a4cc28
commit
5c117423d0
@ -285,7 +285,6 @@ namespace Bloxstrap
|
||||
|
||||
() => Directory.Delete(Paths.Downloads, true),
|
||||
() => Directory.Delete(Paths.Roblox, true),
|
||||
() => Directory.Delete(Paths.Icons, true),
|
||||
|
||||
() => File.Delete(App.State.FileLocation)
|
||||
};
|
||||
|
@ -1,27 +1,28 @@
|
||||
using System.Reflection;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace Bloxstrap.Models.SettingTasks
|
||||
{
|
||||
public class ExtractIconsTask : BoolBaseTask
|
||||
{
|
||||
private string _path => Path.Combine(Paths.Base, Strings.Paths_Icons);
|
||||
|
||||
public ExtractIconsTask() : base("ExtractIcons")
|
||||
{
|
||||
OriginalState = Directory.Exists(Paths.Icons);
|
||||
OriginalState = Directory.Exists(_path);
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
if (NewState)
|
||||
{
|
||||
Directory.CreateDirectory(Paths.Icons);
|
||||
Directory.CreateDirectory(_path);
|
||||
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var resourceNames = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".ico"));
|
||||
|
||||
foreach (string name in resourceNames)
|
||||
{
|
||||
string path = Path.Combine(Paths.Icons, name.Replace("Bloxstrap.Resources.", ""));
|
||||
string path = Path.Combine(_path, name.Replace("Bloxstrap.Resources.", ""));
|
||||
var stream = assembly.GetManifestResourceStream(name)!;
|
||||
|
||||
using var memoryStream = new MemoryStream();
|
||||
@ -31,9 +32,9 @@ namespace Bloxstrap.Models.SettingTasks
|
||||
File.WriteAllBytes(path, memoryStream.ToArray());
|
||||
}
|
||||
}
|
||||
else if (Directory.Exists(Paths.Icons))
|
||||
else if (Directory.Exists(_path))
|
||||
{
|
||||
Directory.Delete(Paths.Icons, true);
|
||||
Directory.Delete(_path, true);
|
||||
}
|
||||
|
||||
OriginalState = NewState;
|
||||
|
@ -22,7 +22,6 @@
|
||||
public static string Integrations { get; private set; } = "";
|
||||
public static string Modifications { get; private set; } = "";
|
||||
public static string Roblox { get; private set; } = "";
|
||||
public static string Icons { get; private set; } = "";
|
||||
|
||||
public static string Application { get; private set; } = "";
|
||||
|
||||
@ -38,7 +37,6 @@
|
||||
Integrations = Path.Combine(Base, "Integrations");
|
||||
Modifications = Path.Combine(Base, "Modifications");
|
||||
Roblox = Path.Combine(Base, "Roblox");
|
||||
Icons = Path.Combine(Base, "Icons");
|
||||
|
||||
Application = Path.Combine(Base, $"{App.ProjectName}.exe");
|
||||
}
|
||||
|
9
Bloxstrap/Resources/Strings.Designer.cs
generated
9
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -3189,6 +3189,15 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Icons.
|
||||
/// </summary>
|
||||
public static string Paths_Icons {
|
||||
get {
|
||||
return ResourceManager.GetString("Paths.Icons", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to They'll be kept where Bloxstrap was installed, and will automatically be restored on a reinstall..
|
||||
/// </summary>
|
||||
|
@ -1230,4 +1230,8 @@ Would you like to enable test mode?</value>
|
||||
<value>Support us on Ko-fi!</value>
|
||||
<comment>Call-to-action button</comment>
|
||||
</data>
|
||||
<data name="Paths.Icons" xml:space="preserve">
|
||||
<value>Icons</value>
|
||||
<comment>Name of the folder that gets created according to the "create shortcut icons" option. Ensure that it is a valid folder name.</comment>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user