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

Skip invalid lines instead of giving an error #8952

Closed
2 tasks done
stijnb1234 opened this issue Mar 19, 2023 · 4 comments
Closed
2 tasks done

Skip invalid lines instead of giving an error #8952

stijnb1234 opened this issue Mar 19, 2023 · 4 comments
Labels
question This is more a question for the support than an issue. translate-toolkit Issues which need to be fixed in the translate-toolkit

Comments

@stijnb1234
Copy link

Describe the issue

I have a YML file I want to translate. It starts with a version and then has lines to translate.

version: 1.2

ridecount:
  add: '{prefix} &aYou have ridden attraction: &f%NAME% &6%AMOUNT%x &afor a total
    of &6%TOTAL%x'

The problem is that I get: "Could not parse translation base file: We don't handle these values: Type: <class 'ruamel.yaml.scalarfloat.ScalarFloat'> Data: 1.2 Previous: version"

Is it possible to skip this line or can this be implemented?

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. Create a new project.
  2. Upload the example YML file.
  3. See the error.

Expected behavior

It should just import and ignore the line.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.16.4
  • Django: 4.1.7
  • siphashc: 2.1
  • translate-toolkit: 3.8.6
  • lxml: 4.9.2
  • Pillow: 9.4.0
  • nh3: 0.2.8
  • python-dateutil: 2.8.2
  • social-auth-core: 4.4.0
  • social-auth-app-django: 5.1.0
  • django-crispy-forms: 2.0
  • oauthlib: 3.2.2
  • django-compressor: 4.3.1
  • djangorestframework: 3.14.0
  • django-filter: 22.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.10.0
  • rapidfuzz: 2.13.7
  • openpyxl: 3.1.2
  • celery: 5.2.7
  • django-celery-beat: 2.5.0
  • kombu: 5.2.4
  • translation-finder: 2.15
  • weblate-language-data: 2023.3
  • html2text: 2020.1.16
  • pycairo: 1.23.0
  • pygobject: 3.42.2
  • diff-match-patch: 20200713
  • requests: 2.28.2
  • django-redis: 5.2.0
  • hiredis: 2.2.2
  • sentry_sdk: 1.16.0
  • Cython: 0.29.33
  • misaka: 2.1.1
  • GitPython: 3.1.31
  • borgbackup: 1.2.3
  • pyparsing: 3.0.9
  • pyahocorasick: 2.0.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.1.0
  • Python: 3.11.2
  • Git: 2.30.2
  • psycopg2: 2.9.5
  • psycopg2-binary: 2.9.5
  • phply: 1.2.6
  • ruamel.yaml: 0.17.21
  • tesserocr: 2.6.0
  • boto3: 1.26.92
  • zeep: 4.2.1
  • aeidon: 1.12
  • iniparse: 0.5
  • mysqlclient: 2.1.1
  • Mercurial: 6.3.3
  • git-svn: 2.30.2
  • git-review: 2.3.1
  • Redis server: 7.0.9
  • PostgreSQL server: 15.2
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: da131.direct-admin-server.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://cache:6379/1, redis://cache:6379/1, regular
  • Platform: Linux 5.15.0-60-generic (x86_64)

Weblate deploy checks

SystemCheckError: System check identified some issues:

CRITICALS:
?: (weblate.E003) Cannot send e-mail ([Errno 99] Cannot assign requested address), please check EMAIL_* settings.
        HINT: https://docs.weblate.org/en/weblate-4.16.4/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.

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

Additional context

(I've not set up email yet, that's why you see that error)

@stijnb1234 stijnb1234 added the question This is more a question for the support than an issue. label Mar 19, 2023
@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 nijel added the translate-toolkit Issues which need to be fixed in the translate-toolkit label Mar 20, 2023
@nijel
Copy link
Member

nijel commented Mar 20, 2023

Such file is not supported, skipping the line will probably not do anything good (such line would be removed when serializing the file with changes). The proper approach is to add support for such format to https://github.com/translate/translate/

@github-actions
Copy link

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

@stijnb1234
Copy link
Author

Okay, will request it there. Thanks!

@stijnb1234 stijnb1234 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2023
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. translate-toolkit Issues which need to be fixed in the translate-toolkit
Projects
None yet
Development

No branches or pull requests

2 participants