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

How to show Plurals view on ARB file #6919

Closed
2 tasks done
jack24254029 opened this issue Dec 8, 2021 · 4 comments
Closed
2 tasks done

How to show Plurals view on ARB file #6919

jack24254029 opened this issue Dec 8, 2021 · 4 comments
Labels
duplicate Similar issue or pull request already exists.

Comments

@jack24254029
Copy link

Describe the issue

I want to show below view on ARB file.
image

I follow the official document to use plurals on ARB file, like this
(P.S. you can search Messages With Plurals on the official document to find plurals)

{
    "@@locale": "en",
    "minuteAgo": "{minute, plural, =1{{minute} minute ago} other{{minute} minutes ago}}",
    "@minuteAgo": {},
}

But the result is
image

I already tried

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

Steps to reproduce the behavior

No response

Expected behavior

image

Screenshots

image

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.9.1
  • Django: 3.2.9
  • siphashc: 2.1
  • translate-toolkit: 3.5.1
  • lxml: 4.6.4
  • 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: 2.4.1
  • djangorestframework: 3.12.4
  • django-filter: 21.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.4.0
  • setuptools: 58.5.3
  • jellyfish: 0.8.9
  • openpyxl: 3.0.9
  • celery: 5.2.0
  • kombu: 5.2.2
  • translation-finder: 2.10
  • weblate-language-data: 2021.6
  • html2text: 2020.1.16
  • pycairo: 1.16.2
  • pygobject: 3.38.0
  • diff-match-patch: 20200713
  • requests: 2.26.0
  • django-redis: 5.0.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.5.0
  • Cython: 0.29.24
  • 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.9.2
  • Git: 2.30.2
  • psycopg2: 2.9.2
  • psycopg2-binary: 2.9.2
  • phply: 1.2.5
  • chardet: 4.0.0
  • ruamel.yaml: 0.17.17
  • tesserocr: 2.5.2
  • akismet: 1.1
  • boto3: 1.20.10
  • zeep: 4.1.0
  • aeidon: 1.10.1
  • iniparse: 0.5
  • mysqlclient: 2.1.0
  • Mercurial: 5.9.3
  • git-svn: 2.30.2
  • git-review: 2.1.0
  • Redis server: 6.2.1
  • PostgreSQL server: 13.2
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: email-smtp.us-west-2.amazonaws.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://cache:6379/1, redis://cache:6379/1, regular
  • Platform: Linux 3.10.0-1127.10.1.el7.x86_64 (x86_64)

Weblate deploy checks

System check identified some issues:

WARNINGS:
?: (security.W018) You should not have DEBUG set to True in deployment.

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.9.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.9.1/admin/backup.html

System check identified 3 issues (1 silenced).

Additional context

No response

@nijel
Copy link
Member

nijel commented Dec 14, 2021

Weblate displays plurals for formats with separate strings for each plural. When format is using logic like this, Weblate cannot render strings separately as the condition can be different for each string and can even be only on part of the string.

@jack24254029
Copy link
Author

Thank you for response.

In this case, will the feature be added in the future?

@nijel
Copy link
Member

nijel commented Dec 15, 2021

I don't think so - as the expression in the translation can be arbitrary, there is no mapping to the fixed list of plurals that Weblate uses.

What might be added is GUI editor for these kind of expressions, see #2967. The basic syntax checking and hightlight is already implemented via #6582

@nijel nijel added the duplicate Similar issue or pull request already exists. label Dec 15, 2021
@nijel
Copy link
Member

nijel commented Dec 15, 2021

Duplicate of #2967

@nijel nijel marked this as a duplicate of #2967 Dec 15, 2021
@nijel nijel closed this as completed Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Similar issue or pull request already exists.
Projects
None yet
Development

No branches or pull requests

2 participants