File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
Flow.Launcher.Localization.Shared
Flow.Launcher.Localization.SourceGenerators/Localize Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ public static class Constants
2020 public const string OldLocalizationMethodName = "GetTranslation" ;
2121 public const string StringFormatMethodName = "Format" ;
2222 public const string StringFormatTypeName = "string" ;
23- public const string EnumLocalizeClassSuffix = "Data" ;
2423 public const string EnumLocalizeAttributeName = "EnumLocalizeAttribute" ;
2524 public const string EnumLocalizeKeyAttributeName = "EnumLocalizeKeyAttribute" ;
2625 public const string EnumLocalizeValueAttributeName = "EnumLocalizeValueAttribute" ;
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ private void GenerateSource(
174174 var enumFullName = enumSymbol . ToDisplayString ( new SymbolDisplayFormat (
175175 globalNamespaceStyle : SymbolDisplayGlobalNamespaceStyle . Omitted , // Remove global:: symbol
176176 typeQualificationStyle : SymbolDisplayTypeQualificationStyle . NameAndContainingTypesAndNamespaces ) ) ;
177- var enumDataClassName = $ "{ enumSymbol . Name } { Constants . EnumLocalizeClassSuffix } ";
177+ var enumDataClassName = $ "{ enumSymbol . Name } { Constants . ClassName } ";
178178 var enumName = enumSymbol . Name ;
179179 var enumNamespace = enumSymbol . ContainingNamespace . ToDisplayString ( ) ;
180180 var tabString = Helper . Spacing ( 1 ) ;
Original file line number Diff line number Diff line change @@ -91,11 +91,11 @@ public enum DemoEnum
9191}
9292```
9393
94- Then, use the generated DemoEnumData class within your view model to bind to a combo box:
94+ Then, use the generated ` DemoEnumLocalize ` class within your view model to bind to a combo box control :
9595
9696``` csharp
9797// ComboBox ItemSource
98- public List < DemoEnumData > AllDemoEnums { get ; } = DemoEnumData .GetValues ();
98+ public List < DemoEnumLocalize > AllDemoEnums { get ; } = DemoEnumLocalize .GetValues ();
9999
100100// ComboBox SelectedValue
101101public DemoEnum SelectedDemoEnum { get ; set ; }
@@ -114,5 +114,5 @@ In your XAML, bind as follows:
114114To update localization strings when the language changes, you can call:
115115
116116``` csharp
117- DemoEnumData .UpdateLabels (AllDemoEnums );
117+ DemoEnumLocalize .UpdateLabels (AllDemoEnums );
118118```
You can’t perform that action at this time.
0 commit comments