This project has moved. For the latest updates, please go here.

Localization

Oct 1, 2013 at 5:28 PM
Since 3.0 version is still under development, I'd like the author to consider support for internationalization. It has to be some kind of localization system and the user has to be able to select one of the configured languages for the TicketDesk.
Coordinator
Oct 1, 2013 at 5:36 PM
This is already in the new code base. For more info on the implementation see this article:
Oct 2, 2013 at 12:48 PM
Great! Thanks!
Jan 27, 2014 at 8:13 AM
I've done localization in Italian on 2.1.2 release, using localization approach you have had in 3.0 beta release.
Here is a sample code used to localize DisplayName attribute, after add this class, simply do a find and replace of Display attribute with LocalizedDisplayName
(ex. ChangePasswordModel and all other model class).
public class LocalizedDisplayName : DisplayNameAttribute
{
    private string DisplayNameKey { get; set; }
    private string ResourceSetName { get; set; }
    private static ResourceSet _rs=null;

    public LocalizedDisplayName(string displayNameKey)
        : base(displayNameKey)
    {
        this.DisplayNameKey = displayNameKey;
    }

    public LocalizedDisplayName(string displayNameKey, string resourceSetName)
        : base(displayNameKey)
    {
        this.DisplayNameKey = displayNameKey;
        this.ResourceSetName = resourceSetName;
    }
    public void Initialize()
    {
        Initialize(System.Globalization.CultureInfo.CurrentCulture.Name);
        Initialize(System.Globalization.CultureInfo.CurrentCulture.Name);
    }

    public void Initialize(String strCulture)
    {
        _rs = AppModelText.ResourceManager.GetResourceSet(new System.Globalization.CultureInfo(strCulture), true, true);
    }

    public override string DisplayName
    {
        get
        {
            if (_rs == null)
                Initialize();
            String strLocalized = this.DisplayNameKey;
            String strDisplayKey = Regex.Replace(this.DisplayNameKey, @"([ ?èéòìù%&$£])", "_");
            try
            {
                if (_rs.GetString(strDisplayKey) != null)
                    strLocalized = _rs.GetString(strDisplayKey);
                else
                    System.Diagnostics.Debug.WriteLine("NOTFOUND:" + this.DisplayNameKey);
            }
            catch
            {
                System.Diagnostics.Debug.WriteLine("NOTFOUND:" + this.DisplayNameKey);
            }
            return strLocalized;
        }
    }

}