In order to run these demos you need the following:
- ASP.NET 3.5 or later
- Sql Server 2008/2005 or Express, MSDE, SQL Server 2000
Database
The Sample database is provided as "DevSamples" and needs to be installed from installation root by executing the DevSamplesData_RunThis_ToInstallDb.exe. This package installs the database in Sql Server 2008/2005 or Express versions on your machine. The database contains a Localizations table which contains the localization resources for this sample application.
IMPORTANT!
The sample ships with the data base provider enabled. If for whatever reason your database connection does not work properly all resources will fail. Make sure the database connectivity works first or localization will not work. If you have problems with localization you can also turn off the resource provider in the web.config file and go back to the stock Resx Resources (comment the <globalization> section in the web.config). Once the localization admin form works you can re-enable the database resource provider.Configuration
The resource provider in the sample is configured to use the DevSamples database by default and it uses the localization data found there. The DbResource configuration section includes a connection string and tablename for the database which you can override if you're not using Sql Express.
Connection String
For the connection string in DbResourceProvider you can use either a full connection string or the name of a 'ConnectionStrings' entry in web.config. The easiest way to configure your database connection string is just to set up the DevSampleConnectionString Connection string. This connection string is used both by the samples as well as the provider by default.
Creating a new Localization Resource Table
Obviously you can store the globalization data in any database so you can point it at any connection string of your choice. Note that the Admin interface can automatically create a new Localization table for you. To do this set your connectionString to the database of your choice and set the resourceTableName to the name of your choice. Run the admin form (LocalizationAdmin/LocalizeForm.aspx) - and you should get a notice that the table can not be found. Click on Create Table on the toolbar on the left to create the new table. Note whatever account you connect
Resource Provider Configuration
In addition the wwDbResourceProvider section contains other settings to configure the provider's execution environment. You can find more information on these settings in the help file.
Enabling the Resource Provider
To use the wwDbresourceProvider or wwDbSimpleResourceProvider you need to also enable the resource provider in ASP.NET in the <globalization> section. This Web.config is configured to use the wwDbSimpleResourceProvider and you can check the commented sections to see how the providers are hooked up.
File Requirements to run the ResourceProvider and Admin Interface
The resource provider can import and export Resx resources. In order to export resources the application must have WRITE access in the application folder. This means the application user account (NETWORK SERVICE or ASPNET) typically must be set to have Read/Write or Full access in the application's folders. This is only required if you want to export to Resx resources.
Security
The provider related code can run in Medium trust. The administration form too can run in medium trust but the Translation features require that Google.com and Babelfish.com are accessible.
<trust level="Medium" originUrl="(http://www.google.com/translate_t)|(http://babelfish.yahoo.com/translate_txt)"/>