WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.63k stars 1.02k forks source link

Laravel plural support is broken #4911

Closed A1aZ closed 3 years ago

A1aZ commented 3 years ago

Describe the bug

Laravel plural support is broken https://docs.weblate.org/en/latest/formats.html?highlight=laravel#laravel-php-strings

To Reproduce the bug

Import a Laravel repo as a component. Translate the string which has been split by | . The UI will only display the first part of the translate string ( screenshot below). The api also return this string as non-plural string.

Expected behavior

The plural string should be parsed correctly.

Screenshots Plural translations are missing. image But the source code is correct. image

Server configuration and status

Weblate installation: Docker

 * Weblate: 4.3.1
 * Django: 3.1.2
 * siphashc: 2.1
 * Whoosh: 2.7.4
 * translate-toolkit: 3.1.1
 * lxml: 4.6.1
 * Pillow: 8.0.0
 * bleach: 3.2.1
 * python-dateutil: 2.8.1
 * social-auth-core: 3.3.3
 * social-auth-app-django: 4.0.0
 * django-crispy-forms: 1.9.2
 * oauthlib: 3.1.0
 * django-compressor: 2.4
 * djangorestframework: 3.12.1
 * django-filter: 2.4.0
 * django-appconf: 1.0.4
 * user-agents: 2.2.0
 * filelock: 3.0.12
 * setuptools: 40.8.0
 * jellyfish: 0.8.2
 * openpyxl: 3.0.5
 * celery: 4.4.7
 * kombu: 4.6.11
 * translation-finder: 2.4
 * weblate-language-data: 2020.10
 * html2text: 2020.1.16
 * pycairo: 1.16.2
 * pygobject: 3.30.4
 * diff-match-patch: 20200713
 * requests: 2.24.0
 * django-redis: 4.12.1
 * hiredis: 1.1.0
 * sentry_sdk: 0.19.1
 * Cython: 0.29.21
 * misaka: 2.1.1
 * GitPython: 3.1.9
 * borgbackup: 1.1.14
 * pyparsing: 2.4.7
 * Python: 3.7.3
 * Git: 2.20.1
 * psycopg2: 2.8.6
 * psycopg2-binary: 2.8.6
 * phply: 1.2.5
 * chardet: 3.0.4
 * ruamel.yaml: 0.16.12
 * tesserocr: 2.5.1
 * akismet: 1.1
 * boto3: 1.16.1
 * zeep: 4.0.0
 * aeidon: 1.7.0
 * iniparse: 0.5
 * mysqlclient: 2.0.1
 * Mercurial: 5.5.2
 * git-svn: 2.20.1
 * git-review: 1.28.0
 * Redis server: 5.0.9
 * PostgreSQL server: 11.8
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: xxxx
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 3.10.0-1062.18.1.el7.x86_64 (x86_64)

Weblate deploy checks

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.I028) Backups are not configured, it is highly recommended for production use
    HINT: https://docs.weblate.org/en/weblate-4.3.1/admin/backup.html
?: (weblate.I031) New Weblate version is available, please upgrade to 4.3.2.
    HINT: https://docs.weblate.org/en/weblate-4.3.1/admin/upgrade.html

Exception traceback

NO

Additional context

NO

nijel commented 3 years ago

Is your translation configured as Laravel files?

github-actions[bot] commented 3 years ago

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you!

nijel commented 3 years ago

Nevermind, I've reproduced this locally....

github-actions[bot] commented 3 years ago

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