Base solution for your next web application
Open Closed

NavigationProvider without LocalizableString #365


User avatar
0
cicciottino created

is it possible to pass a normal string istead of a LocalizableString into the "DisplayName" parameter of the (MenuItemDefinition)NavigationProvider? if not, is there a sort of workaround?

public override void SetNavigation(INavigationProviderContext context)
{
context.Manager.MainMenu
                .AddItem(
                    new MenuItemDefinition(
                        "Home",
                        new LocalizableString("HomePage", AbpZeroSampleConsts.LocalizationSourceName),
                        url: "#/",
                        icon: "fa fa-home"
                        )
                ).AddItem(
                    new MenuItemDefinition(
                        "About",
                        new LocalizableString("PoisList", AbpZeroSampleConsts.LocalizationSourceName),  //using a normal string instead of LocalizationString
                        url: "#/About",
                        icon: "fa fa-info"
                        );
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    gvb created

    Use FixedLocalizableString with the string you want to display inside the FixedLocalizableString.

    It wont be localized and the display will be the exact same string as you wrote in the class.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    cicciottino created

    thanks a lot, i didn't know the existance of this class!

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)