]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - fixup-docbook-translated.rb
Move translated image selection into po file.
[text-madewithcc.git] / fixup-docbook-translated.rb
index 38ec06e98fdf01fdba0f7c6d907e7fc99b1d5696..3f04247a60d9a4e660b6aee3cd64edbb4d0b89e3 100644 (file)
@@ -28,21 +28,6 @@ else
   log 0, ' -!- Introduction text not found or empty'
 end
 
-log 0, 'replace images with translated versions'
-xml.search('imagedata').each do |img|
-  # Included images are in the 'Pictures' directory. Translated images
-  # are in Pictures/[langcode]/. Only translated images need to be
-  # included.
-  orig_img = img.attributes['fileref'].text
-  trans_img = orig_img.gsub(/Pictures/, "Pictures/#{lang}")
-  next if orig_img == trans_img
-
-  if File.exists?(trans_img)
-    log 1, 'Replaced %s by %s' % [orig_img, trans_img]
-    img.set_attribute('fileref', trans_img)
-  end
-end
-
 log 0, 'Final editorial requests: Attributions on top, as in other chapters, also for prefaces'
 xml.search('preface').each do |pref|
   title = pref.search('title').first