Five New FxCop Globalization Rules

I have updated the downloadable source code for my .NET Internationalization book. The Visual Studio 2012 source code is downloadable from here. In this update there are 5 new FxCop globalization rules:-

  • Do not convert to uppercase - This rule catches all uses of ToUpper. It can be considered a more severe version of FxCop's own "Specify CultureInfo" rule. If the conversion to uppercase is used to perform a case insensitive comparison then String.Compare should be used instead. If the conversion to uppercase is used to change user data then it would be better not to convert the user data at all.
  • Do not convert to lowercase - This rule catches all uses of ToLower. It serves the same purpose as the previous rule except that it catches ToLower instead of ToUpper.
  • Boolean.ToString() is not localizable - This rule catches all uses of Boolean.ToString(). The words "True" and "False" are specific to English and are therefore not localizable. This rule is similar to the existing "Enum.ToString() is not localizable" rule.
  • Identifiers should not be called FirstName - This rule catches fields and properties that are called FirstName (or a variation of FirstName). The term "first name" is a western naming convention and it does not accurately identify a name part (even in Europe some countries use Family Name / Given Name order). Use the term "Given Name" instead.
  • Identifiers should not be called LastName - This rule catches fields and properties that are called LastName (or a variation of LastName). The term "last name" is a western naming convention and it does not accurately identify a name part. Use the term "Family Name" instead.

In total the downloadable source code now contains 25 FxCop globalization and localization rules.

Technorati Tags: ,,,

Currently rated 3.2 by 40 people

  • Currently 3.15/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Monday, April 22, 2013 at 6:04 PM
Tags:
Categories: Internationalization | .NET Internationalization Book
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Related posts

Comments

blog.cwa.me.uk

Wednesday, April 24, 2013 10:33 AM

pingback

Pingback from blog.cwa.me.uk

The Morning Brew - Chris Alcock » The Morning Brew #1341