File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Flow.Launcher.Localization.SourceGenerators/Localize Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -620,19 +620,21 @@ private static void GenerateLocalizationMethod(
620
620
621
621
if ( isCoreAssembly )
622
622
{
623
+ var getTranslation = "InternationalizationManager.Instance.GetTranslation" ;
623
624
sb . AppendLine ( parameters . Count > 0
624
625
? ! ls . Format ?
625
- $ "string.Format(InternationalizationManager.Instance.GetTranslation (\" { ls . Key } \" ){ formatArgs } );"
626
- : $ "string.Format(System.Globalization.CultureInfo.CurrentCulture, InternationalizationManager.Instance.GetTranslation (\" { ls . Key } \" ){ formatArgs } );"
627
- : $ "InternationalizationManager.Instance.GetTranslation (\" { ls . Key } \" );") ;
626
+ $ "string.Format({ getTranslation } (\" { ls . Key } \" ){ formatArgs } );"
627
+ : $ "string.Format(System.Globalization.CultureInfo.CurrentCulture, { getTranslation } (\" { ls . Key } \" ){ formatArgs } );"
628
+ : $ "{ getTranslation } (\" { ls . Key } \" );") ;
628
629
}
629
630
else if ( pluginInfo ? . IsValid == true )
630
631
{
632
+ var getTranslation = $ "{ pluginInfo . ContextAccessor } .API.GetTranslation";
631
633
sb . AppendLine ( parameters . Count > 0
632
634
? ! ls . Format ?
633
- $ "string.Format({ pluginInfo . ContextAccessor } .API.GetTranslation (\" { ls . Key } \" ){ formatArgs } );"
634
- : $ "string.Format(System.Globalization.CultureInfo.CurrentCulture, { pluginInfo . ContextAccessor } .API.GetTranslation (\" { ls . Key } \" ){ formatArgs } );"
635
- : $ "{ pluginInfo . ContextAccessor } .API.GetTranslation (\" { ls . Key } \" );") ;
635
+ $ "string.Format({ getTranslation } (\" { ls . Key } \" ){ formatArgs } );"
636
+ : $ "string.Format(System.Globalization.CultureInfo.CurrentCulture, { getTranslation } (\" { ls . Key } \" ){ formatArgs } );"
637
+ : $ "{ getTranslation } (\" { ls . Key } \" );") ;
636
638
}
637
639
else
638
640
{
You can’t perform that action at this time.
0 commit comments