We are using ABP framework. How do I wire up localization resources (translations) from other source (e.g. database or some external API) rather than file.
In all examples it just shows how to add json file with resources.
options.Resources
.Add<MetadataResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/Metadata");
But how to wire up that all translations would be loaded from database?
Related
Any web application (for example asp.net/asp.net mvc) contains many *.dll, *.js, *.css, *.aspx, *.ascx, *.cshtml and other files.
We need to implement mechanism to control integrity of all these files to quickly analyze was modified any file or not after deploy.
So, we can on continuous integration server generate file with hashes of all files, put it into some dll of project as embedded resource, and sign dll via strong name. Then in every time we can check integrity of dll and validate hash of all files.
Is there a more simple solution? Or ready to use third party solution?
I'm working with Silverlight. In it, I've created a web project.
I always have created desktop application where I divide my projects in three modules:
Domain
Application
Presentation
But now, I'm working to the server side and I really have no much idea about how to build my architecture. In it, I plan to have a entity model for my database.
So, can you give some ideas about the modules how to structure?
I structure my Silverlight server-side libraries as follows:
MyApp.Host: The main hosting project for the silverlight application. Brings in fact nothing more than the aspx file housing the XAP and the ClientBin folder containing the XAP files. Additionally you can use a global.asax file to run a bootstrapper or any other components needed to startup your server-side application.
MyApp.Server.Services: This project contains all my domain services. The client side libraries have a RIA-Services link set to this project
MyApp.Server.Data: This project contains my Entities, and my data-access-layer, such as database contexts or repositories encapsulating the database access.
Note: This structure is for RIA-Services applications. When using other service types you might want to have a portable library called MyApp.Interfaces for accessing services and entities.
I have added a resource file in App_GlobalResources called FileList.resx.
Now I access the contents within the code by using
My.Resources.FileList.astro1 etc.
It works fine if I set the Build Action of resource file to Embedded. However in this case the resource file is not available after compile and I can't change it later.
If I set the Build Action to Content I get an error : Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "WAP.FileList.resources" was correctly embedded or linked into assembly "WAP" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Please advice me.
Are you using a Visual Studio Web Application? Or a Web Site?
In the latter case, you should be able to change the Resource file after deploying the site, and it should get automatically recompiled on the server. In the former case, it's a built-in that can't be changed after the site is compiled before deployment.
If that's a problem for you, there are of course alternatives to Resource files....
In any way of compiling and deploying your application all resource files will compiled in related to each resource file assemblies. In all cases, resource assemblies are ultimately created for each directory in the site, and satellite assemblies are generated beneath their respective culture-specific directories. Even when the site is JIT-compiled, the outcome is equivalent.
So, you must use Build Action of resource file to Embedded, but as possible solution for dynamic resource definition you can place you resources in a database. And even provide a Resource provider. In that case your database solution would have all the benefits that suggested by resource management aka dynamic culture definition, using resource binding to control, etc.
Here you can find some tutorials how to implement Resource-Provider Model in your application:
Extending the ASP.NET 2.0 Resource-Provider Model
Creating a Data Driven ASP.NET Localization
Resource Provider and Editor
We want to offer some file storage capability in our asp.net 3.5 web app and would like users to create web folders by mapping to a particular URL [hosted on our IIS]. this will allow users to simply copy files from their systems to the mapped web folder and save them the task of uploading files, etc. Any ideas on how we can implement a webshare capability on webserver would be really appreciated.
What about FTP (FTPS)? In FTP Publishing service (ISS7 Extension) you can write your own authentication provider based on .NET Membership, or you can use same provider, which you are using in you web application. You can also extend the built-in functionality of this sevice to customize it's functions.
If you want to make an user interface in asp.net site, you can use System.IO classes to manage files.
What's your opinion for the best possible way to build asp.net multilingual localized web application (only UI localization of string resources). Especially this two things:
How to store resources? Xml files, resx files or something else?
How to handle URL's? I don't want to keep language parameter in query string all the time so I need to use URL rewriting maybe?
/BR
Have you looked into the localization support in ASP.NET? It uses resource assemblies and sets the default resource based on the browser's settings. You can also override the setting by setting the culture and uiculture settings for the thread handling the request.
If you don't like using the resource assemblies (which do require a project rebuild when you want to make changes), you can also create a custom resource provider for ASP.NET (this link uses MS Access as an example, you can try to customize it for SQL or some other provider).
http://asp.net has some tutorials to get you started, like this one.
Use Data Driven ASP.NET Localization Resource Provider as described in http://www.west-wind.com/presentations/wwdbresourceprovider/