I want to create a website in ASP.NET which handles multiple languages. My content is in three languages: Roman, Urdu and English.The content will be dynamic.
For example, if a user visits my website and he searches on website for a specific post. Then the user wants to change the language preference, its content will change dynamically as a user selects different language from menu. Then he searches for another post and wants to change language preference to some other language, the content must be translated again into the newly selected language.
I can afford to insert separate data for each of the language in database but i am not sure if this works and how this works (how to create db design for such solution and how to store and retrieve same data in multiple languages in db).
I have been looking at some threads on different platforms but the solutions I have come across with are not feasible for my scenario.
One solution is to use Google Translate, but I need quality translation and Google Translate does not perform well on Roman Language.
Another most encouraged solution for ASP.NET is to use resource files (key-value pairs for content). Using Resource files for small websites where content is static works perfectly fine, but the resource files are not salable and would not work for my scenario as the content I am dealing with is completely dynamic.
Please let me know if there is a solution. Any help will be appreciated!
Thanks.
Related
I have strings that admin user can input into database.
User can select language, I want to localize this text according to it.
I do not want translate strings as I want to keep semantics same.
Also I have researched but I have found examples for only static strings.
Below question is relevant but I do not know string at compile time.
User can insert any string.
Relevant stackoverflow question
If I understand your question correctly, there is no easy way to do this.
All UI localization tools are concerned with localizing texts stored in your application, like the text on a button, or an error message.
If your application shows texts from a database, this a completely different problem.
Normally, you would have to allow for a multilingual text in your database schema and give your admin user a way to enter a localized text. Probably, you would have to define a translations table with
the original text (or a text ID)
a language ID
the localized text
In your application you would have to fetch the localized text from translations table.
If you use the original text as the key into the translations table, you will not have to modify the original table. If you use an ID, you would need to store this ID in the original table. Both have pros and cons.
If you are not too worried about the quality and consistency of the translations, you could use an online translation service. There are APIs for both the Google and Bing translator. Technically they are both paid services, but - at least with Bing - I think you have to pass a monthly threshold before they actually charge you anything.
I've created a website in asp.net mvc4 and i've put it online with specific domain name. Now my client asks to replicate same website on different domain name, and change some static texts/images to distinguish the 2 websites. I'd like to handle just one source code and deploy two times. How i can reach this?
We did this a few years ago with a web application. It was a pain in the a**. We had one website running and the resources were loaded after the user has logged in.
During the development you always had to think about that, split the resources always look for the logged in user etc.
It is just easier to copy the published application to a second folder and for the static texts use some kind of resource files that can be replaced on the fly.
As long as you don't have images and files that are a few gigabytes big it should be no problem to copy the compiled source code an the resources.
Though kind of a too late reply, but I just wanted to share some of my experience with you, you can follow these steps, it won't take too much of your time.
Identify the various text / images like logo for branding etc for which you have a requirement to make them tenant specific.
Create a table called tenant settings (tenantid, key, value )
Identify the pages that needs to be tweaked to look up from this setting than a hardcoded value.
Update these pages and provide a UI for each tenant so that they can change the values at any point of time
This way you can achieve the level 4 multi-tenancy with minimal effort to begin with.
HTH
I want to translate my website to French, without using the Google translation API at run time.
Are there any built-in ways in ASP.NET to allow you support multiple languages?
Since you're running an ASP.NET site, you should be able to use resource files for localisation.
For each bit of text (e.g. title, paragraph etc.) you define a field in a resource file. You can then create one resource file per language, which you can swap depending on which language you require.
I've created a website for a client of mine. It is coded in ASP.NET with C# and hosted on GoDaddy. She requires this website to updated daily by her. However, this client has very little knowledge of how to edit HTML or text within a site. I don't want to edit it every time she wants an update on the site.
What would be the best solution to my problem? I have looked up Content Management Systems, but I'm a little confused by what exactly it does in terms of coding and the management of the existing site. Does it require me to reformat the whole site to follow the CMS's 'templates'? Would it be better for me design my own back-end panel for her to edit the content (this would obviously take significant work)?
If you want to stick with a site you're developing from scratch, I'd use the HtmlEditor from the AjaxControlToolkit or a similar control, and store the html content in the database.
Then, when outputting the html from the database to the client pages, I'd make sure to use the Microsoft Anti-Cross Site Scripting Library to sanitize the html using the GetHtmlFragment() function (since this is tagged asp.net). It's not that much work, actually, if you design the database correctly, and if you've got the skills.
CMS systems are (trying not to oversimplify) entire web sites that are already built and allow people to edit the content using built-in content editing functionality. They range in functionality and extensibility from a "You get what you get and there's very little you can change" to "You can customize the heck out of it and buy or build your own modules to extend functionality." There are a lot of good ones out there, some free, and some expensive.
Kindly guide me how to make a site that support 2 languages. On joining the site use will select default language. If user select English all pages, button texts and email should be in English but if user select any other language site for him should be coming in that language. The following areas are language specific.
Buttons, Labels, headings and all captions.
Email texts and notifications
All messages including error messages.
Important thing is that currently I want to make this site in 2 languages but later I may want to convert it to other languages.
Please guide.
thanks
Your basically looking to find out the options for Internationalization & Localization provided by .Net. These typically rely on a combination of language specific resource files & use of the utilities & locale information provided by the System.Globalization namespace. There is a very good step-by-step tutorial which guides you through this process here:
http://www.codeproject.com/KB/locale/Internationalization_I18N.aspx
The tutorial is aimed at the construction of a desktop application however the vast majority of it's contents are applicable to a website/web-app. There are also some fantastic asp.net specific resources available here:
http://wiki.asp.net/page.aspx/55/internationalization/