I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Support #2297

Use Redmine translations

Added by Andriy Lesyuk almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
29 May 2014
Due date:
29 May 2014
% Done:

100%


Description

For RedWord it’s very important to have same translations for strings as in Redmine... Especially for Redmine/WordPress integration (so strings preserved translations during switching between systems).

The best way to achieve this is to move translations from Redmine to WordPress (for strings that are used in RedWord).

History

#1 Updated by Andriy Lesyuk almost 10 years ago

The following code is used:

locale = 'pt-BR'.to_sym
file = File.open("/tmp/redword-#{locale.to_s}.po", "w")

file.puts "msgid \"%d of %d\"" 
file.puts "msgstr \"#{::I18n.t(:label_item_position.to_s, :locale => locale.to_s, :position => '%d', :count => '%d')}\"" 

file.puts "msgid \"« Back\"" 
file.puts "msgstr \"« #{ll(locale, :button_back)}\"" 

file.puts "msgid \"« Previous\"" 
file.puts "msgstr \"« #{ll(locale, :label_previous)}\"" 

file.puts "msgid \"(% comments)\"" 
file.puts "msgstr \"(#{::I18n.t(:label_x_comments.to_s, :locale => locale.to_s, :count => '%')})\"" 

file.puts "msgid \"(1 comment)\"" 
file.puts "msgstr \"(#{::I18n.t(:label_x_comments.to_s, :locale => locale.to_s, :count => 1)})\"" 

file.puts "msgid \"Activity\"" 
file.puts "msgstr \"#{ll(locale, :label_activity)}\"" 

file.puts "msgid \"Add\"" 
file.puts "msgstr \"#{ll(locale, :button_add)}\"" 

file.puts "msgid \"Add a comment\"" 
file.puts "msgstr \"#{ll(locale, :label_comment_add)}\"" 

file.puts "# #{::I18n.t(:label_added_time_by.to_s, :locale => locale.to_s, :author => '|', :age => '|')}" 
file.puts "msgid \"Added by\"" 
file.puts "msgstr \"#{::I18n.t(:label_added_time_by.to_s, :locale => locale.to_s, :author => '|', :age => '|').split('|').first.strip}\"" 

file.puts "# #{::I18n.t(:label_added_time_by.to_s, :locale => locale.to_s, :author => '|', :age => '|')}" 
file.puts "msgid \"ago\"" 
file.puts "msgstr \"#{::I18n.t(:label_added_time_by.to_s, :locale => locale.to_s, :author => '|', :age => '|').split('|').last.strip}\"" 

file.puts "msgid \"Administration\"" 
file.puts "msgstr \"#{ll(locale, :label_administration)}\"" 

file.puts "msgid \"Also available in\"" 
file.puts "msgstr \"#{ll(locale, :label_export_to)}\"" 

file.puts "msgid \"Cancel\"" 
file.puts "msgstr \"#{ll(locale, :button_cancel)}\"" 

file.puts "msgid \"Comments\"" 
file.puts "msgstr \"#{ll(locale, :label_comment_plural)}\"" 

file.puts "msgid \"Edit\"" 
file.puts "msgstr \"#{ll(locale, :button_edit)}\"" 

file.puts "# #{::I18n.t(:label_date_from_to.to_s, :locale => locale.to_s, :start => '|', :end => '|')}" 
file.puts "msgid \"From\"" 
file.puts "msgstr \"#{::I18n.t(:label_date_from_to.to_s, :locale => locale.to_s, :start => '|', :end => '|').split('|').first.strip}\"" 

file.puts "# #{::I18n.t(:label_date_from_to.to_s, :locale => locale.to_s, :start => '|', :end => '|')}" 
file.puts "msgid \"to\"" 
file.puts "msgstr \"#{::I18n.t(:label_date_from_to.to_s, :locale => locale.to_s, :start => '|', :end => '|').split('|')[1].strip}\"" 

file.puts "msgid \"Help\"" 
file.puts "msgstr \"#{ll(locale, :label_help)}\"" 

file.puts "msgid \"Logged in as\"" 
file.puts "msgstr \"#{ll(locale, :label_logged_as)}\"" 

file.puts "msgid \"My account\"" 
file.puts "msgstr \"#{ll(locale, :label_my_account)}\"" 

file.puts "msgid \"Next »\"" 
file.puts "msgstr \"#{ll(locale, :label_next)} »\"" 

file.puts "msgid \"No data to display\"" 
file.puts "msgstr \"#{ll(locale, :label_no_data)}\"" 

file.puts "msgid \"Registered on\"" 
file.puts "msgstr \"#{ll(locale, :label_registered_on)}\"" 

file.puts "msgid \"Reply\"" 
file.puts "msgstr \"#{ll(locale, :button_reply)}\"" 

file.puts "msgid \"Results\"" 
file.puts "msgstr \"#{ll(locale, :label_result_plural)}\"" 

file.puts "msgid \"Search\"" 
file.puts "msgstr \"#{ll(locale, :label_search)}\"" 

file.puts "msgid \"Sign in\"" 
file.puts "msgstr \"#{ll(locale, :label_login)}\"" 

file.puts "msgid \"Sign out\"" 
file.puts "msgstr \"#{ll(locale, :label_logout)}\"" 

file.puts "msgid \"The page you are trying to access doesn't exist or has been removed.\"" 
file.puts "msgstr \"#{ll(locale, :notice_file_not_found)}\"" 

file.puts "msgid \"Zoom in\"" 
file.puts "msgstr \"#{ll(locale, :text_zoom_in)}\"" 

file.puts "msgid \"Zoom out\"" 
file.puts "msgstr \"#{ll(locale, :text_zoom_out)}\"" 

file.close

#2 Updated by Andriy Lesyuk almost 10 years ago

  • Due date set to 29 May 2014
  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

Also available in: Atom PDF

Terms of use | Privacy policy