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(
620620
621621 if ( isCoreAssembly )
622622 {
623+ var getTranslation = "InternationalizationManager.Instance.GetTranslation" ;
623624 sb . AppendLine ( parameters . Count > 0
624625 ? ! 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 } \" );") ;
628629 }
629630 else if ( pluginInfo ? . IsValid == true )
630631 {
632+ var getTranslation = $ "{ pluginInfo . ContextAccessor } .API.GetTranslation";
631633 sb . AppendLine ( parameters . Count > 0
632634 ? ! 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 } \" );") ;
636638 }
637639 else
638640 {
You can’t perform that action at this time.
0 commit comments