The best approach for multilingual user interface - asp.net

I am working on a multilingual web application. I'm wondering how do i design the best user interface that the user can localize data for various languages? for instance, in making a page which its title is different in every lang, do i put a textbox for every one? it's not a suitable way to do(in case of 10 lang, the user has 10 textbox!!! too silly)
what is your idea about this?
Edit: i have no problem with globalization in my system. in fact, i'm looking for a good way for my interface design which user can enter his data to my forms in various langs.
thanks in advance

What about only one textfield and a dropdown containing the languages. After selecting the language and filling out the textfield the field gets submitted and the chosen language disappears from the dropdown list.
the entered value and language then appears beneath the dropdown and textbox with a way to edit/delete it. this way it's always clear to the user which languages are already covered and which values are assigned to them. furthermore it's a nicer way if not all 10 languages have to be mandatorily filled in, if the user e.g. just knows english and french.
Hope you know what I mean, otherwise I'll have to create an example screenshot :-)

You could have 3 text boxes, and that's fine...get to 10, and it starts getting a bit crazy. Beyond that it starts looking pretty bad.
Maybe you could put up to say 5 text boxes up...but if it goes beyond 5 (because the user desires localization for more than 5 places) it places a single textbox with a dropdown next to it, and the dropdown would contain the current language.
Textbox would auto-populate with the current value for the language selected in the dropdown. Should work well in asp.net, and it can be done both client side, or server side on a post back pretty easily, so you don't need to do anything crazy for people not running javascript.

You have one text box.
On load you populate the text box depending on language.
The content will be populated from some kind of resource file. If there isn't much text it could even go in your config file.
Be aware of the following:
Different content length depending on language.
Right to Left alphabets screwing up your alignment
This is a classic project for using NUNIT or similar to promve that things work after new translations are added!

What language do you use in development? If this is something like PHP, then you definitely should use templates and load text strings into them from configuration files for every language. In Smarty, for example, I use configuration files for that.
Text strings for error messages or something like that could be put to files like .ini and loaded from there.

The Google Web Toolkit (GWT) demo shows the same page with versions available in English, French, Arabic and Chinese.
The GWT docs have a thorough discussion of internationalization. You could emulate their implementation.
Constants: Useful for localizing typed constant values
Messages: Useful for localizing messages requiring arguments
ConstantsWithLookup: Like Constants but with extra lookup flexibility for highly data-driven applications
Dictionary: Useful when adding a GWT module to existing localized web pages
Remember that dates and times are represented differently in different locales, if your forms use them.
The W3C also discusses Internationalization Best Practices in HTML content.

Normally, a user navigating a website will have a preference specifying the language of the whole site. I think it would be confusing to break this pattern.
So, in an intro page, or a user preferences page, allow the user to select a language; then, on the other pages, display a consistent set of controls to be able to edit the content on each page.

Are you making an administration page that allows users to change the text used in other pages in the application?
If so, you could use grid like in Zeta Resource Editor:
thumbnail http://img202.imageshack.us/img202/7813/zetaresourceeditor02.th.png
Or you could make a per-language list like in nopCommerce:
thumbnail http://img249.imageshack.us/img249/9079/nopcommerce.th.png

