Click here to Skip to main content
15,881,715 members
Articles / Desktop Programming / WPF

Localization Sync

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
23 Feb 2012CPOL4 min read 21.3K   625   9  
Small utility to keep localized resources synchronized
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace LocalizationSync
{
	public class DestinationValidationRule : ValidationRule 
	{
         public string ErrorMessage { get; set; }

         public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
         {
             ValidationResult lResult = null;
             IEnumerable<object> lCollection = (IEnumerable<object>)value;
             if (lCollection == null || lCollection.Count() == 0)
                 lResult = new ValidationResult(false, ErrorMessage);
             else
                 lResult = new ValidationResult(true, null);

             return lResult;
         }
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Romania Romania
I have been a software developer for a while and still find this an interesting job.

Comments and Discussions