update_translation.rb: normalize po file after copying it

This commit is contained in:
Moritz Bunkus 2016-04-10 15:22:19 +02:00
parent 40c34a15d0
commit f22fc8b426
4 changed files with 13 additions and 12 deletions

View File

@ -31,9 +31,7 @@ require_relative "rake.d/config"
read_config
$verbose = ENV['V'].to_bool
$action_width = 12
$verbose = ENV['V'].to_bool
$build_system_modules = {}
$have_gtest = (c(:GTEST_TYPE) == "system") || (c(:GTEST_TYPE) == "internal")
$gtest_apps = []

View File

@ -5,6 +5,7 @@ require "fileutils"
$git_mutex = Mutex.new
$message_mutex = Mutex.new
$action_width = 12
def puts(message)
$message_mutex.synchronize {

View File

@ -125,7 +125,7 @@ def write_po file_name, items
end
def normalize_po file
puts "NORMALIZE-PO #{file}"
puts_action "NORMALIZE-PO", file
write_po file, read_po(file)
end

View File

@ -3,11 +3,16 @@
require "fileutils"
require "pathname"
require "rake"
require "shellwords"
require "tmpdir"
$po_dir = File.absolute_path(File.dirname(__FILE__) + "/../../po")
$man_po_dir = File.absolute_path(File.dirname(__FILE__) + "/../../doc/man/po4a/po")
$mtx_dir = File.absolute_path(File.dirname(__FILE__) + "/../..")
$po_dir = "#{$mtx_dir}/po"
$man_po_dir = "#{$mtx_dir}doc/man/po4a/po"
require "#{$mtx_dir}/rake.d/helpers"
require "#{$mtx_dir}/rake.d/po"
module AddPo
def self.handle_po file_name
@ -32,6 +37,8 @@ module AddPo
File.chmod 0644, target
puts "#{file_name}#{target}"
normalize_po target
end
def self.unpack_p7z file_name
@ -124,9 +131,4 @@ module AddPo
end
end
begin
# Running under Rake?
Rake
rescue
ARGV.each { |file_name| AddPo::add File.absolute_path(file_name) }
end
ARGV.each { |file_name| AddPo::add File.absolute_path(file_name) }