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

i18next plural form missing in Json response #7540

Closed
2 tasks done
phipic opened this issue Apr 25, 2022 · 5 comments
Closed
2 tasks done

i18next plural form missing in Json response #7540

phipic opened this issue Apr 25, 2022 · 5 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@phipic
Copy link

phipic commented Apr 25, 2022

Describe the issue

Hi,

I am using i18next format for my translations and pluralizations. I added some translation keys for pluralizations. Always one without suffix and one with the _plural suffix. I am updating the translations by using the REST API.

Pushing the translations works as expected.
Also the UI shows the translation inputs as correct, for language de always one input for singular and one for plural in one form.

I am using the REST API for pulling the translations and now some unexpected behavior appears.

When I am trying to fetch the Json file with get to https://some-base-url.com/api/translations/component-123/app/de/file/ the _plural translations do exist in response. But when I am using the format=json parameter for the dotted notation the _plural field is missing.

Maybe I am doing something wrong?
Thank you for your help. BR Philipp

I already tried

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

Steps to reproduce the behavior

  1. Adding plural translation keys by using REST API
  2. Translating singular and plural form
  3. Using Rest API to fetch translations with format=json
  4. the _plural field is missing in response.

Expected behavior

A Json response with the existing plural-form

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

Weblate 4.11.2 Django 4.0.3 siphashc 2.1 translate-toolkit 3.6.0 lxml 4.7.1 Pillow 9.0.1 bleach 4.1.0 python-dateutil 2.8.2 social-auth-core 4.2.0 social-auth-app-django 5.0.0 django-crispy-forms 1.14.0 oauthlib 3.2.0 django-compressor 3.1 djangorestframework 3.13.1 django-filter 21.1 django-appconf 1.0.5 user-agents 2.2.0 filelock 3.6.0 jellyfish 0.9.0 openpyxl 3.0.9 celery 5.2.3 kombu 5.2.3 translation-finder 2.12 weblate-language-data 2022.2 html2text 2020.1.16 pycairo 1.20.1 pygobject 3.42.0 diff-match-patch 20200713 requests 2.27.1 django-redis 5.2.0 hiredis 2.0.0 sentry_sdk 1.5.6 Cython 0.29.28 misaka 2.1.1 GitPython 3.1.27 borgbackup 1.2.0 pyparsing 3.0.7 pyahocorasick 1.4.4 python-redis-lock 3.7.0 charset-normalizer 2.0.12 Python 3.10.2 Git 2.30.2 psycopg2 2.9.3 psycopg2-binary 2.9.3 phply 1.2.5 ruamel.yaml 0.17.21 tesserocr 2.5.2 akismet 1.1 boto3 1.21.12 zeep 4.1.0 aeidon 1.10.1 iniparse 0.5 mysqlclient 2.1.0 Mercurial 6.1 git-svn 2.30.2 git-review 2.2.0 Redis server 6.2.5 PostgreSQL server 11.15

Weblate deploy checks

No response

Additional context

No response

nijel added a commit that referenced this issue Apr 26, 2022
@nijel
Copy link
Member

nijel commented Apr 26, 2022

If you want to create plural string, use the API directly - pass value=["singular", "plural"]. See https://docs.weblate.org/en/latest/api.html#post--api-translations-(string-project)-(string-component)-(string-language)-units-

@nijel nijel added the question This is more a question for the support than an issue. label Apr 26, 2022
@phipic
Copy link
Author

phipic commented Apr 26, 2022

Thank you for your reply. But creating plural forms works as expected. But when requesting the translations by using the rest api with the query parameter format=json the plural form is missing. Without using the query param format=json the response holds the plural fields.

@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!

@nijel
Copy link
Member

nijel commented Apr 26, 2022

The plain JSON format does not support plurals, see https://docs.weblate.org/en/latest/formats.html#translation-types-capabilities

@github-actions
Copy link

github-actions bot commented May 7, 2022

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 7, 2022
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