0

dxgettext Extract Translations GUI 有一个开关,Add likely ignores to ignore po file但在将 dxgettext 作为命令行调用时我没有看到对应的参数。

我正在构建一个批处理文件,在准备新版本时执行多项任务,我希望翻译提取步骤的行为与从 UI 调用时相似,将显然不需要翻译的字符串移至单独的文件。

这些是我正在使用的参数:

dxgettext -b MyProjectPath --delphi --nonascii -r --useignorepo --preserveUserComments

谢谢你。

4

2 回答 2

1

该对话框由 GUI ggdxgettext 工具提供。

从外观上看,dxgettext 命令行工具默认自动执行此操作:

  item := dom.order.Objects[j] as TPoEntry;
  ignoreitem:=ignorelist.Find(item.MsgId);
  if ignoreitem=nil then begin
    newitem:=TPoEntry.Create;
    newitem.Assign(item);
    if not IsProbablyTranslatable( newitem,
                                   nil,
                                   nil) then
      ignorelist.Add(newitem)
    else
      FreeAndNil (newitem);
  end else begin
    ignoreitem.AutoCommentList.Text:=item.AutoCommentList.Text;
  end;

但我不太确定,因为我没有尝试分析程序流程。

源代码可在 SourceForge 上获得,因此您可以自行检查。

于 2020-10-30T16:08:32.693 回答
1

我和你有同样的问题。为我的 OpenSource图像管理器应用程序解决它,我使用以下批处理文件从源中提取字符串并删除所有要忽略的字符串:

c:\Utils\dxgettext -b . --delphi --nonascii --no-wrap -o:msgid -o .
c:\Utils\msgremove default.po -i OvbImgOrganizerLanguageIgnore.po -o OvbImgOrganizerLanguage.pot --no-wrap
del OvbImgOrganizerLanguageDefaultBak.po
ren default.po OvbImgOrganizerLanguageDefaultBak.po

此批处理以当前目录作为源代码目录运行。

于 2020-10-30T12:35:08.123 回答