C# - File Or Database Localization?
Aug 4, 2010In ASP.NET which is better performance wise;
Localization using the file based resx / resource system
Localization by retrieving translations from a database
In ASP.NET which is better performance wise;
Localization using the file based resx / resource system
Localization by retrieving translations from a database
I been looking for hours on the web to find a good tutorial where I can do a database localization with mvc 2, I can't find any its all resource files. So I'm trying to reach out to you guys and see if you got any links, books or suggestions on this topic? I would love for it to be url routes based localization but that I can figure out somehow i think.
View 10 RepliesI have VS 2008 and 3.5 framework.I want to set up my application that I can store my content to database.I have lots of controls that from labels to images, datagrids, telerik controls, etc to keep in mind.I use SQL server 2005.
View 1 Repliesi have a project in which i want to write urdu text in textboxes and then save it to database.
View 3 Repliesi would like to Load a Lcalized CSS and i have a Masterpage
i am trying to do something like...
1. Get the Client Locale (which i do on the global.asax onSession_Start event)
2. get the right CSS file for this local (since my website supports both RTL and LTR layout)
the CSS should be i.e. webpage.en-US.css (or similar) if the Client Local is en-US and if its he-IL it should be webpage.he-IL.css.
We are migrating the VB6 applications into VB.NET (2008). They implemented the globalization in the Vb6 application by storing the english strings and corresponding langauage text (italian,spanish or french) in Database(SQL). Now we need to create a resource file in VB.NET(2008) for each language. Instead of creating resource file manually we want to write an application which will create resource file dynamically for each language and copy the english string and correspoding language text value from database into resource file.
SLNo Language English Value
1 English Name Name
2 Italian Name Nome
3 Spanish Name nombre
In my project i add a reference of one dll and it has some resource files(.resources). Also my project has some resource files with the same language name(Spanish, french and Germany). Also i think we can't add the two resource file for one language. Now how can i mangage both the resource files?
View 1 RepliesI am reading a CSV file created by Excel. the string I am reading needs to be encoded (it shows small boxes instead of hebrew characters) so I wrote a lil routine to convert the string -
Function encodeName(ByVal name As String) As String
Dim src As Encoding = Encoding.UTF8
Dim dest As Encoding = Encoding.Default
Dim srcBytes() As Byte
srcBytes = src.GetBytes(name)
Dim asciiBytes() As Byte = Encoding.Convert(src, dest, srcBytes)
Dim mychars(dest.GetCharCount(asciiBytes) - 1) As Char
dest.GetChars(asciiBytes, 0, asciiBytes.Length, mychars, 0)
Dim asciiString As New String(mychars)
End Function
From what I read FileStream.ReadLine reads the text with encoding UTF8 so I try to convert from UTF8 to Encoding.Default buy instead of little boxes I get question marks.
I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).
Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?
need to bind a resource file using system culture info. Say for example, if my system culture is Spanish(Spain) "es-ES" then i have to look for "es-ES" resource file to bind. If it is not there then i have to bind with default resource file ('en-US"). How to do this?
View 3 RepliesIn our web application we need to keep various company's settings. For eg "Shippingpickup","ZipCodeCaption","DefaultCountry","AllowToEditInvoice", etc
These settings are different for various companies and are placed in web.config as key-value pair.
Initially, we have tried do simplify this process by adding a company_settings table in the DB so as to allow us to add companies on the fly. However, this method makes it very difficult to add a new setting since it would require us to add a column to the company_settings table and thus would require code changes as well as stored procedure changes.
Now we have added separate global resource files for each company's settings. But, whenever we want to add new company to our website, we need to add a new resource file for that company. Adding a resource file requires compilation, and thus the application needs to be restarted. I was wondering if there is a way that we can add a new resource file dynamically at run-time.
Or are resource files not the right thing to use here? Is there a better method of tackling this issue?
I have addded some different languages into database table column(NText), then im retrieving the data and display it on the Dropdownlist and Gridview but some of the languages(like Korea, Japan) displays as boxes.
View 12 Repliesjust i am wondering is it possible to change the text of other than server controls
for example:
<table>
<tr>
<td>SOME TEXT</td>
</tr>
</table>
I want to change the SOME TEXT to its equivalent french text,
because in my project every data comes from database(even the static content)
i want to create a multi languages website with xml file
actually i saw the yaf use this method and i also want to use it in my website with some difrent
the xml file that use yaf look like this:
[Code]....
now i need to create a class that read the xml file and create some function that return the words like:
Language.Title() will return the Title word as string
I need to be able to change the resource file used by an ASP.Net Page based on some value other than Culture/Language/Region. The purpopse is to simply configure properties on the page based on a city or site name or other criteria. I do not want to change language or culture/region.
View 1 RepliesI have a flat file with text that has a special character like this: "RIBAŽ Generic Strip Labeling." so the registerd symbol is coming as square when i am simply reading the file in c#. is there a way to read the symbol as is and print on screen? i am working in on a console application. Also other german characters, not all but a few are showing as squares as well.
View 3 RepliesI have a CMS that allows an administrator to add/create pages for his website.
When a page is created a SiteMapNode is added to the web.sitemap file with the an url , title and resourceKey.
Now I wish to add a resourcekey to the appropriate web.sitemap.resx file(located in App_GlobalResources).
I have tried many different ways :
- using XMLDocument load/save => says I don't have access to write to that resource file
- ResourceReader says the source stream is not valid.
I'm developing two applications. One is server application and one more is client application and i'm implementing Localization in both the applications. I have used 7 language resource files in both the application. I need to add the reference of server application in my client application to access some global methods and all. After i'm adding the resource file in the application if i build the application it creates folder for each resource file with language culture code (Spanish -> es-ES, French -> fr-FR) under Bin directory.
Similarly if i add the reference of server application into client application then the resource file dll of server application will be added under corresponding langauge culture folder(es-ES,fr-FR) in the Bin directory. But i don't want to create any resource file dll for the application under Bin directory and aslo i need to put all the resource files inside the application only.
I need to access a resource file in a web application, using a WCF web service.The webservice will be hosted in the same domain as the web application, but its business logic is in another assembly.
How can I retrieve the correct resouce file (according to the current culture) from the business layer, and returning a List of KeyValue pair from it?
I have a web application project with a App_GlobalReousrces folder which contains a *.resx file that I would like to access (read) from a separate class library project.
What's the best way to deal with this one?
I am generating dynamic screens as user requests. Anybody having any idea on how would I try localizing text (localization) in xslt?
View 1 RepliesI'm trying to use resource files added to App_GlobalResources and geting the following error.
The framework is 4.0. The application uses DotNetNuke cms. Intellisense sees the properties in the WebApplicationResources class corresponding lines in WebApplicationResources.resx I cannot reproduce the error in the simple test website.
The exception text:
Server Error in '/dotnetnuke' Application. Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 40: get {
Line 41: if (object.ReferenceEquals(resourceMan, null)) {
Line 42: global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Resource1", global::System.Reflection.Assembly.Load("App_GlobalResources"));
Line 43: resourceMan = temp;
Line 44:
[code]...
I was wondering how guys did you manage this in your company or website, to let owner of the website, to update content of the website, when it's resx file compiled.What would be the best option to do that without requiring a developer intervention
View 4 RepliesI'm making changes to some xxx.resources files on our web server, everytime I try and copy the new file out to the server I keep getting the error:
'the process cannot access the file because it is being used by another process.'
I get this for about 20 minutes or so after I check the web site. Is there another way to update/copy the xxx.resources file on the web server without waiting 20 minutes or so to do so?
Saving resource file at runtime -Access denied error
View 2 Replies