I wish to translate my entire application into a different language. I have added a separate global resource project, which contains the resource file, LocalizableResources.resx.
However i am stuck at the strings used within the javascripts, here is what i tried,
*var resourceDictionary = new ResourceReader(FILEPATH OR STREAM)
.Cast<DictionaryEntry>()
.Where(x=>x.Key.ToString().StartsWith("JS_"))
.ToDictionary(entry => entry.Key.ToString(), entry => entry.Value.ToString());
var json = Serializer.Serialize(resourceDictionary);*
with all the javascript strings starting with “JS_”.
The problem that i am facing is that i can’t get the FILEPATH/STREAM, since the resource file is present as a different project (not within Web Endpoints). If anyone could provide a different way of doing it, or point out the mistake in this method, it’ll be really helpful.
Thanks in advance.
Do you use any Javascript library like JQuery?
They have native feature or plugins for i18n.
About your code, you can use ResourceManager to retrieve all keys for your resources instead of directly access to resource files.