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

Make sure format string is properly translated #346

Merged
merged 2 commits into from
Jun 2, 2021

Conversation

ptrck
Copy link
Contributor

@ptrck ptrck commented May 31, 2021

There's a small bug in admin.py:
_("Duplication successful, redirected to cloned: {}".format(clone))

In this case format is being applied to the string before translation and Django and tries to translate the string including the name of the clone, but ofc there won't be any translations for that. So instead we need to apply format on the translated string:
_("Duplication successful, redirected to cloned: {}").format(clone)

If we apply `format` to the string directly Django tries to translate the string including the actual name of the clone, but there won't be any translations for that. So instead we need to apply `format` on the translated string.
@jackton1 jackton1 self-requested a review May 31, 2021 11:18
@codecov
Copy link

codecov bot commented May 31, 2021

Codecov Report

Merging #346 (b8ee3bc) into main (281dd8b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #346   +/-   ##
=======================================
  Coverage   96.29%   96.29%           
=======================================
  Files           6        6           
  Lines         270      270           
=======================================
  Hits          260      260           
  Misses         10       10           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 281dd8b...b8ee3bc. Read the comment docs.

@jackton1
Copy link
Member

jackton1 commented Jun 2, 2021

Thanks @ptrck

@jackton1
Copy link
Member

jackton1 commented Jun 2, 2021

@allcontributors add @ptrck for bugs

@allcontributors
Copy link
Contributor

@jackton1

I've put up a pull request to add @ptrck! 🎉

@jackton1 jackton1 merged commit caaa5ef into tj-django:main Jun 2, 2021
@jackton1
Copy link
Member

@allcontributors add @ptrck for code

@allcontributors
Copy link
Contributor

@jackton1

I've put up a pull request to add @ptrck! 🎉

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

Successfully merging this pull request may close these issues.

2 participants