Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gettext PO - Error 500 when pushing a new translation with a source reference #97

Open
aplumez opened this issue Jul 10, 2024 · 1 comment
Assignees

Comments

@aplumez
Copy link

aplumez commented Jul 10, 2024

Description

When using tolgee push for .PO files containing source references, the import fails with a 500 error.

If we import the same file (with the source references) from the website, it works perfectly.

How to reproduce

  1. Pull the translations with the CLI - example of resulting file:
msgid ""
msgstr ""
"Language: fr\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: Tolgee\n"

msgid "Login"
msgstr "Connexion"

msgid "Password"
msgstr "Mot de passe"
  1. Add a new translation with a source reference (note that source references on existing keys do not produce the error):
msgid ""
msgstr ""
"Language: fr\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: Tolgee\n"

#: dir/file.py:42
msgid "A new translation"
msgstr "En français!"

msgid "Login"
msgstr "Connexion"

msgid "Password"
msgstr "Mot de passe"
  1. Push the translations with the CLI, and you'll get the following result:
🐭✅     Reading files...
🐭✅     Uploading files...
🐭✅     Importing...
🔴 API reported a server error. Please try again later [status: 500, code: unexpected_error_occurred]
  1. Remove the source reference and you'll be able to push
@stepan662 stepan662 self-assigned this Jul 12, 2024
@stepan662
Copy link
Contributor

Seems like the .po parser is somehow broken, however it's a mystery why it works when imported through platform

@stepan662 stepan662 assigned JanCizmar and stepan662 and unassigned stepan662 Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants