File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed
Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff 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" ):
Original file line number Diff line number Diff 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" ,
Original file line number Diff line number Diff line change 1+ import os
2+
3+ # mypy: ignore-errors
14from 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+
48IS_TRANSLATING = True
59MULTILANGUAGE = {}
610
11+ # test
12+
713
814def load_multilanguage ():
915 global MULTILANGUAGE
You can’t perform that action at this time.
0 commit comments