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

Plural form for monolingual po is lost in translation #7061

Closed
2 tasks done
xperseguers opened this issue Jan 4, 2022 · 3 comments
Closed
2 tasks done

Plural form for monolingual po is lost in translation #7061

xperseguers opened this issue Jan 4, 2022 · 3 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@xperseguers
Copy link

Describe the issue

I created a source .po file like that:

# Group of attributes for member's details
msgid "Person.Group.Sponsors"
msgid_plural ""
msgstr[0] "Sponsor"
msgstr[1] "Sponsors"

This is thus a monolingual po file. It shows properly in Frontend:
147947082-f2489692-da43-4af5-ac2a-bfa632c8b652

However after translating those plurals, and committing to file system, the translated po files totally miss the plural definitions and store this instead:

msgid "Person.Group.Sponsors"
msgstr "Pate"

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Create a component whose file format is "gettext PO file (monolingual)"
  2. Import/create the sample multilingual po file
  3. Translate to another language (in the example German)
  4. Commit
  5. Check file system

Expected behavior

The localized po file is expected to store this instead:

msgid "Person.Group.Sponsors"
msgid_plural ""
msgstr[0] "Pate"
msgstr[1] "Paten"

(for a 2-plural form language and naturally with more forms in case of Croatian or other language dealing with more than 2 forms for plural).

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

PyPI module

Weblate versions

  • Weblate: 4.10.1
  • Django: 4.0
  • siphashc: 2.1
  • translate-toolkit: 3.5.1
  • lxml: 4.7.1
  • Pillow: 8.4.0
  • bleach: 4.1.0
  • python-dateutil: 2.8.2
  • social-auth-core: 4.1.0
  • social-auth-app-django: 5.0.0
  • django-crispy-forms: 1.13.0
  • oauthlib: 3.1.1
  • django-compressor: 3.1
  • djangorestframework: 3.13.1
  • django-filter: 21.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.4.2
  • setuptools: 44.0.0
  • jellyfish: 0.8.9
  • openpyxl: 3.0.9
  • celery: 5.2.3
  • kombu: 5.2.3
  • translation-finder: 2.10
  • weblate-language-data: 2021.7
  • html2text: 2020.1.16
  • pycairo: 1.20.1
  • pygobject: 3.42.0
  • diff-match-patch: 20200713
  • requests: 2.26.0
  • django-redis: 5.2.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.5.1
  • Cython: 0.29.26
  • misaka: 2.1.1
  • GitPython: 3.1.24
  • borgbackup: 1.1.17
  • pyparsing: 3.0.6
  • pyahocorasick: 1.4.2
  • python-redis-lock: 3.7.0
  • Python: 3.8.10
  • Git: 2.25.1
  • psycopg2: 2.9.3
  • ruamel.yaml: 0.17.19
  • Redis server: 5.0.7
  • PostgreSQL server: 12.9
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: 10.0.1.10
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://localhost:6379, redis://localhost:6379, regular
  • Platform: Linux 5.4.0-91-generic (x86_64)

Weblate deploy checks

n/a

Additional context

First discussed here: #7053

@nijel
Copy link
Member

nijel commented Jan 7, 2022

I can reproduce this in case the string existed before in the translated file as singular, can you please confirm that?

Before Weblate doing the changes, did the file contain following?

msgid "Person.Group.Sponsors"
msgstr ""

@nijel nijel self-assigned this Jan 7, 2022
@nijel nijel added the bug Something is broken. label Jan 7, 2022
@nijel nijel added this to the 4.11 milestone Jan 7, 2022
@nijel nijel closed this as completed in d71663c Jan 7, 2022
@xperseguers
Copy link
Author

I can reproduce this in case the string existed before in the translated file as singular, can you please confirm that?

Before Weblate doing the changes, did the file contain following?

msgid "Person.Group.Sponsors"
msgstr ""

Yes, that's quite possible because some of those labels have indeed switched from singular to plural form.

Manually applied your commit #d71663c and checked, that works!

Thanks for having investigated and fixed it.

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

2 participants