Revision 28c8cbc3
Added by Marc Dequènes almost 11 years ago
Rakefile | ||
---|---|---|
ENV['LC_ALL'] = "C"
|
||
|
||
require 'rake'
|
||
require 'gettext/tools'
|
||
require 'gettext/tools/task'
|
||
require 'cyborghood/base/config_setup'
|
||
require 'cyborghood/base/info'
|
||
|
||
namespace :i18n do
|
||
desc "Create mo-files for l10n"
|
||
task :makemo do
|
||
GetText.create_mofiles(true, "po", CyborgHood::Config::L10N_DIR)
|
||
end
|
||
main_domain = "cyborghood"
|
||
components = ["postman"]
|
||
po_dir = "po"
|
||
mo_dir = CyborgHood::Config::L10N_DIR
|
||
msgmerge_options = ['--sort-by-msgid']
|
||
xgettext_options = ['--sort-by-msgid']
|
||
|
||
GetText::Tools::Task.define do |task|
|
||
task.package_name = CyborgHood::PRODUCT
|
||
task.package_version = CyborgHood::VERSION
|
||
task.domain = main_domain
|
||
task.po_base_directory = po_dir
|
||
task.mo_base_directory = mo_dir
|
||
task.files = Dir.glob("lib/**/*.{rb,rhtml}")
|
||
task.msgmerge_options = msgmerge_options
|
||
task.xgettext_options = xgettext_options
|
||
end
|
||
|
||
desc "Update pot/po files to match new version."
|
||
task :updatepo do
|
||
GetText.update_pofiles("cyborghood",
|
||
Dir.glob("lib/**/*.{rb,rhtml}"),
|
||
CyborgHood::PRODUCT + " " + CyborgHood::VERSION)
|
||
# temporary component listing
|
||
["postman"].each do |component|
|
||
GetText.update_pofiles("cyborghood_" + component,
|
||
File.join(CyborgHood::Config::BIN_DIR, component),
|
||
CyborgHood::PRODUCT + " " + CyborgHood::VERSION)
|
||
end
|
||
components.each do |c|
|
||
GetText::Tools::Task.define do |task|
|
||
task.package_name = CyborgHood::PRODUCT
|
||
task.package_version = CyborgHood::VERSION
|
||
task.domain = main_domain + "_" + c
|
||
task.po_base_directory = po_dir
|
||
task.mo_base_directory = mo_dir
|
||
task.files = [ File.join(CyborgHood::Config::BIN_DIR, c) ]
|
||
task.msgmerge_options = msgmerge_options
|
||
task.xgettext_options = xgettext_options
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
[evol] updated i18n rake rules for recent ruby-gettext