@@ -263,9 +263,13 @@ class PageCompiler(BasePlugin):
263
263
}
264
264
config_dependencies = []
265
265
266
- def _read_extra_deps (self , post ):
266
+ def get_dep_filename (self , post , lang ):
267
+ """Return the .dep file's name for the given post and language."""
268
+ return post .translated_base_path (lang ) + '.dep'
269
+
270
+ def _read_extra_deps (self , post , lang ):
267
271
"""Read contents of .dep file and return them as a list."""
268
- dep_path = post . base_path + '.dep'
272
+ dep_path = self . get_dep_filename ( post , lang )
269
273
if os .path .isfile (dep_path ):
270
274
with io .open (dep_path , 'r+' , encoding = 'utf8' ) as depf :
271
275
deps = [l .strip () for l in depf .readlines ()]
@@ -274,12 +278,16 @@ def _read_extra_deps(self, post):
274
278
275
279
def register_extra_dependencies (self , post ):
276
280
"""Add dependency to post object to check .dep file."""
277
- post .add_dependency (lambda : self ._read_extra_deps (post ), 'fragment' )
281
+ def create_lambda (lang ):
282
+ return lambda : self ._read_extra_deps (post , lang )
283
+
284
+ for lang in self .site .config ['TRANSLATIONS' ]:
285
+ post .add_dependency (create_lambda (lang ), 'fragment' )
278
286
279
287
def get_extra_targets (self , post , lang , dest ):
280
288
"""Return a list of extra targets for the render_posts task when compiling the post for the specified language."""
281
289
if self .use_dep_file :
282
- return [post . base_path + '.dep' ]
290
+ return [self . get_dep_filename ( post , lang ) ]
283
291
else :
284
292
return []
285
293
0 commit comments