Translation Popup now added.
Due to some werid thing in Blender 4.2+ where we just can't get descriptions to translate, we now tell the user some translations won't apply unto restart.
This commit is contained in:
@@ -15,3 +15,26 @@ class AvatarToolkitSettingsPanel(bpy.types.Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.prop(context.scene, "avatar_toolkit_language", text=t("Settings.language.label"))
|
||||
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_translation_restart_popup(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.translation_restart_popup"
|
||||
bl_label = t("Settings.translation_restart_popup.label")
|
||||
bl_description = t("Settings.translation_restart_popup.description")
|
||||
bl_options = {'INTERNAL'}
|
||||
|
||||
def execute(self, context):
|
||||
if context.scene.avatar_toolkit_language_changed:
|
||||
# Reload the addon after the popup is closed
|
||||
bpy.ops.script.reload()
|
||||
context.scene.avatar_toolkit_language_changed = False
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
return context.window_manager.invoke_props_dialog(self, width=300)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.label(text=t("Settings.translation_restart_popup.message1"))
|
||||
layout.label(text=t("Settings.translation_restart_popup.message2"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user