I18n: Translate user preferences GPU device tooltips

GPU devices can only be selected in the user preferences if a suitable
device is available. This uses a dynamic enum and the items are not
always defined in RNA, so they need to be extracted manually using
`n_()`.

Also rephrase one message slightly to respect the style guide
("Don't" -> "Do not").

In addition, fix my mistake where an import was mixed up
(`pgettext_tip` was imported as `n_`).

Pull Request: https://projects.blender.org/blender/blender/pulls/141244
This commit is contained in:
Damien Picard
2025-06-30 23:19:44 +02:00
committed by Gitea
parent 81fa28fa26
commit 301274f398

View File

@@ -16,7 +16,7 @@ from bpy.props import (
)
from bpy.app.translations import (
contexts as i18n_contexts,
pgettext_tip as n_,
pgettext_n as n_,
pgettext_rpt as rpt_,
)
@@ -1568,17 +1568,17 @@ class CyclesPreferences(bpy.types.AddonPreferences):
import _cycles
has_cuda, has_optix, has_hip, has_metal, has_oneapi, has_hiprt = _cycles.get_device_types()
list = [('NONE', "None", "Don't use compute device", 0)]
list = [('NONE', "None", n_("Do not use compute device"), 0)]
if has_cuda:
list.append(('CUDA', "CUDA", "Use CUDA for GPU acceleration", 1))
list.append(('CUDA', "CUDA", n_("Use CUDA for GPU acceleration"), 1))
if has_optix:
list.append(('OPTIX', "OptiX", "Use OptiX for GPU acceleration", 3))
list.append(('OPTIX', "OptiX", n_("Use OptiX for GPU acceleration"), 3))
if has_hip:
list.append(('HIP', "HIP", "Use HIP for GPU acceleration", 4))
list.append(('HIP', "HIP", n_("Use HIP for GPU acceleration"), 4))
if has_metal:
list.append(('METAL', "Metal", "Use Metal for GPU acceleration", 5))
list.append(('METAL', "Metal", n_("Use Metal for GPU acceleration"), 5))
if has_oneapi:
list.append(('ONEAPI', "oneAPI", "Use oneAPI for GPU acceleration", 6))
list.append(('ONEAPI', "oneAPI", n_("Use oneAPI for GPU acceleration"), 6))
return list