@@ -23,6 +23,7 @@ def getParser(path):
2323from .cldr import get_plural_categories
2424from .transforms import Source
2525from .merge import merge_resource
26+ from .util import get_message
2627from .errors import (
2728 EmptyLocalizationError , NotSupportedError , UnreadableReferenceError )
2829
@@ -205,11 +206,20 @@ def get_sources(acc, cur):
205206 self .reference_resources [target ] = reference_ast
206207
207208 for node in transforms :
209+ ident = node .id .name
208210 # Scan `node` for `Source` nodes and collect the information they
209211 # store into a set of dependencies.
210212 dependencies = fold (get_sources , node , set ())
211213 # Set these sources as dependencies for the current transform.
212- self .dependencies [(target , node .id .name )] = dependencies
214+ self .dependencies [(target , ident )] = dependencies
215+
216+ # The target Fluent message should exist in the reference file. If
217+ # it doesn't, it's probably a typo.
218+ if get_message (reference_ast .body , ident ) is None :
219+ logger = logging .getLogger ('migrate' )
220+ logger .warn (
221+ 'Message "{}" was not found in {}' .format (
222+ ident , reference ))
213223
214224 # Keep track of localization resource paths which were defined as
215225 # sources in the transforms.
0 commit comments