You can use javascipts as a resource file for your language like. language_arabic.js, language_english.js,etc.So when a use wants to see his preference language he/she has select the available languages from drop down list. Regarding this the user has to change the language settings from his/her computer. This is what I did while I was working a GIS project to customize a Geocortex IMF( http://demos.geocortex.net/imf-5.2.2/sites/demo_geocortex/jsp/launch.jsp ) site for an Arabic client.

Related

Adding hyperlinks to the Description field

I am a user, not a programmer, whose forthcoming new website on Plone 4 requires adding hyperlinks inside the Description field of pages and folders. This is needed to point specific words to our website Dictionary as we had been doing on EZ Publish for the last 10 years.
Our developer says this can't be done in Plone. I'm looking to help them find how to do this (they don't seem to use English-language forums).
Is there an existing add-on or existing code for this? If not, is it possible to code this in? How? If not, will it become standard in Plone 5?
<a href="http://python.org>Python</a> will not work, as the description-field is ment and used as a meta-information of an item, holding plain-text only, and doesn't allow the usage of html-elements, nor embedded Javascript. That's probably why T. K. Nguyen recommends to provide an additional rich-text-field.
But you can use reStrucuredText instead. Tell your developer to exchange the description-snippet in concerned templates to:
<div tal:define="Std modules/Products.PythonScripts/standard;
restructured_text nocall: Std/restructured_text;"
tal:content="structure python: restructured_text(context.Description())">
</div>
It will transform any word starting with 'http:' or 'https:' to a link, furthermore will also recognize mail-addresses like 'someone#plone.org' and transform them to mail-links (on click opens the user's default mail-client, if available, with the address pre-populated in the 'To'-field).
If you want to have named links, use the reStrucutredText-syntax for the input, like this:
`Check out Python`_, you'll love it.
`Write a mail`_ to someone.
.. _Python: http://www.python.org
.. _Write a mail: someone#example.org
The tricky part is to figure out, which templates are affected, but it's doable of my experience (did it with preserving line-breaks in listing-views, not reStructuredText).
Alternatively use a JS-workaround, as proposed by T. K. Nguyen. Be aware though, that it may break accessibility to some users.
It is possible to customize the description fields to be rich text (HTML) instead of plain text, but it requires a developer.
You can also use JavaScript to look at a description field and replace (for example) any string that starts with "http" with a hyperlink pointing to that URL. Your developer would have to look for examples of such JavaScript code and then would have to know how to register it on your site and then invoke it.
This describes how to do something similar, for PloneFormGen field help text (which is also plain text):
https://designinterventionsystems.com/blog/how-to-make-urls-clickable-in-ploneformgen-field-help-text
It might be easier to have your developer create a new rich-text description field and have all your content types include that new field. That, however, would require that you update the view templates for those modified content types. This is much easier with Dexterity, which ships with Plone 5 and is available for use with Plone 4.x.
imho it's a really bad idea to convert the description field to any richttext (html, rst, md) field. You need to change a hole bunch of templates to avoid html code rendered everywhere.
Example:
search
collections
content
portlets
Addons
The description is also often used as title attribute on links, in those cases you need to convert it to plain/text. And there are several more issues, where you could ran into.
As #T. Kim Nguyen wrote: Consider add a new textfield and show it, where necessary, probably implemented as a Viewlet in the below title slot.
Looking at your current site, it seems like you want this to provide a teaser for each article, which may contain links. If that is the case, then you can find other ways to do this without making the description html.
For instance, if you used collective.cover for your portal/collection pages then a Rich Text Tile would allow you to cut down the the object text to an appropriate size, but still edit it with a Rich Text editor, and keep/insert hyperlinks.

ASP.NET dynamic localization for English and one more language

I'm creating a website template where the owner of the site will be able to choose a native language other than English and localize some content by themselves. Let me explain it better with the real situation right now: My site will have English and Turkish (my native language is Turkish, but THIS should be changeable and applied to any non-English language) versions of the main content titles, such as BLOG, PROJECTS, ABOUT, CONTACT etc, but number and name of these are completely dependent to the choice of the user, so I could open a new section named MySection, and it's title and it's native translation to Turkish will be stored in my DB (using EF). Also in my settings at the DB, the native language's code (in this case "tr") is stored. What is the most modular/organized way of sending the webpage content according to browser, just like this:
In DB, sections are organized this way (titles and their Turkish translations) (all these will be at arbitrary number and completely user created):
Title NativeTitle
---------------------
BLOG BLOG
PROJECTS PROJELER
ABOUT HAKKINDA
Also I have my native language setting (that I've created) setting as tr (which is up to the site owner and can be changed too). So, depending on the user's browsers preferred language setting, I want to show the Turkish content, and for all the other language preferences, including (obviously) English, I want to show the default English content. Localization for a specific language of static content is pretty straightforward with RESX files, but in my situation, I neither have static content nor a specific known native language, so all my data comes from the DB. I want to code this as less as possible and as declarative as possible. What is the best practice of doing this? Is checking the setting of the native language and the Current Culture in a page and if they are equal sending the native else sending the default title the only way? It WILL definitely work, but what if I want to extend it to other parts of the site? I don't want if's and else's everywhere around the site, I need some kind of a centralized string mapping system. What's the best way?
You can override the InitializeCulture ( http://msdn.microsoft.com/en-us/library/system.web.ui.page.initializeculture.aspx ) method in your base Page to dynamically load your localized content by checking the Thread.CurrentThread.CurrentUICulture property ( http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.currentuiculture.aspx )

Internationalization of ASP.NET apps

How do you guys handle translation/internationalization of your ASP.NET applications? How do you work with your translators?
We have ASP.NET apps that need to be available in German, French, Italian, English. We use string resources everywhere. However, more than once, our translators have told us just getting a bunch of "txtMyTextbox.Text" and then a German text to be translated is next to impossible to deal with - the context is missing.
So are there any other solutions available? Due to the fact these translators are dispersed all over Europe, we cannot get them to fly in and do their work "on location" - there has to be a way to send them the text fragments to be translated, along with some context, and let them do their work.
Is there any tool out there that would allow me to package up my ASPX pages and ASCX controls along with the text resources, and that would actually visualize them to the translator (without him having to install and host IIS and all) ? I vaguely remember there was a lot one tool in my olden Delphi days that did that - visualize the form (without the real app running), and allowing someone to pick the labels and translate them.
Or would there be a tool that would allow me to make screenshots of my ASPX pages and highlight all label and display their control name ("txtMytextbox") in red, so that the screenshot could serve as an orientation help for someone working on translating a list of labels?
Any hints are most welcome and highly appreciated!
Marc
take a look at the Lingobit http://www.lingobit.com/
How about going around ASP.NET's insternationalization scheme and using a diferent approach, using .po files like the "rest of the world" . The actual text is the key, and translators see that text qhen they are translating. Works pretty well.
http://www.expatsoftware.com/articles/2010/03/fixing-internationalization-in-aspnet.html
describes this.
Make your resource keys more meaningful. This will give them some context
Can the translators get access to a running app? If so, you could set the tooltips of all your labels to be the resource key. That would allow them to mouse over a label to see where its string is coming from.
As your translators become more familiar with the product, they'll be able to better cope with the lack of context. The first time around is a little rough, and you'll need to go through a few rounds of testing and translation revisions. There's not much you can do about it.
Here is the article written by Scott Hanselman. Hope it helps
Globalization, Internationalization and Localization in ASP.NET

HOW TO MAKE localization?

I have a question about localization
how can i do localization lets say that i have a dropdown list
that holds the available languages: English,french and arabic
and I have a label which get it says "good morning",so i want to change the lang. according to selected lang. in drop down list so when the user chooses french label will say "bonjour" and when the user slect arabic the label will hold "صباح الخير" AND MOVE IT FROM THE LEFT OF THE PAGE TO THE RIGHT BECAUSE ARABIC IS WRITTEN FROM RIGHT TO LEFT ,,
ANY HELP WILL BE HIGHLY APPERCAITED
THNX IN ADVACE
In short, localization in ASP.NET is fully supported using resource files, e.g. files containing strings, images and other resources for each user interface language. They're named after the culture, for example MyResources.en-US.resx or MyCulture.fr-FR.resx.
The only thing that is a bit tricky is handling LTR and RTL languages and, as far as I know, must be done "manually", via code, or via CSS.
You might want to check some documentation on MSDN.
Have you ever saw the Localization video tutorials from ASP.NET website?
How Do I: Create a Multi-Lingual Site with Localization?
and
How Do I: Localize an ASP.NET AJAX Application?
They are great to get you started...
you can create an http module that is going to read the html from the output stream and translate it,use RegEx and make sure not to translate html tags and JavaScript
there is also the asp.net standard (built-in) way, with resource files, just right click your project and click add items resource file, you must create a resource file for each language like for example: MUI.resx (that's the neutral one), MUI.fr.resx, MUI.es.resx, and you are going to use them in the web pages like this: MUI.keyword , that's if you are going to have one resx per language for all pages, you could also have one resx per language per webform.
And the current language is in the System.Threading.CurrentThread.CurrentUICulture
google it a little bit you will find more, at least now you know what to look for

asp.net wiki user control

I'm writing a asp.net web application in which I want the users to be able to apply simple formatting to the text they enter in text areas.
One of the possibilities is to use a javascript wisywig editor (like tinymce). However, to keep the text html-clean and readible, I'd prefer that the users have to do the formatting themselves in exactly the same way as it is done in wiki's.
I can't find a free or not too expensive control on the web. Has anyone used a third party control before? any advise on this?
You can use a markdown editor like this:
http://wmd-editor.com/
Then you want to be able display the result in HTML with this:
http://aspnetresources.com/blog/markdown_announced.aspx
Essentially this is what StackOverflow does (with their customization). They discuss how they do it in their podcast.

Resources