Replies: 4 comments 13 replies
-
I´d love to get a deeper dive into that topic. To further assist in a possible adoption, would you be so kind and provide details about what you´d expect from |
Beta Was this translation helpful? Give feedback.
-
These are two sample projects that use |
Beta Was this translation helpful? Give feedback.
-
Ok, these samples seem to be a good foundation to gather more insights of what schould be done. Are the provided When we feed a
the following class(es) should be generated: class ExtensionBase {
protected readonly Localize;
public ExtensionBase (IStringLocalizer localize) {
Localize = localize;
}
}
class Greet_LoverExtensions : ExtensionBase {
internal Greet_LoverExtensions (IStringLocalizer localize) : base (localize) {}
public LocalizedString Hello() => Localize["Hello"]; // returns "Howdy friend"
}
class Greet_FriendExtensions : ExtensionBase {
internal Greet_FriendExtensions (IStringLocalizer localize) : base (localize) {}
public LocalizedString Hello() => Localize["Hello"]; // returns "Howdy my darling"
}
class Greet_SomebodyExtensions : ExtensionBase {
internal Greet_SomebodyExtensions (IStringLocalizer localize) : base (localize) {}
public LocalizedString Hello(string name) => Localize["Hello {name:s}", name]; // returns "Hello <name>"
}
class PortableObjectExtensions : ExtensionBase{
internal PortableObjectExtensions (IStringLocalizer localize) : base (localize) {
Greet_Friend = new(localize);
Greet_Lover = new(localize);
Greet_Somebody = new(localize);
}
LocalizedString Hello() => Localize["Hello"]; // returns "Howdy"
internal Greet_LoverExtensions Greet_Friend { get; }
internal Greet_FriendExtensions Greet_Lover { get; }
internal Greet_SomebodyExtensions Greet_Somebody { get; }
} Then consumers would just need to instantiate the outer-type once and re-use it e.g. via Dependency-Injection. Should this work? Or is an instance of Where does From https://github.com/OrchardSkills/OrchardSkills.OrchardCore.Localization/blob/main/LocalizationTheme/Localization/fr-FR.po there seem to be a complete other usage, where |
Beta Was this translation helpful? Give feedback.
-
Even https://github.com/OrchardSkills/OrchardSkills.OrchardCore.Localization/tree/main/OrchardSkills.OrchardCore.CMS/Localization/it looks like there is tooling around generation of those files. Looks like there are even references to usages of the respective |
Beta Was this translation helpful? Give feedback.
-
Please combine this with Portable Object support (https://www.nuget.org/packages/OrchardCore.Localization/). It is so much nicer than RESX.
Beta Was this translation helpful? Give feedback.
All reactions