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

Plurals are not included in a custom download for various formats (base format is i18next JSON) #5981

Closed
4 tasks done
pleunv opened this issue May 10, 2021 · 6 comments
Closed
4 tasks done
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@pleunv
Copy link

pleunv commented May 10, 2021

I have a project of which the base language files are JSON (i18next). Plurals are configured with either a _plural or _{count} suffix. When attempting to create a custom download, plurals are not included in various formats. Changing the filters does not appear to have an effect. The translation status of the individual strings ("not translated" or "translated") also does not appear to make a difference.
In one case I'm also getting a "Page not found" error (gettext MO).

Plurals are included in the following formats:

  • gettext PO
  • XLIFF with gettext extensions
  • Android String Resource

Plurals are not included in the following formats:

  • XLIFF 1.1
  • CSV
  • XLSX
  • JSON (even if the source is JSON)
  • iOS strings

Not applicable:

  • TBX
  • TMX

Gives a "Page not found":

  • gettext MO

I already tried

  • I've read and searched the docs and did not find the answer there.
  • Tried with both translated and untranslated plurals.
  • Tried exporting a custom download in the original base language, plurals are also not present here.
  • Tried changing the filters.

To Reproduce the issue

Steps to reproduce the behavior:

  1. Set up a project with one or more JSON plural strings (_plural or _{count}).
  2. Navigate to an individual component language.
  3. Click "Files" -> "Customize download".
  4. Select one of the formats outlined above.
  5. Open up the downloaded file, search for the expected plural key.

There's an additional minor issue I noticed here: when you want to download multiple formats, the "Download" button stops working after the first download. You have to refresh the page to get it to work again. Happy to open up a new issue for this one.

Expected behavior

  • I would expect consistent export behavior for all formats, and all strings, including plural forms, to be included by default.

Screenshots

  • N/A

Exception traceback

  • N/A

Server configuration and status

Weblate installation: Docker (4.6.0)

 * Weblate: 4.6
 * Django: 3.2
 * siphashc: 2.1
 * translate-toolkit: 3.3.4
 * lxml: 4.6.3
 * Pillow: 8.2.0
 * bleach: 3.3.0
 * python-dateutil: 2.8.1
 * social-auth-core: 4.1.0
 * social-auth-app-django: 4.0.0
 * django-crispy-forms: 1.11.2
 * oauthlib: 3.1.0
 * django-compressor: 2.4.1
 * djangorestframework: 3.12.4
 * 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.7
 * celery: 5.0.5
 * kombu: 5.0.2
 * translation-finder: 2.9
 * weblate-language-data: 2021.4
 * html2text: 2020.1.16
 * pycairo: 1.16.2
 * pygobject: 3.30.4
 * diff-match-patch: 20200713
 * requests: 2.25.1
 * django-redis: 4.12.1
 * hiredis: 2.0.0
 * sentry_sdk: 1.0.0
 * Cython: 0.29.23
 * misaka: 2.1.1
 * GitPython: 3.1.14
 * borgbackup: 1.1.16
 * pyparsing: 2.4.7
 * pyahocorasick: 1.4.2
 * Python: 3.7.3
 * Git: 2.20.1
 * psycopg2: 2.8.6
 * psycopg2-binary: 2.8.6
 * phply: 1.2.5
 * chardet: 4.0.0
 * ruamel.yaml: 0.17.4
 * tesserocr: 2.5.1
 * akismet: 1.1
 * boto3: 1.17.53
 * zeep: 4.0.0
 * aeidon: 1.9
 * iniparse: 0.5
 * mysqlclient: 2.0.3
 * Mercurial: 5.7.1
 * git-svn: 2.20.1
 * git-review: 2.0.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: smtp.mandrillapp.com
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 5.4.0-1046-azure (x86_64)

Weblate deploy checks

System check identified some issues:

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-4.6/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.6/admin/backup.html
?: (weblate.I031) New Weblate version is available, please upgrade to 4.6.2.
	HINT: https://docs.weblate.org/en/weblate-4.6/admin/upgrade.html

Additional context

  • N/A
@nijel
Copy link
Member

nijel commented May 10, 2021

These formats do not support storing plurals. See also https://docs.weblate.org/en/latest/formats.html#translation-types-capabilities

The gettext MO exporter is only supported from gettext PO files.

@nijel nijel added the question This is more a question for the support than an issue. label May 10, 2021
@pleunv
Copy link
Author

pleunv commented May 10, 2021

Thanks for the quick response. I wrongly assumed export (and import) would just do a key-value mapping if the source supported it and there already were existing plural keys present.

I suppose this also means that, if we were to manually generate excel files that included the _plural keys from the i18next JSON source (outside of weblate), they would not be mapped correctly on upload?

For context: we have some translators that only want to work on excel files. My workaround was to export/import xlsx for them but I suppose that's not a viable route in that case.

nijel added a commit that referenced this issue May 10, 2021
@nijel
Copy link
Member

nijel commented May 10, 2021

I suppose this also means that, if we were to manually generate excel files that included the _plural keys from the i18next JSON source (outside of weblate), they would not be mapped correctly on upload?

No, it would not work.

@pleunv
Copy link
Author

pleunv commented May 10, 2021

Alrighty, thanks for clarifying.

@github-actions
Copy link

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!

@github-actions
Copy link

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants