elixir-gettext / expo

Low-level Elixir parser for GNU Gettext files (PO, POT, MO).
Apache License 2.0
13 stars 5 forks source link

Fails to parse lines starting with `#~ ##` #91

Closed lanodan closed 1 year ago

lanodan commented 1 year ago
== Compilation error in file lib/pleroma/web/gettext.ex ==
1092** (Expo.PO.SyntaxError) priv/gettext/en_test/LC_MESSAGES/static_pages.po:16: unexpected token: "#" (codepoint U+0023)
1093    (expo 0.1.0) lib/expo/po.ex:171: Expo.PO.parse_file!/2
1094    (gettext 0.21.0) lib/gettext/compiler.ex:504: Gettext.Compiler.compile_po_file/5
1095    (gettext 0.21.0) lib/gettext/compiler.ex:449: Gettext.Compiler.compile_unified_po_file/4
1096    (elixir 1.11.4) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
1097    (elixir 1.11.4) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
1098    (gettext 0.21.0) expanding macro: Gettext.Compiler.__before_compile__/1
1099    lib/pleroma/web/gettext.ex:5: Pleroma.Web.Gettext (module)

Full log: https://git.pleroma.social/pleroma/pleroma/-/jobs/227931

Permalink to priv/gettext/en_test/LC_MESSAGES/static_pages.po:16: https://git.pleroma.social/pleroma/pleroma/-/blob/2a244b391d8c1d9d8e960532758110928cb5ef7c/priv/gettext/en_test/LC_MESSAGES/static_pages.po#L16

maennchen commented 1 year ago

It seems that I only implemented partial support for the obsolete format based on what is allowed with previous messages. I'll expand that to fully support obsolete. I'm working on a PR.