[Refactor] Config Window: Transcription tab. whisper関係の文言をi18nを使って呼び出す部分、重複した部分が多いのでリファクタリング。
This commit is contained in:
@@ -195,14 +195,8 @@ config_window:
|
|||||||
whisper_weight_type:
|
whisper_weight_type:
|
||||||
label: Select Whisper Model
|
label: Select Whisper Model
|
||||||
desc: Generally, models with larger capacity tend to have higher accuracy, but this also results in longer transcription times and increased CPU usage. Please refer to the documentation for explanations of each model.
|
desc: Generally, models with larger capacity tend to have higher accuracy, but this also results in longer transcription times and increased CPU usage. Please refer to the documentation for explanations of each model.
|
||||||
tiny: "tiny model (%{capacity})"
|
model_template: "%{model_name} model (%{capacity})"
|
||||||
base: "base model (%{capacity}) (Recommended)"
|
recommended_model_template: "%{model_name} model (%{capacity}) (Recommended)"
|
||||||
small: "small model (%{capacity})"
|
|
||||||
medium: "medium model (%{capacity})"
|
|
||||||
large_v1: "large_v1 model (%{capacity})"
|
|
||||||
large_v2: "large_v2 model (%{capacity})"
|
|
||||||
large_v3: "large_v3 model (%{capacity})"
|
|
||||||
|
|
||||||
|
|
||||||
auto_clear_the_message_box:
|
auto_clear_the_message_box:
|
||||||
label: Auto Clear The Message Box
|
label: Auto Clear The Message Box
|
||||||
|
|||||||
@@ -192,13 +192,8 @@ config_window:
|
|||||||
whisper_weight_type:
|
whisper_weight_type:
|
||||||
label: Whisperモデルのタイプ
|
label: Whisperモデルのタイプ
|
||||||
desc: 基本的に、容量が多いモデルほど精度は高いですが、文字起こしまでの時間が伸び、CPU使用率も増加します。各モデルの説明はドキュメントをご覧ください。
|
desc: 基本的に、容量が多いモデルほど精度は高いですが、文字起こしまでの時間が伸び、CPU使用率も増加します。各モデルの説明はドキュメントをご覧ください。
|
||||||
tiny: "tiny モデル (%{capacity})"
|
model_template: "%{model_name} モデル (%{capacity})"
|
||||||
base: "base モデル (%{capacity}) (推奨)"
|
recommended_model_template: "%{model_name} モデル (%{capacity}) (推奨)"
|
||||||
small: "small モデル (%{capacity})"
|
|
||||||
medium: "medium モデル (%{capacity})"
|
|
||||||
large_v1: "large_v1 モデル (%{capacity})"
|
|
||||||
large_v2: "large_v2 モデル (%{capacity})"
|
|
||||||
large_v3: "large_v3 モデル (%{capacity})"
|
|
||||||
|
|
||||||
|
|
||||||
auto_clear_the_message_box:
|
auto_clear_the_message_box:
|
||||||
|
|||||||
21
view.py
21
view.py
@@ -952,14 +952,21 @@ class View():
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getSelectableWhisperWeightTypeDict():
|
def getSelectableWhisperWeightTypeDict():
|
||||||
|
def callI18n(model_name, capacity, is_recommended=False):
|
||||||
|
if is_recommended is True:
|
||||||
|
return i18n.t("config_window.whisper_weight_type.recommended_model_template", model_name=model_name, capacity=capacity)
|
||||||
|
else:
|
||||||
|
return i18n.t("config_window.whisper_weight_type.model_template", model_name=model_name, capacity=capacity)
|
||||||
|
|
||||||
|
DICT_DATA = config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT
|
||||||
return {
|
return {
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["tiny"]: i18n.t("config_window.whisper_weight_type.tiny", capacity="74.5MB"),
|
DICT_DATA["tiny"]: callI18n("tiny", "74.5MB"),
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["base"]: i18n.t("config_window.whisper_weight_type.base", capacity="141MB"),
|
DICT_DATA["base"]: callI18n("base", "141MB", True),
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["small"]: i18n.t("config_window.whisper_weight_type.small", capacity="463MB"),
|
DICT_DATA["small"]: callI18n("small", "463MB"),
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["medium"]: i18n.t("config_window.whisper_weight_type.medium", capacity="1.42GB"),
|
DICT_DATA["medium"]: callI18n("medium", "1.42GB"),
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["large-v1"]: i18n.t("config_window.whisper_weight_type.large_v1", capacity="2.87GB"),
|
DICT_DATA["large-v1"]: callI18n("large-v1", "2.87GB"),
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["large-v2"]: i18n.t("config_window.whisper_weight_type.large_v2", capacity="2.87GB"),
|
DICT_DATA["large-v2"]: callI18n("large-v2", "2.87GB"),
|
||||||
config.SELECTABLE_WHISPER_WEIGHT_TYPE_DICT["large-v3"]: i18n.t("config_window.whisper_weight_type.large_v3", capacity="2.87GB"),
|
DICT_DATA["large-v3"]: callI18n("large-v3", "2.87GB"),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Open Webpage Functions
|
# Open Webpage Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user