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

Fix generation of JS translations by dropping old locale folder #2078

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

hansegucker
Copy link
Collaborator

@hansegucker hansegucker commented Nov 20, 2023

  1. Every locale directory within the source base is considered as a directory for storing *.po files by makemessages [1]. This causes the djangojs.po file to be created in the wrong folder by ./manage.py translate. As a workaround, we can rename or remove our locale folder in the static files.
  2. Select2 was dropped in Replace select2 with TomSelect #1758, so we can just remove the leftover localization files for that. The moment_de.js file is just included once in the datetimepicker html file, so we can change its path there.

[1] https://github.com/django/django/blob/main/django/core/management/commands/makemessages.py#L565

Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is looking good, works for me locally (after ensuring that the the locale folder was indeed removed and not kept because there is an untracked old djangojs.po in there), thanks!

evap/static/js/.gitignore Outdated Show resolved Hide resolved
evap/locale/de/LC_MESSAGES/djangojs.po Show resolved Hide resolved
evap/development/management/commands/translate.py Outdated Show resolved Hide resolved
Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

@hansegucker hansegucker force-pushed the fix-js-translations branch 2 times, most recently from 8bea728 to 8838e81 Compare November 27, 2023 17:12
Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@richardebeling richardebeling merged commit 18f9194 into e-valuation:main Nov 28, 2023
11 of 12 checks passed
@hansegucker
Copy link
Collaborator Author

🥳

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

Successfully merging this pull request may close these issues.

3 participants