i18n and translate page number text too

This commit is contained in:
wvengen 2013-05-20 17:14:42 +02:00
parent 3b7cbf71e0
commit d0c74b394e
3 changed files with 10 additions and 2 deletions

View file

@ -17,7 +17,7 @@ class OrderPdf < Prawn::Document
# Define header
repeat :all, dynamic: true do
draw_text title, size: 10, style: :bold, at: [bounds.left, bounds.top+20] if title # Header
draw_text "Seite #{page_number}", size: 8, at: [bounds.left, bounds.bottom-10] # Footer
draw_text I18n.t('lib.order_pdf.page', :number => page_number), size: 8, at: [bounds.left, bounds.bottom-10] # Footer
end
body # Add content, which is defined in subclasses
@ -29,4 +29,4 @@ class OrderPdf < Prawn::Document
def save_tmp
File.open("#{Rails.root}/tmp/#{self.class.to_s.underscore}.pdf", 'w') {|f| f.write(to_pdf.force_encoding("UTF-8")) }
end
end
end