0

I'm using a hosted weblate.

I'm in the "Files" section of my component configuration. Below is my setup.


Translation files:

  • File format: gettext PO file
  • Filemask: src/translations/*.po
  • Language filter: ^[^.]+$

Monolingual translations:

  • All fields empty
  • Edit base file checked

Adding new languages:

  • Template for new translations: src/translations/template.pot
  • Adding new translation: Create new language file
  • Language code style: Default based on the file format

I can't validate these settings, I have an error below fields "Template for new translations" and "Adding new translation": The error is "Unrecognized base file for new translations".

I'm am 100% sure the pot file exists on the branch weblate is configured to use and also on master and that the path is correct.

Here are the first few lines of the pot file:

"Content-Type: text/plain; charset=UTF-8\n"

#: src/screens/CardList/CardList.texts.js:9
msgctxt "CardList"
msgid "hello"
msgstr ""

#: src/screens/CardList/CardList.texts.js:11
msgctxt "CardList"
msgid "cards"
msgstr ""

I don't understand what is happening, am I doing something wrong ?

Apolo
  • 3,844
  • 1
  • 21
  • 51

1 Answers1

1

The header of the file seems stripped. At least you should prepend following to make it syntactically valid:

msgid ""
msgstr ""

See https://github.com/WeblateOrg/weblate/blob/master/weblate/locale/django.pot for real life POT file

Michal Čihař
  • 9,799
  • 6
  • 49
  • 87
  • This is my fault, I made a script to strip these because I tough it was a bug. Do you know why it needs to have these empty definitions at the top ? – Apolo Aug 07 '20 at 08:48
  • 1
    The empty msgid contains header which includes metadata about the translation. You can remove it, but you have to do that completely including all values, you've kept last part of the msgstr value. – Michal Čihař Aug 07 '20 at 12:05