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

Field verbose_name should use gettext_lazy #1377

Closed
mihalikv opened this issue Jul 7, 2023 · 2 comments · Fixed by #1378
Closed

Field verbose_name should use gettext_lazy #1377

mihalikv opened this issue Jul 7, 2023 · 2 comments · Fixed by #1378

Comments

@mihalikv
Copy link

mihalikv commented Jul 7, 2023

Hi,
model field verbose_names should use gettext_lazy, because it creates migrations based on user language settings.

https://github.com/django-cms/django-filer/blob/master/filer/models/foldermodels.py#L9

This is migration generated after upgrade to django-filer 3.0
image

Thanks.

@mihalikv
Copy link
Author

mihalikv commented Jul 7, 2023

Or maybe I am just wrong and it doesn't help, just a guess.

@marksweb
Copy link
Member

marksweb commented Jul 7, 2023

@mihalikv No, you're right.

As a general rule;

gettext_lazy() should be used for anything loaded at runtime:

  • models.py (fields, verbose_name, help_text, function short_description);
  • forms.py (labels, help_text, empty_label);
  • apps.py (verbose_name).

gettext()should be used for any modules that are executed during the request process, such as views.py

fsbraun added a commit to fsbraun/django-filer that referenced this issue Jul 7, 2023
marksweb pushed a commit that referenced this issue Jul 7, 2023
vinitkumar pushed a commit that referenced this issue Jul 12, 2023
* Fix #1377

* add css maps

* fix test requirements

* Update manifest
vinitkumar pushed a commit that referenced this issue Jul 13, 2023
* Fix #1377

* Fix: Allow empty suffix in admin copy

* Add submit-row class

* Fix; Cancel link too small if djangocms-admin-style is not present
vinitkumar pushed a commit that referenced this issue Jul 16, 2023
…1391)

* Fix #1377

* fix: After using back button (or cancel button) do not disable action buttons

* Update Changelog
vinitkumar pushed a commit that referenced this issue Jul 21, 2023
* Fix #1377

* Fix: Avoid actions.js of django admin to throw an error on js console
vinitkumar pushed a commit that referenced this issue Aug 2, 2023
* Fix #1377

* Update French translations

* Add dutch locale

* Update CHANGELOG.rst

* Update CHANGELOG.rst

* Update CHANGELOG.rst
vinitkumar pushed a commit that referenced this issue Aug 4, 2023
* Fix #1377

* Bump version

* Complete Spanish locale

* Update CHANGELOG.rst
fsbraun added a commit that referenced this issue Aug 22, 2023
* Fix #1377

* fix bug #1412

* Fix: differentiate source_storage and thumbnail_storage

* Update tests to run on non-standard storage settings.

* Update CHANGELOG.rst

* Replace `re_path` by `path`

* Remove `re_path` from tests

* Bump version
vinitkumar pushed a commit that referenced this issue Sep 8, 2023
…n copying (#1418)

* Fix #1377

* Fix: Do not open file twice when moving or copying

* Fix isort folder admin

* no message

* Catch exception raised by django-storage 1.14

* Update filemodels.py

* Update filemodels.py
vinitkumar pushed a commit that referenced this issue Sep 19, 2023
* Fix #1377

* Fix: Ensure uniqueness of admin url names
vinitkumar pushed a commit that referenced this issue Sep 22, 2023
* Fix #1377

* feat: Django 5.0 compat

* fix github codecov action

* Add tests for action forms.

* Update test

* Remove legacy code, update language files

* Update *.mo

* Update comment

* get_storage_class removed in Django 5
vinitkumar pushed a commit that referenced this issue Sep 30, 2023
…1429)

* Fix #1377

* feat: expand images in `<img>` tag to avoid javascript attacks

* Embed in img tags svg only

* Remove canonical url display from directory listing for svg

* Add test

* Remove unused Media class

* Change function of canonical url button

* Remove superflous `} `

* Update NL locale
vinitkumar pushed a commit that referenced this issue Oct 2, 2023
…ser through canonical url (#1430)

* Fix #1377

* feat: expand images in `<img>` tag to avoid javascript attacks

* Embed in img tags svg only

* Remove canonical url display from directory listing for svg

* Add test

* Remove unused Media class

* Change function of canonical url button

* Remove superflous `} `

* Update NL locale

* Fix: Right click "open in new tab" on canonical url now renders svg in img tag

* Add zoom functionality for expanded svg images

* Fix test and js lint

* More js linting fixes

* Allow ES6

* Update French translations

* Fix css map

* Update filer/templates/admin/filer/image/expand.html

* Fix zoom cursors when displaying svg

* ... second part
fsbraun added a commit that referenced this issue Mar 22, 2024
* Fix #1377

* Fix: styles for django 4.2+ admin

* Fix: Unintended scroll when clearing file widget

* Fix linting errors.
fsbraun added a commit that referenced this issue May 17, 2024
…go admin styles (#1467)

* Fix #1377

* Fix: folder widget css

* Revert "Fix: folder widget css"

This reverts commit 4d5d5d2.

* Disentangle from test changes
fsbraun added a commit that referenced this issue May 21, 2024
#1471)

* Fix #1377

* Fix issue #1470

* Update tests

* Update `tox.ini`

* Update tox.ini

Co-authored-by: Mark Walker <theshow@gmail.com>

---------

Co-authored-by: Mark Walker <theshow@gmail.com>
fsbraun added a commit that referenced this issue Aug 7, 2024
* Fix #1377

* fix: `Image.MAX_IMAGE_SIZE = None` allowed.

* Improve warning message

* Add test.
vinitkumar pushed a commit that referenced this issue Aug 22, 2024
…nails for svg files (#1490)

* Fix #1377

* Simplify admin thumbnails sizes to 40, 80, 160. No thumbnails for svg in the admin.

* Update settings

* Fix undefined variable add_attrs

* Dynamic css for new setting `FILER_THUMBNAIL_ICON_SIZE`

* Replace SVG by icon if larger than 1MB (can be changed by setting)

* Dynamic folder icon size

* Default sizes 40, and 120px

* Update folderadmin.py for better naming
fsbraun added a commit that referenced this issue Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants