Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to access resources using JavascriptLocalizationResources api endpoint in production #200

Open
lvmajor opened this issue Aug 12, 2020 · 1 comment

Comments

@lvmajor
Copy link

lvmajor commented Aug 12, 2020

Hi there,

I'd like to know if it's possible to use the JavascriptLocalizationResources api endpoint when using the library with Resx as the resource access mode. I am unable to make it work as there is an error when trying to fetch resources in a "Resources" folder, which exists in the development environment, but not in production as the resources get bundled in /fr/.resources.dll, same goes for the other supported languages when deployed to production environment.

This makes it crash when trying to acess the "Resources" folder which does not exist... Any ideas?

Package version: 3.1.0-preview1 from Nuget (https://www.nuget.org/packages/Westwind.Globalization/3.1.0-preview1)
Environment: Asp.Net Core 3.1
Url used to access resources: /api/JavaScriptLocalizationResources?ResourceSet=SharedResources&VarName=sharedResources&[email protected]().TwoLetterISOLanguageName
Resource mode: Resx

Thanks in advance!

@lvmajor
Copy link
Author

lvmajor commented Aug 12, 2020

Ok I'm trying to find the problem and as I can see as of now, it seems to not support embedded resources as it first tries to get the type from the resourceSetName which fails, and then it tries to get the resources from the resource file, which does not exist in production environment as the resources are embedded per official asp.net core documentation

A potential solution would be to publish the actual .resx files, but it would go against the requirements from asp.net core.... Would there be a way to do similar to string localizer and get the resources from the dll?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant