-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abstract away SearchMethodsForLocalizationMessagesRule
- Loading branch information
Showing
2 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
source/Buoy-Development-Tools-Pharo-12/SearchMethodsForLocalizationMessagesRule.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Class { | ||
#name : 'SearchMethodsForLocalizationMessagesRule', | ||
#superclass : 'RBParseTreeLintRule', | ||
#instVars : [ | ||
'stringsToTranslate' | ||
], | ||
#category : 'Buoy-Development-Tools-Pharo-12', | ||
#package : 'Buoy-Development-Tools-Pharo-12' | ||
} | ||
|
||
{ #category : 'instance creation' } | ||
SearchMethodsForLocalizationMessagesRule class >> collectingTranslationsIn: aCollection [ | ||
|
||
^ self new initializeCollectingTranslationsIn: aCollection | ||
] | ||
|
||
{ #category : 'initialization' } | ||
SearchMethodsForLocalizationMessagesRule >> initialize [ | ||
|
||
super initialize. | ||
matcher | ||
matches: '`#string localized' | ||
do: [ :node :answer | stringsToTranslate add: node receiver value ]; | ||
matches: '`#string localizedWithAll: `@values' | ||
do: [ :node :answer | stringsToTranslate add: node receiver value ] | ||
] | ||
|
||
{ #category : 'initialization' } | ||
SearchMethodsForLocalizationMessagesRule >> initializeCollectingTranslationsIn: aCollection [ | ||
|
||
stringsToTranslate := aCollection | ||
] | ||
|
||
{ #category : 'accessing' } | ||
SearchMethodsForLocalizationMessagesRule >> name [ | ||
|
||
^ 'Search methods for localization messages' | ||
] |