Weblate: The web interface does not recognize plural.

Created on 2 Sep 2019  Â·  5Comments  Â·  Source: WeblateOrg/weblate

Describe the bug
I use the en.yml file as the source. In my en.yml file, I have some plural texts. Weblate recognize source's plural but not translated. See below screenshot.

My yml files:

en.yml

distance_in_words:
  about_x_hours:
    one: about 1 hour
    other: about %{count} hours

ko.yml

distance_in_words:
  about_x_hours:
    one: 약 한시간
    other: 약 %{count}시간

There seems to be no problem with the file. And my git commit also sync well with weblate. However, only the plural of the translated file is not recognized.

I'm running a weblate in an ect2 instance with a docker-compose. Database uses postgres within rds.

Screenshots
Weblate screen: https://imgur.com/yqO23Q9

Server configuration and status
Please paste the output of list_versions and check --deploy commands over
here. Depending on installation these can be executed in different way, please
consult https://docs.weblate.org/en/latest/admin/management.html for more
details.

Weblate list_versions:

 * Weblate 3.8
 * Python 3.7.3
 * Django 2.2.4
 * Celery 4.3.0
 * celery-batches 0.2
 * six 1.12.0
 * social-auth-core 3.2.0
 * social-auth-app-django 3.1.0
 * django-appconf 1.0.3
 * translate-toolkit 2.4.0
 * translation-finder 1.6
 * Whoosh 2.7.4
 * defusedxml 0.6.0
 * Git 2.20.1
 * Pillow 5.4.1
 * python-dateutil 2.8.0
 * lxml 4.3.2
 * django-crispy-forms 1.7.2
 * django_compressor 2.3
 * djangorestframework 3.10.2
 * user-agents 2.0
 * jellyfish 0.7.2
 * diff-match-patch 20181111
 * ruamel.yaml 0.16.2
 * tesserocr 2.4.0
 * Mercurial 4.8.2
 * git-svn 2.20.1
 * Database backends: django.db.backends.postgresql
 * Cache backends: avatar:FileBasedCache, default:RedisCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: 127.0.0.1
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 4.15.0-1044-aws (x86_64)

weblate check:

CRITICALS:
?: (weblate.E003) Can not send email ([Errno 111] Connection refused), please check EMAIL_* settings.
    HINT: https://docs.weblate.org/en/weblate-3.8/admin/install.html#out-mail

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.
?: (security.W018) You should not have DEBUG set to True in deployment.

INFOS:
?: (weblate.I021) Error collection is not configured, it is highly recommended for production use
    HINT: https://docs.weblate.org/en/weblate-3.8/admin/install.html#collecting-errors
question

Most helpful comment

The actual reason is that Korean does have single plural form, so it behaves as intended, see http://www.unicode.org/cldr/charts/32/supplemental/language_plural_rules.html#ko

All 5 comments

This should work for ruby yaml files, what file format are you using? Also what framework do you use for localization?

My weblate file template is ruby yaml file and I use Rails default i18n.

I checked my DB, and I found something strange. When I checked the problematic unit record, the source field contains two text with the correct PLURAL_SEPARATOR, but the target field has only one value.

like this:
source: 1h\x1e\x1e%{count}h
target: 한시간

There seems to be a problem with the recognition of the target's plural when initialize units. (when adding component.)

The actual reason is that Korean does have single plural form, so it behaves as intended, see http://www.unicode.org/cldr/charts/32/supplemental/language_plural_rules.html#ko

Oh, I understand. Also Japanese is too. I was misusing the i18n of Rails. Thanks.

Was this page helpful?
0 / 5 - 0 ratings