RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
544 stars 135 forks source link

Path Name not in resource set #214

Open bencurthoys opened 3 years ago

bencurthoys commented 3 years ago

I'm picking up trying to make localization work on a project where I was using localization some years ago, but then the specific customer that wanted a different language went away, so I forgot about it for ages, but now the requirement is back.

When I Import resources from my existing ResX files, they are created in the database with just the filename as the resource set name:

image

(the full filename here is c:\sourcecode\monad\code\ui\sales\checkout\App_LocalResources\Delivery.aspx.resx and it's just extracting "Delivery.aspx" as the resource name)

But at runtime, when it's trying to find a resource in the database, the relative path IS being used in the resource set name:

image

which means that there's no match.

Am I doing something wrong here? It seems like it shouldn't be possible to configure it to work one way in one place and a different way in another.

bencurthoys commented 3 years ago

In ImportDirectoryResources you set the resName to include the relative path, but then you throw that away whilst rebuilding it out of tokens:

image

I'm going to change resName = "" to resName = relativePath

on that line and see if that makes it behave as I would expect.