-
-
Notifications
You must be signed in to change notification settings - Fork 0
Improve Enum Localize Class Name & Add Useful Links and Documents #34
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
📝 WalkthroughWalkthroughThe changes introduce documentation updates and a minor code alteration. The Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Main as Plugin Main Class
participant API as IPublicAPI / DI
participant Loc as Localize Utility
participant UI as User Interface
Dev->>Main: Initialize Plugin
alt Dependency Injection enabled
Main->>API: Retrieve API instance via DI
else Dependency Injection disabled
Main->>Main: Use static PluginInitContext
end
Main->>Loc: Request localized string
Loc-->>Main: Return localized data
Main->>UI: Update UI elements with localization
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (14)
README.md (1)
1-9
: New Documentation Section Looks Good.
The new “Useful links” section is clear and helpful. Please verify that the URLs are correct and consider making the “Useful links:” line a header (e.g., using## Useful links
) to visually emphasize this section.localization-toolkit.md (13)
1-1
: Improve Intro Sentence for Clarity.
Consider rephrasing the opening sentence to include the appropriate article for smoother reading. For example:“The localization toolkit is for Flow C# plugin developers to improve their localization experience.”
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1-~1: You might be missing the article “the” here.
Context: Localization toolkit is for Flow C# plugin developer...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
5-5
: Clarify NuGet Package Installation.
Please update the package URL to include the protocol (e.g.,https://www.nuget.org/packages/Flow.Launcher.Localization
) and consider rephrasing “by Nuget” to “using NuGet” for clarity.
11-11
: Clarify Dependency Injection Description.
Rephrase the sentence to: “Specifies whether to use dependency injection to obtain theIPublicAPI
instance. Defaults to false.”
12-12
: Refine PluginInitContext Requirement.
Consider rewording to clarify that theMain
class must declare a[PluginInitContext]
property asinternal static
when dependency injection is disabled.
14-14
: Enhance Dependency Injection Alternative.
Rephrase this sentence to something like:“If set to
true
, theIPublicAPI
instance can be accessed viaPublicApi.Instance
using dependency injection.”
15-15
: Improve Transition Wording.
Consider replacing “And” with “Additionally,” to improve the flow of the text.
16-16
: Clarify Compatibility Warning.
It might read better as:“Not recommended for plugin projects, as it restricts compatibility to Flow 1.20.0 or higher.”
25-33
: Add Language Identifier to Code Fences.
For the code sample showing theMain
class example, please add a language specifier (e.g., ```csharp) to enhance syntax highlighting.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
25-25: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
37-39
: Vary Sentence Beginnings.
To improve readability, consider rephrasing the consecutive sentences that start similarly. For example, avoid beginning successive sentences with “With this toolkit, we can…” or “And we can also…”🧰 Tools
🪛 LanguageTool
[style] ~39-~39: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...string.Empty, null, string.Empty)with
Localize.flowlauncher_plugin_localization_demo_plugin_used(string.Empty, null, string.Empty)`. ### Localized e...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
46-46
: Specify Language for Enum Example Code Block.
Please add a language specifier (e.g., ```csharp) to the fenced code block that illustrates the enum example.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
46-46: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
69-72
: Specify Language for ViewModel Code Block.
For the code snippet displaying the view model fields, add a language identifier (e.g., ```csharp) to improve syntax highlighting.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
69-69: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
75-80
: Annotate XAML Code Block with Language.
For the XAML example, add a language specifier such as ```xml to the fenced code block.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
75-75: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
83-90
: Annotate Code Block for Localization Update Example.
Please add a language specifier (e.g., ```csharp) to the fenced code block showing theUpdateEnumDropdownLocalizations
method for better clarity.🧰 Tools
🪛 LanguageTool
[style] ~83-~83: Consider using a more polite wording.
Context: ...electedValuePath="Value" /> ``` If you want to update localization strings when cul...(IF_YOU_WANT)
🪛 markdownlint-cli2 (0.17.2)
85-85: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
README.md
(1 hunks)localization-toolkit.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
localization-toolkit.md
[uncategorized] ~1-~1: You might be missing the article “the” here.
Context: Localization toolkit is for Flow C# plugin developer...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[style] ~39-~39: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...string.Empty, null, string.Empty)with
Localize.flowlauncher_plugin_localization_demo_plugin_used(string.Empty, null, string.Empty)`. ### Localized e...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[grammar] ~44-~44: Normally, after “want to” a verb is expected.
Context: ... fields in this EnumType
, if you want to specific one localization key for this field, yo...
(WANT_TO_NN)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ...ization key for this field, you can use EnumLocalizeKey
attribute; or if you wa...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~44-~44: Normally, after “want to” a verb is expected.
Context: ...mLocalizeKey` attribute; or if you want to specific one constant value for this field, you ...
(WANT_TO_NN)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ...stant value for this field, you can use EnumLocalizeValue
attribute. ``` [Enum...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~67-~67: You might be missing the article “the” here.
Context: ...n you can get DemoEnumData
class. In view model class which needs to display it o...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[style] ~83-~83: Consider using a more polite wording.
Context: ...electedValuePath="Value" /> ``` If you want to update localization strings when cul...
(IF_YOU_WANT)
🪛 markdownlint-cli2 (0.17.2)
localization-toolkit.md
25-25: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
46-46: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
69-69: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
75-75: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
85-85: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: gitStream.cm
🔇 Additional comments (1)
localization-toolkit.md (1)
43-44
: Refine Enum Localization Explanation.
Reword the description for clarity and grammatical correctness. For example:“If you have enum types like
DemoEnum
that require localization for display in a combo box control, you can add theEnumLocalize
attribute to enable localization support. For each field in the enum, if you want to specify a localization key, use theEnumLocalizeKey
attribute; or, if you want to specify a constant value, use theEnumLocalizeValue
attribute.”🧰 Tools
🪛 LanguageTool
[grammar] ~44-~44: Normally, after “want to” a verb is expected.
Context: ... fields in thisEnumType
, if you want to specific one localization key for this field, yo...(WANT_TO_NN)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ...ization key for this field, you can useEnumLocalizeKey
attribute; or if you wa...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~44-~44: Normally, after “want to” a verb is expected.
Context: ...mLocalizeKey` attribute; or if you want to specific one constant value for this field, you ...(WANT_TO_NN)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ...stant value for this field, you can useEnumLocalizeValue
attribute. ``` [Enum...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
localization-toolkit.md (2)
3-6
: Improve NuGet Link URL:
The link to Flow.Launcher.Localization is missing the protocol. To ensure the link works correctly across all markdown renderers, update it to include "https://".-For C# plugins, install and reference [Flow.Launcher.Localization](www.nuget.org/packages/Flow.Launcher.Localization) via NuGet. +For C# plugins, install and reference [Flow.Launcher.Localization](https://www.nuget.org/packages/Flow.Launcher.Localization) via NuGet.
17-24
: Clarify Dependency Injection Recommendation:
The details regardingFLLUseDependencyInjection
are well explained. As a minor nitpick, consider rephrasing the note on line 23 for conciseness. For example, instead of "at the moment since it limits compatibility to Flow Launcher 1.20.0 or later," you might use "currently, as it limits compatibility to Flow Launcher 1.20.0 or later."- (Note: This approach is not recommended for plugin projects at the moment since it limits compatibility to Flow Launcher 1.20.0 or later.) + (Note: Currently not recommended as it limits compatibility to Flow Launcher 1.20.0 or later.)🧰 Tools
🪛 LanguageTool
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...(AT_THE_MOMENT)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
README.md
(1 hunks)localization-toolkit.md
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🧰 Additional context used
🪛 LanguageTool
localization-toolkit.md
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...
(AT_THE_MOMENT)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (10)
localization-toolkit.md (10)
1-2
: Introduction Clarity:
The introductory lines clearly establish the purpose of the document for Flow Launcher C# plugin developers and set a positive tone for the guide.
7-16
: Build Properties Section Looks Good:
The instructions for configuring build properties and the XML code snippet are clear, well-structured, and easy to follow.
25-31
: Main Class Usage Documentation is Clear:
The guidance for implementing the Main class—including the implementation ofIPluginI18n
and the inclusion of thePluginInitContext
property—is clear and supported by a concise C# example.
42-52
: Localized Strings Simplification is Well Explained:
The conversion from a verbose API call to a simplifiedLocalize
method is clearly illustrated with before-and-after code examples, which should greatly aid developers in refactoring their code.
53-61
: Simplified Code for Strings with Variables:
The example demonstrating how to replace astring.Format
call with aLocalize
method that accepts variables is straightforward and effectively highlights the benefits of the new approach.
62-67
: Localized Enums Explanation is Informative:
The section on usingEnumLocalize
,EnumLocalizeKey
, andEnumLocalizeValue
is concise and sets a clear foundation for the code examples that follow.
68-92
: Localized Enums Code Example is Robust:
The code snippet for localizing enums is detailed and demonstrates different scenarios (e.g., specifying only a key, only a value, and both). This comprehensive example should be very helpful for developers implementing enum localization.
94-102
: DemoEnumData Usage is Clear:
The code snippet showing how to use the generatedDemoEnumData
class for data binding in a view model is concise and instructive, making it easy for developers to integrate localization with UI components.
104-112
: XAML Binding Example is Well-Structured:
The XAML snippet clearly demonstrates how to bind a ComboBox to localized enum data, ensuring that developers can readily apply these techniques in their applications.
113-119
: Guidance on Updating Localization is Useful:
The final snippet, which shows how to update localization strings when the language changes, is a practical addition to help maintain UI consistency.
I rephrased the documentation, let me know what you think. I'd also like to fix these warnings (if possible) before publishing the documentation. Whenever you think that everything's ready to be published in the documentation on the website, let me know, and I'll publish it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
Flow.Launcher.Localization.SourceGenerators/Localize/EnumSourceGenerator.cs (1)
177-177
: Update of enum data class naming convention.The class name construction has been changed from using
Constants.EnumLocalizeClassSuffix
(which was likely "Data") toConstants.ClassName
(which is "Localize"). This changes the generated class names from{EnumName}Data
to{EnumName}Localize
.This change ensures consistency with the removal of the
EnumLocalizeClassSuffix
constant, but be aware that it might break existing code that references these generated classes with the old naming convention. Since this is a source generator, the impact would be at compile-time rather than runtime.localization-toolkit.md (2)
3-5
: Enhance the hyperlink for clarity
Consider adding thehttps://
protocol to the NuGet package URL so it becomes a clickable link. For example:-[Flow.Launcher.Localization](www.nuget.org/packages/Flow.Launcher.Localization) +[Flow.Launcher.Localization](https://www.nuget.org/packages/Flow.Launcher.Localization)
17-24
: Refine phrasing in dependency injection note
The explanation for configuring dependency injection is clear. For conciseness, consider replacing "at the moment" with "currently" in the note. For example:- (Note: This approach is not recommended for plugin projects at the moment since it limits compatibility to Flow Launcher 1.20.0 or later.) + (Note: This approach is currently not recommended for plugin projects since it limits compatibility to Flow Launcher 1.20.0 or later.)🧰 Tools
🪛 LanguageTool
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...(AT_THE_MOMENT)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Flow.Launcher.Localization.Shared/Constants.cs
(0 hunks)Flow.Launcher.Localization.SourceGenerators/Localize/EnumSourceGenerator.cs
(1 hunks)localization-toolkit.md
(1 hunks)
💤 Files with no reviewable changes (1)
- Flow.Launcher.Localization.Shared/Constants.cs
🧰 Additional context used
🧬 Code Definitions (1)
Flow.Launcher.Localization.SourceGenerators/Localize/EnumSourceGenerator.cs (1)
Flow.Launcher.Localization.Shared/Constants.cs (1)
Constants
(5-33)
🪛 LanguageTool
localization-toolkit.md
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...
(AT_THE_MOMENT)
🔇 Additional comments (10)
localization-toolkit.md (10)
1-2
: Introduction is clear and concise
The introductory sentence succinctly explains the purpose of the Localization Toolkit and is easy to understand.
7-10
: Build Properties section is well-structured
The "Build Properties" section clearly explains how to configure.csproj
properties for localization.
11-15
: XML snippet for setting dependency injection property is correct
The provided XML code block clearly demonstrates how to configure theFLLUseDependencyInjection
property.
25-33
: Main Class usage guidelines are clearly defined
The instructions and corresponding code snippet for implementing the Main class (including the requirement for aPluginInitContext
when dependency injection is disabled) are well presented.
42-52
: Localized Strings guidance is effective
The documentation clearly shows how to replace traditional API calls with the conciseLocalize
method, enhancing readability and maintenance.
53-60
: Simplified handling of localization strings with variables
The transformation from usingstring.Format
withContext.API.GetTranslation
to a directLocalize
method call is well illustrated and improves clarity.
62-92
: Comprehensive explanation for localized enums
The section on localized enums, including usage of theEnumLocalize
,EnumLocalizeKey
, andEnumLocalizeValue
attributes, is comprehensive and includes clear, illustrative examples.
94-102
: ViewModel binding instructions for enums are clear
The code snippet demonstrating how to bind localized enum values in a view model is straightforward and easy to follow.
104-112
: XAML binding example is well-structured
The XAML snippet effectively shows how to bind combo box properties, ensuring that developers have a clear template for their UI integration.
114-118
: Dynamic localization update example is useful
The final snippet demonstrating how to update localization strings when the language changes is concise and practical.
That's good! I fill useful links with this url: https://www.flowlauncher.com/docs/#/localization-toolkit. If you have publish documents on other urls, please do not forget to change them. For those warnings RS1038, I cannot find any methods to fix them since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
Flow.Launcher.Localization.SourceGenerators/Localize/EnumSourceGenerator.cs:177
- Ensure that Constants.ClassName is properly defined with the intended suffix (likely 'Localize') and that its usage is consistent with the new naming convention throughout the codebase.
var enumDataClassName = "$ {enumSymbol.Name}{Constants.ClassName}";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
localization-toolkit.md (2)
3-5
: Improve NuGet Package URL.
In line 5, the URL provided for the NuGet package is missing the protocol. Consider updating it tohttps://www.nuget.org/packages/Flow.Launcher.Localization
to ensure the link works as expected.
17-23
: Clarify Dependency Injection Recommendation.
The note in line 23 regarding the use of dependency injection would benefit from being more concise. For example, you might consider:-(Note: This approach is not recommended for plugin projects at the moment since it limits compatibility to Flow Launcher 1.20.0 or later.) +(Note: This approach is currently discouraged as it limits compatibility to Flow Launcher 1.20.0+.)🧰 Tools
🪛 LanguageTool
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...(AT_THE_MOMENT)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
localization-toolkit.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
localization-toolkit.md
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...
(AT_THE_MOMENT)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (12)
localization-toolkit.md (12)
1-1
: Introduction is clear.
The opening sentence succinctly introduces the Localization Toolkit and its purpose for Flow Launcher C# plugin developers.
7-9
: Build Properties Section is Informative.
The description in the "## Build Properties" section clearly explains how to configure properties in the.csproj
file.
10-15
: XML Snippet Clarity.
The XML snippet provided (lines 11–15) is well-formatted and clearly demonstrates how to set theFLLUseDependencyInjection
property.
25-31
: Usage Section is Clear.
The "## Usage" section, including the explanation on how to include a [PluginInitContext], is straightforward and helpful for developers.
33-40
: Main Class Example is Well-Presented.
The C# code snippet (lines 33–40) effectively illustrates how to implement theIPluginI18n
interface and set up the PluginInitContext property.
42-51
: Localized Strings Instruction is Concise.
The section showing how to simplify localization calls (lines 42–51) is clear and demonstrates the benefit of using theLocalize
class over traditional API calls.
53-60
: Handling Localization with Variables is Clear.
The transformation from usingstring.Format
to directly callingLocalize
methods (lines 53–60) is well-documented and simplifies the localization process.
62-67
: Localized Enums Guidelines are Clear.
The instructions for using theEnumLocalize
attribute (lines 62–67) are concise and provide essential details for developers to follow.
68-92
: Comprehensive Enum Localization Example.
The provided C# snippet (lines 68–92) comprehensively demonstrates how to applyEnumLocalizeKey
andEnumLocalizeValue
attributes. The inline comments further aid in understanding the intended usage.
94-102
: ViewModel Binding Example is Well-Illustrated.
The example showing how to bind the generatedDemoEnumLocalize
class to a combo box (lines 94–102) is clear and provides practical guidance for UI integration.
104-112
: XAML Binding Demonstration is Correct.
The XAML snippet (lines 104–112) correctly demonstrates the binding of localized enums to a ComboBox, clearly outlining properties likeDisplayMemberPath
,ItemsSource
,SelectedValue
, andSelectedValuePath
.
114-118
: Localization Update Guidance is Effective.
The final code snippet (lines 114–118) clearly explains how to update localization strings when the language changes, ensuring that the UI remains in sync with the selected language.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
localization-toolkit.md (3)
5-5
: URL Protocol for Package LinkThe link to Flow.Launcher.Localization is missing the protocol. It is recommended to update the URL to include
https://
for proper linking, for example:
https://www.nuget.org/packages/Flow.Launcher.Localization
20-24
: Rephrase Compatibility NoteThe note on dependency injection currently reads:
(Note: This approach is not recommended for plugin projects at the moment since it limits compatibility to Flow Launcher 1.20.0 or later.)
For conciseness and clarity, consider rephrasing it to:
(Note: This approach is currently not recommended for plugin projects as it limits compatibility to Flow Launcher 1.20.0 or later.)
This change improves readability by using an adverb for brevity.🧰 Tools
🪛 LanguageTool
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...(AT_THE_MOMENT)
87-88
: Improve Inline Comment ReadabilityThe inline comment on lines 87–88 is lengthy. Consider breaking it into two separate sentences or bullet points for improved readability. For example:
- // Using the Localize class. This way, you can't misspell localization keys, and if you rename - // them in your .xaml file, you won't forget to rename them here as well because the build will fail. + // Using the Localize class ensures that localization keys are spelled correctly. + // Renaming keys in the .xaml file will trigger build failures if they are not updated here.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Flow.Launcher.Localization.Shared/Constants.cs
(1 hunks)localization-toolkit.md
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Flow.Launcher.Localization.Shared/Constants.cs
🧰 Additional context used
🪛 LanguageTool
localization-toolkit.md
[style] ~23-~23: For conciseness, consider replacing this expression with an adverb.
Context: ... is not recommended for plugin projects at the moment since it limits compatibility to Flow L...
(AT_THE_MOMENT)
🔇 Additional comments (8)
localization-toolkit.md (8)
1-2
: Introduction ClarityThe introductory sentence clearly explains the purpose of the Localization Toolkit.
33-40
: Main Class Code SampleThe provided code sample for the Main class clearly demonstrates the requirement to implement
IPluginI18n
and include an internal staticPluginInitContext
.
44-51
: Localized Strings SimplificationThe transition from using
Context.API.GetTranslation(...)
to the simplifiedLocalize
call is well demonstrated.
54-60
: Variable Localization ExampleThe before-and-after examples for handling localization strings with variables are clear and concise.
62-67
: Localized Enums IntroductionThe explanation on how to enable localization for enum types using
EnumLocalizeKey
andEnumLocalizeValue
is informative and well-presented.
94-102
: Consistency of Generated Class NameThe documentation instructs to use the generated
DemoEnumLocalized
class for binding. Please verify that this name matches the intended renaming (fromEnumDemoData
toEnumDemoLocalize
) as outlined in the PR objectives. Consistency between the documentation and the actual generated class name is essential.
104-112
: XAML Binding SampleThe XAML example for binding the combo box is clear and correctly formatted.
114-118
: Updating Localization StringsThe code example demonstrating how to update localization strings when the language changes is concise and clear.
Improve Enum Localize Class Name
Change Enum generated class name from
EnumDemoData
toEnumDemoLocalize
.Add Useful Links and Documents
I am not sure if I should add documents here or I need to add documents in other places.
For me, I think we should add documents into Flow Launcher official documents but I do not know how to do that so I create a PR here for your reference.