メッセージの変換処理を改善し、日本語のトランスリテレーションの条件を整理

This commit is contained in:
misyaguziya
2025-09-17 17:05:59 +09:00
parent 5ed0d555b9
commit c9dd352565

View File

@@ -299,25 +299,28 @@ class Controller:
# その他のエラーは通常通り処理 # その他のエラーは通常通り処理
raise raise
if config.CONVERT_MESSAGE_TO_HIRAGANA is True or config.CONVERT_MESSAGE_TO_ROMAJI is True: if config.CONVERT_MESSAGE_TO_HIRAGANA is True or config.CONVERT_MESSAGE_TO_ROMAJI is True:
if config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["language"] == "Japanese": if config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["language"] == "Japanese":
transliteration_message = model.convertMessageToTransliteration( transliteration_message = model.convertMessageToTransliteration(
message, message,
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA, hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
romaji=config.CONVERT_MESSAGE_TO_ROMAJI romaji=config.CONVERT_MESSAGE_TO_ROMAJI
) )
for i, no in enumerate(config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST): for i, no in enumerate(config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST):
if config.SELECTED_TARGET_LANGUAGES[config.SELECTED_TAB_NO][no]["language"] == "Japanese": if (config.SELECTED_TARGET_LANGUAGES[config.SELECTED_TAB_NO][no]["language"] == "Japanese" and
transliteration_translation.append( config.SELECTED_TARGET_LANGUAGES[config.SELECTED_TAB_NO][no]["enable"] is True):
model.convertMessageToTransliteration( transliteration_translation.append(
translation[i], model.convertMessageToTransliteration(
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA, translation[i],
romaji=config.CONVERT_MESSAGE_TO_ROMAJI hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
) romaji=config.CONVERT_MESSAGE_TO_ROMAJI
) )
else: )
transliteration_translation.append([]) else:
transliteration_translation.append([])
else:
transliteration_translation = [[] for _ in config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST]
if config.ENABLE_TRANSCRIPTION_SEND is True: if config.ENABLE_TRANSCRIPTION_SEND is True:
if config.SEND_MESSAGE_TO_VRC is True: if config.SEND_MESSAGE_TO_VRC is True:
@@ -450,21 +453,26 @@ class Controller:
# その他のエラーは通常通り処理 # その他のエラーは通常通り処理
raise raise
if config.CONVERT_MESSAGE_TO_HIRAGANA is True or config.CONVERT_MESSAGE_TO_ROMAJI is True: if config.CONVERT_MESSAGE_TO_HIRAGANA is True or config.CONVERT_MESSAGE_TO_ROMAJI is True:
if language == "Japanese": if language == "Japanese":
transliteration_message = model.convertMessageToTransliteration( transliteration_message = model.convertMessageToTransliteration(
message, message,
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA, hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
romaji=config.CONVERT_MESSAGE_TO_ROMAJI romaji=config.CONVERT_MESSAGE_TO_ROMAJI
)
if config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["language"] == "Japanese":
transliteration_translation = model.convertMessageToTransliteration(
translation[0],
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
romaji=config.CONVERT_MESSAGE_TO_ROMAJI
) )
if (config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["language"] == "Japanese" and
config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["enable"] is True):
transliteration_translation = model.convertMessageToTransliteration(
translation[0],
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
romaji=config.CONVERT_MESSAGE_TO_ROMAJI
)
else:
transliteration_translation.append([])
else:
transliteration_translation = [[] for _ in config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST]
if config.ENABLE_TRANSCRIPTION_RECEIVE is True: if config.ENABLE_TRANSCRIPTION_RECEIVE is True:
if config.OVERLAY_SMALL_LOG is True and model.overlay.initialized is True: if config.OVERLAY_SMALL_LOG is True and model.overlay.initialized is True:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True: if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True:
@@ -622,23 +630,26 @@ class Controller:
# その他のエラーは通常通り処理 # その他のエラーは通常通り処理
raise raise
if config.CONVERT_MESSAGE_TO_HIRAGANA is True or config.CONVERT_MESSAGE_TO_ROMAJI is True: if config.CONVERT_MESSAGE_TO_HIRAGANA is True or config.CONVERT_MESSAGE_TO_ROMAJI is True:
if config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["language"] == "Japanese": if config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO]["1"]["language"] == "Japanese":
transliteration_message = model.convertMessageToTransliteration( transliteration_message = model.convertMessageToTransliteration(
message, message,
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
romaji=config.CONVERT_MESSAGE_TO_ROMAJI
)
for i, no in enumerate(config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST):
if (config.SELECTED_TARGET_LANGUAGES[config.SELECTED_TAB_NO][no]["language"] == "Japanese" and
config.SELECTED_TARGET_LANGUAGES[config.SELECTED_TAB_NO][no]["enable"] is True):
transliteration = model.convertMessageToTransliteration(
translation[i],
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA, hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA,
romaji=config.CONVERT_MESSAGE_TO_ROMAJI romaji=config.CONVERT_MESSAGE_TO_ROMAJI
) )
for i, no in enumerate(config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST): transliteration_translation.append(transliteration)
if config.SELECTED_TARGET_LANGUAGES[config.SELECTED_TAB_NO][no]["language"] == "Japanese": else:
transliteration = model.convertMessageToTransliteration( transliteration_translation.append([])
translation[i], else:
hiragana=config.CONVERT_MESSAGE_TO_HIRAGANA, transliteration_translation = [[] for _ in config.SELECTED_TAB_TARGET_LANGUAGES_NO_LIST]
romaji=config.CONVERT_MESSAGE_TO_ROMAJI
)
transliteration_translation.append(transliteration)
else:
transliteration_translation.append([])
# send OSC message # send OSC message
if config.SEND_MESSAGE_TO_VRC is True: if config.SEND_MESSAGE_TO_VRC is True: