You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It contains such multiline strings, which are obviously valid:
msgid ""
"By default, the follow-up check is done via the subject of an email. This "
"setting lets you add more fields for which the follow-up check will be "
"executed."
msgstr "默认情况下,通过电子邮件的主题进行跟进检查。这个设置允许你增加更多的字段执行"
"跟进检查。"
But they cause the following error:
SimplePoParser::ParserError: SimplePoParser::ParserErrorSyntax error in lines
Syntax error in msgctxt
Syntax error in msgid
Syntax error in msgstr
Unexpected content after expected message end "\"跟进检"
Parseing result before error: '{:reference=>"db/seeds/settings.rb", :msgid=>["", "By default, the follow-up check is done via the subject of an email. This ", "setting lets you add more fields for which the follow-up check will be ", "executed."], :msgstr=>"默认情况下,通过电子邮件的主题进行跟进检查。这个设置允许你增加更多的字段执行"}'
SimplePoParser filtered backtrace: SimplePoParser::ParserError
/usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:179:in msgstr'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:134:inmsgid'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:114:in msgctxt'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:51:inlines'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:75:in comment'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:49:inlines'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser/parser.rb:25:in parse'
from /usr/local/rvm/gems/ruby-2.7.4/gems/simple_po_parser-1.1.5/lib/simple_po_parser.rb:19:inparse_message'
It seems that such lines are (incorrectly?) expected to be having final white space. Similar multiline strings which contain trailing spaces are processed correctly.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
This came up earlier in the more high-level parser that uses this one as its core arashm/PoParser#24
I would accept a PR that fixes this and doesn't assume multilines start with an empty string, as it's strictly not part of the specification. However, from my experience running msgfmt always creates that syntax with a leading empty string.
dfherr
changed the title
simple_po_parser throws an error on multiline strings which have no space at the end
simple_po_parser throws an error on multiline strings which do not start with an empty string
Mar 18, 2022
We have a valid po file generated from Weblate:
It contains such multiline strings, which are obviously valid:
But they cause the following error:
It seems that such lines are (incorrectly?) expected to be having final white space. Similar multiline strings which contain trailing spaces are processed correctly.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: