如何在.pot文件中排除DBGrid.Column.FieldName
我用Delphi 6做了一个应用程序。 之后,我提取了一个 .pot 文件,其中包含所有要翻译的字符串。 问题是有些字符串不需要翻译,如果翻译就会产生问题。
其中之一是 TDBGrid.Columns[x].FiedlName
我尝试将此行放入 ggexclude.cfg 文件中,但它们不起作用。
# exclude all occurences of the specified class
# and property in all DFM files in or below the
# path where "ggexclude.cfg" is in
[exclude-form-class-property]
TDBGrid......FieldName
TDBGrid.....FieldName
TDBGrid....FieldName
TDBGrid...FieldName
TDBGrid..FieldName
TDBGrid.FieldName
item.FieldName
TDBGrid.Columns.FieldName
TDBGrid.Columns.TDBGridColumns
TDBGrid.Columns.TDBGridColumns.FieldName
TDBGrid.Columns.Item.FieldName
TColumn.FieldName
TDBGridColumns.FieldName
FieldName
*.FieldName
我认为问题是在 .dfm 文件中解析器不理解它们是 TColumn 对象的一部分
inherited DBGTable: TDBGrid
Height = 309
DataSource = DMUsers.DSUser
Columns = <
item
Expanded = False
FieldName = 'USER'
Visible = True
end
item
Expanded = False
FieldName = 'CODE'
Width = 31
Visible = True
end
item
Expanded = False
FieldName = 'NAME'
Width = 244
Visible = True
end>
end
有人有解决方法吗?
我不能相信自动ignore.pot,因为有一些字符串会导致误报。
I made an application with Delphi 6.
After that I extracted a .pot file with all the strings to translate.
The problem is that there are strings that don't have to be tranlated, and if translated will generate problems.
Une of this is TDBGrid.Columns[x].FiedlName
I tryed to put this lines into the ggexclude.cfg file, but they doesn't work.
# exclude all occurences of the specified class
# and property in all DFM files in or below the
# path where "ggexclude.cfg" is in
[exclude-form-class-property]
TDBGrid......FieldName
TDBGrid.....FieldName
TDBGrid....FieldName
TDBGrid...FieldName
TDBGrid..FieldName
TDBGrid.FieldName
item.FieldName
TDBGrid.Columns.FieldName
TDBGrid.Columns.TDBGridColumns
TDBGrid.Columns.TDBGridColumns.FieldName
TDBGrid.Columns.Item.FieldName
TColumn.FieldName
TDBGridColumns.FieldName
FieldName
*.FieldName
I think that the problem is that within the .dfm file the parser doesn´t understand that they are part of a TColumn object
inherited DBGTable: TDBGrid
Height = 309
DataSource = DMUsers.DSUser
Columns = <
item
Expanded = False
FieldName = 'USER'
Visible = True
end
item
Expanded = False
FieldName = 'CODE'
Width = 31
Visible = True
end
item
Expanded = False
FieldName = 'NAME'
Width = 244
Visible = True
end>
end
Does anybody have a workarround?
I can't trust the automatic ignore.pot, because there are some strings that cause false possitives.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ggexinclude.cfg-File 的文档指出您无法访问属于集合一部分的项目:
因此,解决方法是排除整个 Columns-Collection:
但这样您也会丢失 Title.Caption。
我看到的唯一其他解决方法是修改 dxgettext。恕我直言,以下内容将是很好的:
编辑:我想链接到 ggexclude.cfg 文档,但我现在无法在网上找到它。因此,我可以随意发布文档,因为它保存在我自己的 ggexclude.cfg 文件中 - 但没有任何保证:
The documentation to the ggexclude.cfg-File states that you cannot access items, that are part of a collection:
So the workaround would be to exclude the whole Columns-Collection:
But this way you will lose Title.Caption too.
The only other workaround I see, would be to modify dxgettext. The following would be nice to have IMHO:
Edit: I wanted to link to the ggexclude.cfg-documentation, but I cannot find it online right now. So I feel free to post the documentation as it is saved in my own ggexclude.cfg-file - but without any guarantee:
您可能应该尝试运行
然后打开 autogenignore.po 并找到它声明所有排除的字段名的特殊方式(这是 msgmkignore 的工作)。每次自动生成时,您都必须查看自动生成的排除规则。您似乎正在尝试手动生成所有排除规则。在我看来,您最好采用自动生成的包含内容并手动检查它们以排除所有数据库字段名称和列名称。
正如您在问题中所述,您显然不能将“忽略”的整个工作交给 msgmkignore 工具,但您可以使用您的大脑加上此工具,并将这些结果结合起来。
You should probably try running
Then open up the autogenignore.po and find the special way it has declared all your fieldname excludes (Thats the job of msgmkignore). Every time you auto-generate it you then have to review the auto-generated exclusion rules. It seems you're trying to generate all your exclusion rules by hand. It looks to me like you'd be better off taking the auto-generated includes and reviewing them by hand to exclude all the database field names and column names.
You obviously can't hand the entire job of "ignores" to the msgmkignore tool, as you state in your question, but you can use your brain, plus this tool, and combine those results.