6 Rules
Samuel Castillo Romero (MSFT) редактировал(а) эту страницу 2016-09-14 12:11:38 -07:00

The rules are where we define the logic for each check and can be created individually based on the scenario that is needed. Rules can contain as much checks as you desire or just one simple check. When a rule gets executed by the engine against a resource file, all the checks within it get executed producing an independent output result (True or False) in the output file.

There are limitless rules that can be implemented using the Resource Static Analysis Engine like missing placeholders or tokens, insufficient developer comments, duplicate or missing hotkeys, inconsistent punctuation, etc.

This sample project includes a number of rules but we want to further build out the rule library, and we need you help in doing so!

##Context related rules

  • CommentsContext, flags resources that do not have any comment define in the comments section of the resource or where the comment is equal to the SourceString value.
  • DuplicatedSourceString, flags resources that contain the same SourceString value.
  • EmptySourceString, flags resources that doesn't contain any value in the SourceString section.
  • EnUsCulture, flags resources that contains the 'en-us' pattern in the string as this could cause some localizability issues in other cultures.
  • LongSourceString, flags resources that contain words with 50 or more characters without spaces, as this type of string usually do not represent a localizable string resource.
  • PlaceholderInsufficientContext, flags resources that contain placeholders but not comments. Comments are needed to explain the placeholder so that the translator can create a better translation.
  • SpecialCharacters, flags resources that contain special characters and/or numbers only, as this type of strings usually do not represent a localizable string resource.

##Functional related rules

  • DuplicatedResourceId, flags resources that contain the same Resource Id value.