VR Scene Inspection: I18n: enable translation of UI messages #104432

Merged
Peter Kim merged 1 commits from pioverfour/blender-addons:dp_fix_vr_messages into blender-v3.5-release 2023-02-27 08:39:53 +01:00
3 changed files with 11 additions and 11 deletions
Showing only changes of commit 3b33b3592f - Show all commits

View File

@ -3,7 +3,7 @@
bl_info = {
"name": "VR Scene Inspection",
"author": "Julian Eisel (Severin), Sebastian Koenig, Peter Kim (muxed-reality)",
"version": (0, 11, 1),
"version": (0, 11, 2),
"blender": (3, 2, 0),
"location": "3D View > Sidebar > VR",
"description": ("View the viewport with virtual reality glasses "

View File

@ -7,6 +7,7 @@ else:
from . import properties
import bpy
from bpy.app.translations import pgettext_iface as iface_
from bpy.types import (
Menu,
Panel,
@ -37,12 +38,10 @@ class VIEW3D_PT_vr_session(Panel):
# Using SNAP_FACE because it looks like a stop icon -- I shouldn't
# have commit rights...
toggle_info = (
("Start VR Session", 'PLAY') if not is_session_running else (
"Stop VR Session", 'SNAP_FACE')
)
layout.operator("wm.xr_session_toggle",
text=toggle_info[0], icon=toggle_info[1])
toggle_info = ((iface_("Start VR Session"), 'PLAY') if not is_session_running
else (iface_("Stop VR Session"), 'SNAP_FACE'))
layout.operator("wm.xr_session_toggle", text=toggle_info[0],
translate=False, icon=toggle_info[1])
layout.separator()

View File

@ -8,6 +8,7 @@ else:
import bpy
import gpu
from bpy.app.translations import pgettext_data as data_
from bpy.types import (
Gizmo,
GizmoGroup,
@ -117,8 +118,8 @@ class VIEW3D_OT_vr_camera_landmark_from_session(Operator):
loc = wm.xr_session_state.viewer_pose_location
rot = wm.xr_session_state.viewer_pose_rotation.to_euler()
cam = bpy.data.cameras.new("Camera_" + lm.name)
new_cam = bpy.data.objects.new("Camera_" + lm.name, cam)
cam = bpy.data.cameras.new(data_("Camera") + "_" + lm.name)
new_cam = bpy.data.objects.new(data_("Camera") + "_" + lm.name, cam)
scene.collection.objects.link(new_cam)
new_cam.location = loc
new_cam.rotation_euler = rot
@ -215,8 +216,8 @@ class VIEW3D_OT_add_camera_from_vr_landmark(Operator):
scene = context.scene
lm = properties.VRLandmark.get_selected_landmark(context)
cam = bpy.data.cameras.new("Camera_" + lm.name)
new_cam = bpy.data.objects.new("Camera_" + lm.name, cam)
cam = bpy.data.cameras.new(data_("Camera") + "_" + lm.name)
new_cam = bpy.data.objects.new(data_("Camera") + "_" + lm.name, cam)
scene.collection.objects.link(new_cam)
angle = lm.base_pose_angle
new_cam.location = lm.base_pose_location