Open scurest opened 1 year ago
Source / to be checked : https://developer.blender.org/T104145
@julienduroure That's what made me think about it, but this did not change in 3.4, it's the same in 3.3 (and probably before).
Another option is to just hardcode all translations of "[Action Stash]". Currently that list is
en_US [Action Stash]
es [Esconder acción]
fr_FR [Pile d’actions]
ja_JP [保留アクション]
sk_SK [Skryť akciu]
vi_VN [Hành Động Cất Chứa]
it_IT [Accantona Azione]
ko_KR [액션 제외]
pt_BR Armazenamento para as ações
pt_PT Armazenamento para as ações
ru_RU [Размещённое действие]
uk_UA [Запас Дій]
pl_PL [Akcja odłożona]
Generated with this rather awkward script
import bpy
ALL_LANGS = [
'en_US', 'es', 'fr_FR', 'ja_JP', 'sk_SK', 'vi_VN', 'zh_CN', 'cs_CZ',
'de_DE', 'it_IT', 'ko_KR', 'pt_BR', 'pt_PT', 'ru_RU', 'uk_UA', 'zh_TW',
'ab', 'ar_EG', 'ca_AD', 'eo', 'eu_EU', 'fa_IR', 'fi_FI', 'ha', 'he_IL',
'hi_IN', 'hr_HR', 'hu_HU', 'id_ID', 'ka', 'ky_KG', 'nl_NL', 'pl_PL',
'sr_RS', 'sr_RS@latin', 'sv_SE', 'th_TH', 'tr_TR',
]
def print_all_translations(text, msgctxt=None):
orig_lang = bpy.context.preferences.view.language
try:
for lang in ALL_LANGS:
bpy.context.preferences.view.language = lang
trans = bpy.app.translations.pgettext(text, msgctxt)
if lang == 'en_US' or trans != text:
print(lang, trans)
finally:
bpy.context.preferences.view.language = orig_lang
print_all_translations('[Action Stash]')
The exporter has special behavior when the name of an NLA track starts with "NLATrack" or "[Action Stash]"
https://github.com/KhronosGroup/glTF-Blender-IO/blob/0ff430ced526f0fac7021426f0283571701bce39/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py#L131-L132
Because these are hard-coded to the English names, English users who stash an action see different behavior than, say, French users (who get "[Pile d’actions]" instead of "[Action Stash]").
To Reproduce
Solution I'm not very knowledgeable about i18n stuff. One idea is to test both the English and the localized names, which I believe is
This would be an improvement, since it would handle anyone working in one language alone, or an English user sending the file to a non-English user. But it still wouldn't handle eg. a French user sending the file to a non-French user.
Also AFAICT a new NLA track is always named "NlaTrack" regardless of language and not translated, so I'm not sure if that actually needs to be checked.