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: pass _key arg in t function #116

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

GeorgiaSkrempou
Copy link

Fixing a bug where _key would always initialize as None when calling using transifex.native.django.t

_key could be passed in the t function as part of unpacking **params.
However it was not passed further to tx.translate which expects _key as an arg, so _key would always initialized as None

example usecase that led to the bug:

from transifex.native.django import t

from translations import constants


def transifex_translated_stings(key_string: str):
    match key_string:
        case constants.INSPECTION_CHECKLIST:
            return t("INSPECTION CHECKLIST", _key="inspectionChecklist")

Used with django 4.1.13 and python 3.10 / python 3.12

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.

None yet

1 participant