Localization CMS - Admin functionality to edit the localization files for Content Editors?

StackOverflow https://stackoverflow.com/questions/409791

  •  03-07-2019
  •  | 
  •  

Question

Are there solutions/tutorials/open source solutions to providing the functionality of having Content Editors edit ASP.net Localization files?

For example,

With Labels.resx and Labels.fr.resx, it would be great if theres an editor out there that allows End Users to end the content of the file.

Was it helpful?

Solution

I would suggest a database solution with caching. I found this article which might help. It has a complete provider along with a very good write up.

Creating a Data Driven ASP.NET Localization Resource Provider and Editor

http://www.west-wind.com/presentations/wwDbResourceProvider/

ASP.NET 2.0 introduces a provider model for creating custom Resource Providers that can store localization data in stores other than Resx files. Resx resources are all fine and good but putting data in a more flexible resource store gives you many more options for editing and administering resources interactively and even at runtime. In this article I'll demonstrate how to create a new Resource Provider that stores resource information in a database and show a resource editing tool that makes it much easier to edit resources interactively in the context of your live ASP.NET applications.

Particular bit to note:

Resx Resources are also static – they are after all compiled into an assembly. If you want to make changes to resources you will need to recompile to see those changes. ASP.NET 2.0 introduces Global and Local Resources which can be stored on the server and can be updated dynamically – the ASP.NET compiler can actually compile them at runtime. However, if you use a precompiled Web deployment model the resources still end up being static and cannot be changed at runtime. So once you’re done with compilation the resources are fixed.

OTHER TIPS

I just wrote an application like that because I could not find a free soft that does resx editing:

  • Reads the content of all the resx files from a folder
  • Displays the values from different cultures but same resx besides each other
  • Generates/saves the resx files back

You might consider using structured XML files. Seems like this would be a more elegant solution than hacking .resx files to work in an unconventional way. You could use a LINQ query to get to the XML in a strongly typed manner similar to the resx file. Additionally, XML files could be edited by the user through the presentation layer since they aren't compiled into the application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top