gpt4 book ai didi

translation - poedit 显示似乎无法修复的错误

转载 作者:行者123 更新时间:2023-12-02 07:29:42 27 4
gpt4 key购买 nike

我在使用 PoEdit 时遇到问题我使用了一个名为 PO-Auto-Translator 的软件来翻译 po 文件,一旦完成,我想继​​续使用 poedit 编辑文件,当我尝试保存时,我得到了很多错误.. .

    04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:46: missing 'msgstr' section
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:46:22: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:51: missing 'msgstr' section
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:51:22: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:52: keyword "$s" unknown
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:795: keyword "Upload" unknown
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:795:55: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:1583: missing 'msgstr' section
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:1583:27: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:1584: keyword "s" unknown
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:1597:28: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:1597: keyword "s" unknown
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4162:14: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4163: end-of-line within string
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4167:14: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4167: keyword "Admin" unknown
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4168: end-of-line within string
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4172:14: syntax error
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4173: end-of-line within string
04/21/14 22:39:12: C:\Users\home\Desktop\translation.po:4176:31: syntax error
04/21/14 22:39:12: C:\Program Files (x86)\Poedit\GettextTools\bin\msgfmt.exe: too many errors, aborting

我将该文件与其他未显示此错误且未发现问题的文件进行了比较。

这里是翻译的前 50 行

# Translation of translation
msgid ""
msgstr ""
"Project-Id-Version: translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-05 10:43+0100\n"
"PO-Revision-Date: 2014-04-21 22:39+0200\n"
"Last-Translator: \n"
"Language-Team: AppThemes\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.4\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_nx:1,2;_x:1,2c;_ex:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:1,2,3c\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: .\n"

#: 404.php:22
msgid "Whoops! Page Not Found."
msgstr "אופס! דף לא נמצא."

#: 404.php:24
#: 404.php:44 search.php:77 includes/theme-actions.php:218
msgid "Sponsored Links"
msgstr "קישורים ממומנים"

#: attachment.php:19
#, php-format
msgid "Return to %s"
msgstr "חזור אל% s"

#: attachment.php:20
#, php-format
msgid "← Return to %s"
msgstr "? חזור אל% s"

#: attachment.php:31
#, php-format
msgid "<span class="%1$s">By</span> %2$s" /line 46
msgstr "ש"

#: attachment.php:44
#, php-format
msgid "<span class="%1$s">Uploaded</span> %2$s"
msgstr "<span class="%1$s">Uploaded</span> %2$s"

#: attachment.php:55
#, php-format
msgid "Full size is %s pixels"
msgstr "גודל מלא הוא פיקסלים% s"

谁能看到我的文件有什么问题?

最佳答案

您的 PO 文件无效 — 它不遵循 PO 文件格式语法,也没有在字符串文字中转义引号。 msgid "foo"bar" 无效,与msgid "foo\"bar" 不同,类似于C、PHP 或许多其他语言。

IMNSHO,你应该立即抛弃任何生成如此严重损坏的 PO 文件的工具(它绝对不是 X-Generator header 所暗示的 Poedit),并用实际知道其输出的东西替换它格式。如xgettext标准的gettext字符串提取工具。支持PHP就好了。

如果该工具是国产的,这里有一个非常由 Pology 的 Chusslove Illich 对 PO 格式的很好的描述:http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html (非官方的,但比 GNU gettext 自己的手册好得多)。如果您在任何代码中编写或读取 PO 文件,我强烈推荐它。

关于translation - poedit 显示似乎无法修复的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23205647/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com