Skip to content

Commit 7d7b968

Browse files
committed
fix: correciton des tests
J ai corrige le format de cz afin d y introduire le langage BREAKING CHANGE:
1 parent aa8cd2f commit 7d7b968

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

commitizen/commands/commit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ def read_backup_message(self) -> str | None:
5151
def prompt_commit_questions(self) -> str:
5252
# Prompt user for the commit message
5353
cz = self.cz
54-
questions = cz.questions(self.arguments["language"])
54+
if "language" in self.arguments:
55+
cz.language = self.arguments["language"]
56+
questions = cz.questions()
57+
5558
for question in filter(lambda q: q["type"] == "list", questions):
5659
question["use_shortcuts"] = self.config.settings["use_shortcuts"]
5760
try:

commitizen/cz/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class BaseCommitizen(metaclass=ABCMeta):
6262
template_loader: BaseLoader = PackageLoader("commitizen", "templates")
6363
template_extras: dict[str, Any] = {}
6464

65+
language: str = "en"
66+
6567
def __init__(self, config: BaseConfig) -> None:
6668
self.config = config
6769
if not self.config.settings.get("style"):

commitizen/cz/conventional_commits/conventional_commits.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ class ConventionalCommitsCz(BaseCommitizen):
4343
}
4444
changelog_pattern = defaults.bump_pattern
4545

46-
def questions(self, language: str) -> Questions:
46+
def questions(self) -> Questions:
47+
language = self.language
48+
print(language)
4749
questions: Questions = [
4850
{
4951
"type": "list",

commitizen/cz/conventional_commits/translation_multilanguage.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
import os
2+
3+
# mypy: ignore-errors
14
from translate import Translator
25

3-
FILENAME = "commitizen/cz/conventional_commits/.cache_multilanguage.txt"
6+
FILENAME = os.path.join(os.path.dirname(__file__), ".cache_multilanguage.txt")
7+
48
IS_TRANSLATING = True
59
MULTILANGUAGE = {}
610

11+
# test
12+
713

814
def load_multilanguage():
915
global MULTILANGUAGE

0 commit comments

Comments
 (0)