diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Ui.LocaleGenerator | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Ui.LocaleGenerator')
| -rw-r--r-- | Ryujinx.Ui.LocaleGenerator/LocaleGenerator.cs | 30 | ||||
| -rw-r--r-- | Ryujinx.Ui.LocaleGenerator/Ryujinx.Ui.LocaleGenerator.csproj | 18 |
2 files changed, 0 insertions, 48 deletions
diff --git a/Ryujinx.Ui.LocaleGenerator/LocaleGenerator.cs b/Ryujinx.Ui.LocaleGenerator/LocaleGenerator.cs deleted file mode 100644 index f154e704..00000000 --- a/Ryujinx.Ui.LocaleGenerator/LocaleGenerator.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.CodeAnalysis; -using System.Linq; - -namespace Ryujinx.Ui.LocaleGenerator -{ - [Generator] - public class LocaleGenerator : IIncrementalGenerator - { - public void Initialize(IncrementalGeneratorInitializationContext context) - { - var englishLocaleFile = context.AdditionalTextsProvider.Where(static x => x.Path.EndsWith("en_US.json")); - - IncrementalValuesProvider<string> contents = englishLocaleFile.Select((text, cancellationToken) => text.GetText(cancellationToken)!.ToString()); - - context.RegisterSourceOutput(contents, (spc, content) => - { - var lines = content.Split('\n').Where(x => x.Trim().StartsWith("\"")).Select(x => x.Split(':').First().Trim().Replace("\"", "")); - string enumSource = "namespace Ryujinx.Ava.Common.Locale;\n"; - enumSource += "internal enum LocaleKeys\n{\n"; - foreach (var line in lines) - { - enumSource += $" {line},\n"; - } - enumSource += "}\n"; - - spc.AddSource("LocaleKeys", enumSource); - }); - } - } -} diff --git a/Ryujinx.Ui.LocaleGenerator/Ryujinx.Ui.LocaleGenerator.csproj b/Ryujinx.Ui.LocaleGenerator/Ryujinx.Ui.LocaleGenerator.csproj deleted file mode 100644 index 05cbc764..00000000 --- a/Ryujinx.Ui.LocaleGenerator/Ryujinx.Ui.LocaleGenerator.csproj +++ /dev/null @@ -1,18 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <TargetFramework>netstandard2.0</TargetFramework> - <Nullable>enable</Nullable> - <LangVersion>latest</LangVersion> - <EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules> - </PropertyGroup> - - <ItemGroup> - <PackageReference Include="Microsoft.CodeAnalysis.Analyzers"> - <PrivateAssets>all</PrivateAssets> - <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> - </PackageReference> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp" /> - </ItemGroup> - -</Project> |
