Skip to content

Chore: remove unattached JH msgids

Martin Tan请求将1116-remove-unattached-msgids合并到main-jh

What does this MR do and why?

  1. Sort po files.
  2. Remove unattached msgids, which are not found both in JH and upstream.

Screenshots or screen recordings

How to set up and validate locally

  1. Save two versions of a po file, such as left.po and right.po
  2. Run ruby compare.rb left.po right.po
  3. 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.

Closes #1116 (closed)

Martin Tan 编辑于

合并请求报告

加载中