-
-
Notifications
You must be signed in to change notification settings - Fork 0
Support enum localization with EnumSourceGenerator & Support internal static PublicAPI instance with PublicApiSourceGenerator& Improve TabString performance #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b777fd3
Support enum localization
Jack251970 e65572e
Fix namespaces
Jack251970 fdbf20d
Add new attribution project
Jack251970 4e993c3
Include Flow.Launcher.Localization.Attributes project
Jack251970 f2bc91d
Add summary for classes, properties and methods
Jack251970 a47ce44
Fix root namespace
Jack251970 5a92b4b
Use global namespace
Jack251970 2baa32f
Move get valid plugin info to shared space
Jack251970 49c12b5
Support useDI & Fix api translation issue
Jack251970 b6d291a
Code quality
Jack251970 9836cff
Add assembly version for source generator project
Jack251970 13dfbb2
Change local variable name
Jack251970 81f4889
Use one Api
Jack251970 f79cbb9
Fix useDI issue
Jack251970 107e4ee
Fix code comments
Jack251970 1673504
Use one internal static api instance
Jack251970 965ede1
Slight adjust
Jack251970 6ecdbb8
Restore assembly version
Jack251970 c55d88d
Use string.IsNullOrWhiteSpace instead of null check or IsNullOrEmpty
Jack251970 23cf8f1
Improve tab string performance
Jack251970 903f22e
Remove \n for last string
Jack251970 d7a8a2b
Adjust enum full name style
Jack251970 169a4b5
Fix typos
Jack251970 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Flow.Launcher.Localization.Attributes/EnumLocalizeAttribute.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace Flow.Launcher.Localization.Attributes | ||
{ | ||
/// <summary> | ||
/// Attribute to mark an enum for localization. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Enum)] | ||
public class EnumLocalizeAttribute : Attribute | ||
{ | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Flow.Launcher.Localization.Attributes/EnumLocalizeKeyAttribute.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
namespace Flow.Launcher.Localization.Attributes | ||
{ | ||
/// <summary> | ||
/// Attribute to mark a localization key for an enum field. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Field)] | ||
public class EnumLocalizeKeyAttribute : Attribute | ||
{ | ||
public static readonly EnumLocalizeKeyAttribute Default = new EnumLocalizeKeyAttribute(); | ||
|
||
public EnumLocalizeKeyAttribute() : this(string.Empty) | ||
{ | ||
} | ||
|
||
public EnumLocalizeKeyAttribute(string enumLocalizeKey) | ||
{ | ||
EnumLocalizeKey = enumLocalizeKey; | ||
} | ||
|
||
public virtual string LocalizeKey => EnumLocalizeKey; | ||
|
||
protected string EnumLocalizeKey { get; set; } | ||
|
||
public override bool Equals(object obj) => | ||
obj is EnumLocalizeKeyAttribute other && other.LocalizeKey == LocalizeKey; | ||
|
||
public override int GetHashCode() => LocalizeKey?.GetHashCode() ?? 0; | ||
|
||
public override bool IsDefaultAttribute() => Equals(Default); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Flow.Launcher.Localization.Attributes/EnumLocalizeValueAttribute.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
namespace Flow.Launcher.Localization.Attributes | ||
{ | ||
/// <summary> | ||
/// Attribute to mark a localization value for an enum field. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Field)] | ||
public class EnumLocalizeValueAttribute : Attribute | ||
{ | ||
public static readonly EnumLocalizeValueAttribute Default = new EnumLocalizeValueAttribute(); | ||
|
||
public EnumLocalizeValueAttribute() : this(string.Empty) | ||
{ | ||
} | ||
|
||
public EnumLocalizeValueAttribute(string enumLocalizeValue) | ||
{ | ||
EnumLocalizeValue = enumLocalizeValue; | ||
} | ||
|
||
public virtual string LocalizeValue => EnumLocalizeValue; | ||
|
||
protected string EnumLocalizeValue { get; set; } | ||
|
||
public override bool Equals(object obj) => | ||
obj is EnumLocalizeValueAttribute other && other.LocalizeValue == LocalizeValue; | ||
|
||
public override int GetHashCode() => LocalizeValue?.GetHashCode() ?? 0; | ||
|
||
public override bool IsDefaultAttribute() => Equals(Default); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Flow.Launcher.Localization.Attributes/Flow.Launcher.Localization.Attributes.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<RootNamespace>Flow.Launcher.Localization.Attributes</RootNamespace> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.