duplicate message definition for empty string

Created on 8 July 2021, over 3 years ago
Updated 6 February 2023, about 2 years ago

Problem/Motivation

I'd like to export a list of all translation strings with `drush locale:export en | msguniq -`.

However, `msquniq` fails with a fatal error due to duplication of the empty string msgid:

$ ./bin/drush locale:export en | msguniq
: warning: Charset missing in header.
                  Message conversion to user's charset will not work.
:4632: duplicate message definition...
:4: ...this is the location of the first definition
msguniq: found 1 fatal error
$ ./bin/drush locale:export en | head -6             
# Global translation of ...........
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2021-07-08 10:28+0000\n"
testing@xpc:~/src$ 

and the lines 4632-4633

$ ./bin/drush locale:export en | head -4633 | tail -2
msgid ""
msgstr ""

Steps to reproduce

Not sure HOW the empty message string got in, so no steps to reproduce available.

This issue is identical to the report in https://www.drupal.org/project/drupal/issues/1940436 β†’ - so apparently there's a general pattern, spanning generations that this problem "returns".

So it's most likely something trivial like "import doesn't check whether msgid is empty :-p

Proposed resolution

- Never export the empty string at the API level
- Change the data model or API to raise a violation when trying to store the equivalent of an empty string for source.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

9.5

Component
LocaleΒ  β†’

Last updated 4 days ago

Created by

πŸ‡¨πŸ‡­Switzerland spiffl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024