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

Generate MO files doesn't include fuzzy translation even with option set #11656

Closed
2 tasks done
lukavia opened this issue May 16, 2024 · 5 comments
Closed
2 tasks done
Assignees
Labels
bug Something is broken.
Milestone

Comments

@lukavia
Copy link

lukavia commented May 16, 2024

Describe the issue

I've used google translate to translate strings in our installation and marked them as 'needs editing'.
I've discovered that in the .mo files those strings are missing, where as in the po files are there.
I've enabled the option in the addon configuration: 'Include strings needing editing' and then tried Synchronize, but the strings are still missing from the mo files.
If I remove the check 'needs editing' on a string, then it gets included in the mo file, but if I check it again then the string is again removed from the .mo files.

I've discovered the problem with version 5.3.4 and upgraded to 5.5.5 and then repeat all the steps described above, but the result is still the same.

I already tried

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

Steps to reproduce the behavior

  1. Install Generate mo addon
  2. Set 'Include strings needing editing'
  3. Translate a string as needed editing.
  4. Check or download the .mo file

Expected behavior

No response

Screenshots

image
image
image
image

Exception traceback

No response

How do you run Weblate?

Other

Weblate versions

(weblate-env) weblate@tr:~$ weblate list_versions

  • Weblate: 5.5.5
  • Django: 5.0.6
  • siphashc: 2.4.1
  • translate-toolkit: 3.13.0
  • lxml: 5.2.2
  • pillow: 10.3.0
  • nh3: 0.2.17
  • python-dateutil: 2.9.0.post0
  • social-auth-core: 4.5.4
  • social-auth-app-django: 5.4.1
  • django-crispy-forms: 2.1
  • oauthlib: 3.2.2
  • django-compressor: 4.4
  • djangorestframework: 3.15.1
  • django-filter: 24.2
  • django-appconf: 1.0.6
  • user-agents: 2.2.0
  • filelock: 3.14.0
  • rapidfuzz: 3.9.0
  • openpyxl: 3.1.2
  • celery: 5.4.0
  • django-celery-beat: 2.6.0
  • kombu: 5.3.7
  • translation-finder: 2.16
  • weblate-language-data: 2024.5
  • html2text: 2024.2.26
  • pycairo: 1.26.0
  • PyGObject: 3.48.2
  • diff-match-patch: 20230430
  • requests: 2.31.0
  • django-redis: 5.4.0
  • hiredis: 2.3.2
  • sentry-sdk: 1.45.0
  • Cython: 3.0.10
  • misaka: 2.1.1
  • GitPython: 3.1.43
  • borgbackup: 1.2.8
  • pyparsing: 3.1.2
  • ahocorasick_rs: 0.22.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.3.2
  • Python: 3.11.2
  • Git: 2.39.2
  • psycopg: 3.1.19
  • psycopg-binary: 3.1.19
  • phply: 1.2.6
  • ruamel.yaml: 0.18.6
  • tesserocr: 2.7.0
  • boto3: 1.34.105
  • aeidon: 1.14.1
  • iniparse: 0.5
  • Mercurial: 6.7.3
  • git-svn: 2.39.2
  • git-review: 2.4.0
  • PostgreSQL server: 13.14
  • Database backends: django.db.backends.postgresql
  • PostgreSQL implementation: psycopg3 (binary)
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: localhost
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://localhost:6379, redis://localhost:6379, regular
  • Platform: Linux 6.1.0-21-amd64 (x86_64)

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented May 17, 2024

That's true, such strings are not included because this is consistent with what msgfmt does.

@nijel nijel added enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. labels May 17, 2024
Copy link

This issue has been put aside. It is currently unclear if it will ever be implemented as it seems to cover too narrow of a use case or doesn't seem to fit into Weblate.

Please try to clarify the use case or consider proposing something more generic to make it useful to more users.

@lukavia
Copy link
Author

lukavia commented May 21, 2024

What is the meaning of the setting then?
One would expect that if there is a setting in weblate called "'Include strings needing editing" changing the setting would include those strings, but it turns out the settings doesn't change anything.
msgfmt has an option -f, --use-fuzzy use fuzzy entries in output and one would expect it's the same in weblate.

In addition if you look at the code it would seem that it should work:

if self.instance.configuration.get("fuzzy"):

However for some reason it doesn't. I've tried to change the if statement there to be always true and other tricks but is seams that translation parameter just doesn't have those strings loaded in the object.

My particular scenario is simple. I want to use google translate and release the translation ASAP cause they are good enough most of the time, but still have the team of translators go over them and confirm or fix them as needed.

Another argument I could think of is that the fuzzy strings are indeed included in the po files, so it is strange to not be able to include them in the mo files.

To be clear. My bug report is that the setting "Include strings needing editing" that is already in weblate and is documented doesn't do what it seas it would do. Not that I claim that is a new functionality to be added in weblate.

@nijel
Copy link
Member

nijel commented May 22, 2024

You are confusing two things:

  • Generate MO files add-on saves the file to the repository, and it honors the configuration
  • The converted download generates MO file on the fly

@nijel nijel self-assigned this May 22, 2024
@nijel nijel added this to the 5.6 milestone May 22, 2024
@nijel nijel added bug Something is broken. and removed enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. labels May 22, 2024
@nijel nijel closed this as completed in b7a99d2 May 22, 2024
Copy link

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

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

2 participants