diff --git a/Rakefile b/Rakefile index 6bf9ca774..d67ddadd6 100755 --- a/Rakefile +++ b/Rakefile @@ -319,23 +319,7 @@ end # Qt files rule '.h' => '.ui' do |t| - temp = Tempfile.new("mkvtoolnix-uic") - begin - temp.close - - runq "uic", t.source, "#{c(:UIC)} -tr QPTR #{t.sources.join(" ")} > #{temp.path}" - - # Convert calls to QPTR(…, 0) to QT(…) - output = IO. - readlines(temp.path). - map { |line| line.force_encoding("UTF-8").gsub(/QPTR\((.+?\"), 0\)/, 'QTR(\1)') }. - join("") - - IO.write(t.name, output, encoding: "UTF-8", mode: "w") - - ensure - temp.unlink - end + runq "uic", t.source, "#{c(:UIC)} --translate QTR #{t.sources.join(" ")} > #{t.name}" end rule '.cpp' => '.qrc' do |t| @@ -376,14 +360,9 @@ file "po/mkvtoolnix.pot" => $all_sources + $all_headers + $gui_ui_h_files + %w{R keywords = %w{--keyword=Y --keyword=NY:1,2} # singular & plural forms returning std::string keywords += %w{--keyword=YF --keyword=NYF:1,2} # singular & plural forms returning std::string which aren't format strings - keywords += %w{--keyword=PY:1c,2} # singular form with context returning std::string - keywords += %w{--keyword=PNY:1c,2,3} # plural form with context returning std::string keywords += %w{--keyword=YT} # singular form returning translatable_string_c keywords += %w{--keyword=QTR} # singular form returning QString, used by uic - keywords += %w{--keyword=QPTR:2c,1} # singular form with context returning QString, used by uic keywords += %w{--keyword=QY --keyword=QNY:1,2} # singular & plural forms returning QString - keywords += %w{--keyword=QPY:1c,2} # singular form with context returning QString - keywords += %w{--keyword=QPNY:1c,2,3} # plural form with context returning QString keywords += %w{--keyword=QYH} # singular form returning HTML-escaped QString flags = %w{--flag=QY:1:no-c-format --flag=QNY:1:no-c-format} diff --git a/src/common/common.h b/src/common/common.h index f19d6097c..a7a6ed449 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -78,15 +78,11 @@ namespace brng = boost::range; # if !defined Y # define Y(s) gettext(s) # define NY(s_singular, s_plural, count) ngettext(s_singular, s_plural, count) -# define PY(context, s) pgettext(context, s) -# define PNY(context, s_singular, s_plural, count) pngettext(context, s_singular, s_plural, count) # endif #else /* HAVE_LIBINTL_H */ # if !defined Y # define Y(s) (s) # define NY(s_singular, s_plural, count) ((count) != 1 ? (s_plural) : (s_singular)) -# define PY(context, s) (s) -# define PNY(context, s_singular, s_plural, count) ((count) != 1 ? (s_plural) : (s_singular)) # endif #endif diff --git a/src/common/qt.h b/src/common/qt.h index f137e8191..61fd8965b 100644 --- a/src/common/qt.h +++ b/src/common/qt.h @@ -24,8 +24,7 @@ #define QY(s) to_qs(Y(s)) #define QYH(s) to_qs(Y(s)).toHtmlEscaped() #define QNY(singular, plural, count) to_qs(NY(singular, plural, count)) -#define QTR(s) to_qs(Y(s)) -#define QPTR(s, context) to_qs(PY(context, s)) +#define QTR(s, dummy) to_qs(Y(s)) inline QChar to_qs(char const source) {