Replies: 1 comment 2 replies
-
there is nothing specific with enumeration classes, and in a static context, you would just need to have a static catalog available public class Vegetable : Enumeration
{
// This will load translations from "./locale/<CurrentUICulture>/Example.mo"
private static ICatalog catalog = new Catalog("Example", "./locale");
public static Vegetable Cucumber = new(1, "Cucumber");
public static Vegetable BrownRice = new(2, catalog.GetString("Brown Rice"));
public Vegetable(int id, string name)
: base(id, name)
{
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I use enumeration classes instead of simple enums, like presented, e.g., here, how would I use
GetText.NET
to use translatable names. See the example below, the strings would need to be made translatable in a static context.So when I use
Console.Write(Vegetable.BrownRice)
somewhere in my app, I want to get a translation of "Brown Rice" in the current culture.Beta Was this translation helpful? Give feedback.
All reactions