bartczak-pa / Cookbook

0 stars 0 forks source link

*suggestion: Use Django's translation functions for error messages #10

Open bartczak-pa opened 2 months ago

bartczak-pa commented 2 months ago
          **suggestion:** Use Django's translation functions for error messages

For better internationalization support, consider using Django's translation functions (e.g., gettext_lazy) for error messages. This will make it easier to translate the application in the future if needed.

from django.utils.translation import gettext_lazy as _

msg: str = _("Max file size is %(size)s MB") % {"size": megabyte_limit}

_Originally posted by @sourcery-ai[bot] in https://github.com/bartczak-pa/Cookbook/pull/9#discussion_r1730302023_