cloudscribe/cloudscribe.Web.Navigation

Child dropdowns are not localising

Closed this issue · 2 comments

Hi, I left a comment on Gitter asking for help, but after further investigation, I decided to formally raise an issue as I believe it's a bug and not an issue on my end. I've included most of my question in Gitter below for posterity.

The dropdown menu rendered by the Bs4ChildDropdown view for the Navigation component is not being localised using the MenuResources resx - all of the other navs rendered by cloudscribe.web.navigation components are! "User Info", "Change Password", "Two Factor Authentication" and "Personal Data" are not localising in this menu.
I've tried adding new nodes, which are then not being localised. I've also moved the nodes out from the 'Manage' node children collection, and they then localise correctly. It seems to only be the Bs4ChildDropdown view that's not working for me.

latest cloudscribe packages are installed.

After experiencing this bug, I created a brand new site with the latest cloudscribe template with the same result.

Steps to reproduce

  1. Create a new basic site (I went with no simplecontent and nodb)
  2. create a MenuResources.en-US.resx file
  3. populate the "User Info" entry with anything (except "User Info" ) and "Home" with anything (except "home")
  4. run the site
  5. login as admin and force the Culture settings to US for the default site

You will see that 'Home' is localised, but 'User Info' is not.

@JimKerslake has got back to me on this one and it's to do with a cloudscribe.web view overriding the cloudscribe.web.navigation view. The cloudscribe view does not support localisation - hence it's just displaying the raw nav node text.

I overrode the cloudscribe view with a view that injects the localiser and it's now working as expected.

There's an argument that any such overriding views elsewhere in cloudscribe should also make use of the localizer, and that users/developers should not need to implement their own view overrides for this purpose. I could take a look and see whether that's possible (or perhaps the localizer was omitted from that view for a valid reason that I don't know about yet).