Chore: remove unattached JH msgids
What does this MR do and why?
- Sort po files.
- Remove unattached msgids, which are not found both in JH and upstream.
Screenshots or screen recordings
How to set up and validate locally
- Save two versions of a po file, such as
left.po
andright.po
- Run
ruby compare.rb left.po right.po
- You should see the po files are matched.
compare.rb
require 'rubygems'
require 'active_support/all'
require 'gettext/po_parser'
def po_parse(file)
parser = GetText::POParser.new
parser.ignore_fuzzy = true
parser.parse_file(file, GetText::PO.new).index_by(&:msgid)
end
left = po_parse(ARGF.argv[0])
right = po_parse(ARGF.argv[1])
left.each do |key, entry|
raise "#{key} not found" if !right.key?(key) || entry.to_s != right[key].to_s
end
p "#{left.count} entries are matched !"
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #1116 (closed)
由 Martin Tan 编辑于