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

Conflict of phrases with same msgid but different msgctxt #4130

Closed
mberdnikov opened this issue Jul 4, 2020 · 3 comments · Fixed by #5085
Closed

Conflict of phrases with same msgid but different msgctxt #4130

mberdnikov opened this issue Jul 4, 2020 · 3 comments · Fixed by #5085
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@mberdnikov
Copy link

mberdnikov commented Jul 4, 2020

Describe the bug

Hi!

For phrases that have the same msgid with different msgctxt in the PO file (monolingual) I get an alert "The component contains several duplicated translation strings."

What's my mistake?

When I try to translate, I find only one version of the phrase and I don’t see for what context this phrase is. I tried to translate - the last phrase was translated.

To Reproduce

menu/ru/trans.po
msgid ""
msgstr ""
"Language: ru\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"

msgctxt "company"
msgid "employee"
msgstr "Сотрудники"

msgctxt "companyv2"
msgid "employee"
msgstr "Сотрудники"
menu/en/trans.po
msgid ""
msgstr ""
"Language: en\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"

msgctxt "company"
msgid "employee"
msgstr "Employees"

msgctxt "companyv2"
msgid "employee"
msgstr "Employees"
menu/uk/trans.po
msgid ""
msgstr ""
"Language: uk\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: Weblate 4.1.1\n"

msgctxt "company"
msgid "employee"
msgstr ""

msgctxt "companyv2"
msgid "employee"
msgstr "Співробітники"
Settings

image

Expected behavior

Phrases with the same msgid and different msgctxt are different phrases.

Screenshots

image

Server configuration and status

list_version
 * Weblate: 4.1.1
 * Django: 3.0.7
 * siphashc: 1.3
 * Whoosh: 2.7.4
 * translate-toolkit: 3.0.0
 * lxml: 4.5.1
 * Pillow: 7.1.2
 * bleach: 3.1.5
 * python-dateutil: 2.8.1
 * social-auth-core: 3.3.3
 * social-auth-app-django: 3.4.0
 * django-crispy-forms: 1.9.1
 * oauthlib: 3.1.0
 * django-compressor: 2.4
 * djangorestframework: 3.11.0
 * django-filter: 2.3.0
 * django-appconf: 1.0.4
 * user-agents: 2.1
 * filelock: 3.0.12
 * setuptools: 40.8.0
 * jellyfish: 0.8.2
 * openpyxl: 3.0.1
 * celery: 4.4.5
 * kombu: 4.6.10
 * translation-finder: 2.1
 * html2text: 2020.1.16
 * pycairo: 1.16.2
 * pygobject: 3.30.4
 * diff-match-patch: 20181111
 * requests: 2.24.0
 * django-redis: 4.12.1
 * hiredis: 1.0.1
 * sentry_sdk: 0.15.1
 * Cython: 0.29.20
 * misaka: 2.1.1
 * GitPython: 3.1.3
 * borgbackup: 1.1.13
 * pyparsing: 2.4.7
 * Python: 3.7.3
 * Git: 2.20.1
 * psycopg2: 2.8.5
 * psycopg2-binary: 2.8.5
 * phply: 1.2.5
 * chardet: 3.0.4
 * ruamel.yaml: 0.16.10
 * tesserocr: 2.5.1
 * akismet: 1.1
 * boto3: 1.14.6
 * zeep: 3.4.0
 * aeidon: 1.7.0
 * iniparse: 0.5
 * mysqlclient: 1.4.6
 * Mercurial: 5.4.1
 * git-svn: 2.20.1
 * git-review: 1.28.0
 * hub: 2.13.0
 * lab: 0.16
 * Redis server: 4.0.12
 * PostgreSQL server: 9.6.11
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: mx.ibc.ru
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 4.15.0-109-generic (x86_64)

Weblate deploy checks

deploy --check
System check identified some issues:

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-4.1.1/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-4.1.1/admin/backup.html
@nijel
Copy link
Member

nijel commented Jul 4, 2020

For monolingual files only one of msgid or msgctx is currently used as string identifier.

@nijel nijel added enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. labels Jul 4, 2020
@github-actions
Copy link

github-actions bot commented Jul 4, 2020

This issue has been put aside. Currently, it is unclear whether it will ever be implemented as it seems to cover too narrow of a use case or doesn't seem to fit into Weblate. Please try to clarify the use case or consider proposing something more generic to make it useful to more users.

@nijel nijel added this to the 4.4.1 milestone Dec 16, 2020
@nijel nijel self-assigned this Dec 22, 2020
@nijel nijel removed the undecided These features might not be implemented. Can be prioritized by sponsorship. label Dec 22, 2020
nijel added a commit to nijel/weblate that referenced this issue Dec 22, 2020
Sometimes both are used and needed to differentiate scope of the
translation.

Fixes WeblateOrg#4130
nijel added a commit that referenced this issue Dec 22, 2020
Sometimes both are used and needed to differentiate scope of the
translation.

Fixes #4130
@github-actions
Copy link

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
enhancement Adding or requesting a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants