Creating an international website - c#

The question might sound weird, but I am planning to create a asp.net website, which when fully done, will ideally cater to all countries.
I am currently in the architecture phase.. and is there anything that I should keep in might when doing this?
like
saving all datetime fields in utc
using user's timezone to display all time related data
all labels in the website to be localizable
is there anything else??
thanks,
Chris

A few additional points:
Some languages read from Right to
Left (Hebrew for example), which
will affect your UI.
Make sure your datastore supports
unicode (NVARHCAR vs VARCHAR).
Provide an easy way for translators
to contribute content. Usually means
creating a Data Driven Resource
Provider.
Internationalization and Localization is a good place to start.

You should think about how the localization process will take place. I assume you are not a native speaker in all languages you want to use for your application.
There are several approachs on how to address this: For example, there are companies that specialize in localization, meaning you give them an excel sheet, or an xml file.
You should also think about, where do you want to have all these localizations. Do you only want them in your ASP.net application, meaning in only one place? Then the resource file will be your way to go, because they are easy to handle and easy to send to localization studios.
But if you want to use the localizations in more than one place, you need to store them in a web service or in a database. Keep in mind that using localizations across multiple plattforms (e.g. web site, administrative tools) will force you to write import/export functionality for the used tables. (Because you won't give the localization company access to your database)

I would start by looking here: http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx.
I also guess you are working on doing a SQL database. If that is the case look at things like using nvarchars.

Related

Localization of múltiple applications

I have several applications for several purposes in my company. Now that we need to translate to Japanese we need to provide a way to store translations.
Provide a central service to every application/team to add and get translations is a good idea?
How can I integrate this in my ASP.NET applications?
Thanks.
Here's the way I did this for a combination of web (MVC and WCF) and desktop (WinForms and WPF) apps.
A database repository of common strings was built that contained common words and phrases like Cancel, Save, etc. as well as business specific terms. Along with the DB a dev team utility app that would build a base localization library project. Individual app teams could then inherit this base and expand upon it for their specific needs. The idea was to provide the base while allowing customization to avoid delaying a project that needed new phrases added.
Within the individual apps, the strings were replaced by calls to the library. For example,
CancelButtton.Text = LibName.GetPhrase("Cancel"). The current CultureInfo was used to determine the user's language but this could be overriden for testing. If the phrase wasn't in the DB, it would default to the supplied string.
We had some debate over using local files, such as RESX, vs. a database repository. The plan ended up being to start with a database first and add the capability local files if there was a performance issue or the need for unconnected operations.
You could always use localized strings in something like an XML structure and just extract the information from the XML file. Every language got it's own XML file.
For example (from Android Localization):
#string/info_string = "Information in English"
Another file
#string/info_string = "Informationen in deutscher Sprache"
In your program you simply get the information that info_string stores.

Custom WMS Service

I'm doing an program, which is running on an local system, with no internet access. Is it possible to create my own custom Web Map Service (WMS) server, using C#. I no that there are free open source system's. But i like to have full control.
Thanks Morten Starck
That is very possible, but you might be in for a headache or two before you are done. The implementation specification and more is available from the Open Geospatial Consortium at the url below.
http://www.opengeospatial.org/standards/wms
It's quite a large specification but you might be able to get away with implementing only the parts you really need and leaving some of the more specific stuff out. You will of course also need to parse and render the map data from some source which might be your largest problem (for which I really would suggest you have a look at SharpMap, http://sharpmap.codeplex.com/ instead of rolling your own).

Any tools, libraries or suggestions to simplify dynamic question functionality?

I am working on an ASP.NET project that is relatively simple except for one requirement which requires custom questionnaires be attached to specific types of tasks. These questionnaires need to be customized regularly and no development, within the app itself, should be needed add questionnaires. The questionnaires currently do not require an editing tool and can be done by uploading a template, changing something in a DB, whatever. They can be stored in any format and the resulting output needs to be captured to be edited or viewed later.
The types of questions in the questionnaire could be:
Selections (select one from a list)
Input (text, integers, dates, etc)
Yes/No
The ability to display questions based on answers from other questions. For example if they answer yes to question X, display question Y else display question Z. Need to be able to apply data validation such as required fields, ranges, etc on questions (could all be probably capture by basic regex).
The simplest break down would be:
Create a new event.
Based on the type of event display a specific questionnaire.
Questionnaires can change over time but they can be considered as new version each time and data will always be related to a specific version and not need to be migrated to updated versions.
The questionnaire output (data elements and a final calculated value) must be captured.
XML output (or any other format) of data elements entered.
The optimal (unicorn) scenario would be to have a basic template in XML or something that a user can learn to create easily and it would be stored and versioned in a DB. When a user makes a new event, the app would fetch the appropriate template which would display the questionnaire to the user. The user would fill it out and the output would be posted as some type of output (again XML would be nice but not required). That output would be attached to the event. Done.
Are there any .NET compatible tools/libraries that I could leverage to accomplish this? InfoPath seems like a tool that might be of use but I have almost zero experience with it so I am not sure about its constraints / implementation and if it is just overkill. The solution needs to be contained within the ASP.NET application. An external editor tool for creating templates would be ok but the templates must be viewable and editable on the web with no constraints to the user.
Can anyone provide examples of this being done or hints on how you might have tackled this?
Since the application is relatively easy to create other than this one feature, I would rather not spend 80% of my time trying to implement the custom questionnaire functionality and spend more time on the problem the application is trying to solve.
Tech available: ASP.NET, Silverlight, SQL Server
I would suggest having a look at a dot net nuke implementation, I am sure there should be a lot of viable options (if not all free).
DotNetNuke
Have a look at the Forge to see free plugins
Consider evaluating SurveyMaster at CodePlex. It's licensed under Microsoft Public License (Ms-PL), and you can modify its source for your needs.

What Should I Know and Consider To Create Multi Language Web Site

I'm Creating a Multi Language website with at least 5 language, what should I consider
On a technical front not a lot, you can use a framework like Zend or Kohana or Rails etc. which usually have the ability to replace the content with tags and then fill the tag with the language of choice at run time. The different languages reside in appropriately named directories and can be triggered by the browser language tag or another mechanism. If you are not using a framework with this facility then study one to see how it is done.
After that and in no particular order.
Why multilingual? you really need a compelling reason to do it as the workload you are taking on is large and complex and onerous. I know all the reasons about how and why people like sites in their native language but for a multi lingual site's investment in money you need to be making a proper return on the investment and not just doing it for the sake of it.
Localising, L10N or internationalisation i18n, is not just about language. It is about about cultural differences. Anglo Saxons like cool restrained san-serif type sites. Latin and Latin American cultures like more vibrant colours and cursive type faces. And so on. So you need to have a mechanism that will change the css for each language as well (well to be truly effective you do)
Who is doing the translation? Remember it is an idiomatic translation you need, Google Translate API will not cut it and you need a native speaker to translate from and to the target. So for example if you are using FIGS (French Italian etc) from an English original. You need a translator for English to French, English to German, English to Italian, and English to Spanish (see the costs mounting?). A good bureau will provide all this for you and manage the process though.
Proof reading. Can you speak 5 languages well enough to check that above work is correct?
Maintenance. Again assuming English is the base language and there is a new page or a page rewrite or even a typo you need to go through the above process and update the site so you need a good workflow and process control system to ensure that the changes and updates work effectively. The ongoing maintenance can be crippling in time and cost, work it out before you start.
Beware of advice form people who localise programmes/applications It is not remotely the same thing.
Many solutions actually use separate web sites for each localisation rather than the all in one approach. This can be counter intuitive when we want to put it all into one "technical" package. However you can by separating the sites easily cope with different styles, and character sets and ltr text etc. You can stagger updates and manage the workflow more effectively, adding new site is far far simpler and it allow you to use the different URL's that may be required and allows you to optimize each site for SEO.
Please see: Best Practices for Developing World-Ready Applications
Walkthrough: Using Resources for Localization with ASP.NET
When I developed bi-directional web applications, I found the following practices helped too much:
To make your page as easy to globalize
as possible, follow these best
practices:
❑ Avoid using absolute positioning and
sizes for controls.
❑ Use the entire width and height of
forms.
❑ Size elements relative to the
overall size of the form.
❑ Use a separate table cell for each
control.
❑ Avoid enabling the NoWrap property
in tables.
❑ Avoid specifying the Align property
in tables.
source: MCTS Self-Paced Training kit: Microsoft .NET Framework 2.0 Web-based client development.
As a general tip, I found using tables instead of just DIVs is very helopful.

How do I best localize an entire app to many different languages?

I'm using Visual Studio (2005 and up). I am looking into trying out making an application where the user can change language for all menues, input formats and such. How would I go on doing this, as I suppose that there is some complete feature within .Net that can help me with this?
I need to take the following into account (and fill me in if I miss some obvious stuff)
Strings (menues, texts)
Input data (parsing floats, dates, etc..)
Should be easy to add support for another language
I'm not an expert with .NET by any means but Localization is never just as simple as "swapping out String values" or "changing date formats". There is much more to be taken into consideration such as layout, proper text placement.
Take Chinese for example. The way you read is top to bottom not left to right. If properly localized the app should take that into account.
http://msdn.microsoft.com/en-us/library/y99d1cd3(VS.80).aspx seems to be a good start though if you're dealing with Windows Forms.
The classic recipe is: design the app with no native language but a localization facility, and develop an initialization into one language (e.g., English). So you build the app and localize it into English every night; without the localization step it would not be usable. Do that well, and the resources for the initial sample localization can be replaced with those for any other language. Take into account non-roman scripts from the beginning. It's much cleaner to have a no-language app that always requires localization rather than a language-specific app that needs to have its native language subtracted and a replacement added.
For strings you should just separate your strings from your code (having an XML/DLL that will transform string IDs to real strings is one way to go). However you do need to make sure that you are supporting double byte characters for some languages (this is relevant if you use C/C++).
For input data what you want is to have different locale's. In Java this is relatively easy, and if you use C# it probably is quite easy also. In C/C++ I don't really know. The basic idea is that the input parsers should be different based on the locale selected at that time. So each field (textfield, textbox, etc.) must have an abstract parser that is then implemented by a different class depending on the locale (right to left, double byte, etc.).
Check the Java implementation for details on how they did it. It is quite functional.
You definitely need to be using the .NET ResourceManager and the resx file xml format, however there are a number of approaches to using this.
It really depends on what you are wanting to achieve. For me I wanted a single xml resource file (for each supported language) that could be modified by anyone. I created a helper class that loaded the global resource file into ResourceManager (once only) and I had a helper function that gives me the required resource for a given name. The only disadvantage in this approach was that I could not leverage dynamic binding of resources to properties.
I found this better and easier to manage than multiple or embedded resource files for every form. Additionally exactly the same approach can used in an ASP.NET application. I also found this approach means that outsourcing translation of resources and shipping language packs to customers much more manageable.
Microsoft's recommended approach is to use satellite assemblies, as described in Packaging and Deploying Resources. If you're using a ResourceManager to load resources, .NET will load the correct resources for the CurrentUICulture. This defaults to the user's current UI language setting in Windows.
It is possible to localize Windows Forms either through Visual Studio or an external tool, WinRes.exe. This article describes WinRes and how to use Visual Studio to localize the form.

Categories

Resources