I18n: translate untitled file names

When saving, the default file name is "untitled" regardless of
selected language. This can be translated, like many graphical
applications do.

This applies to:
- blend file
- alembic file
- collada file
- obj file
- usd file
- rendered image
- grease pencil export
- subtitles export
- other Python exports through ExportHelper

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15868
This commit is contained in:
Damien Picard
2022-09-05 15:25:34 +02:00
committed by Bastien Montagne
parent f70cf451ed
commit dead26b577
9 changed files with 15 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ from bpy.props import (
EnumProperty,
StringProperty,
)
from bpy.app.translations import pgettext_data as data_
def _check_axis_conversion(op):
if hasattr(op, "axis_forward") and hasattr(op, "axis_up"):
@@ -56,7 +56,7 @@ class ExportHelper:
if not self.filepath:
blend_filepath = context.blend_data.filepath
if not blend_filepath:
blend_filepath = "untitled"
blend_filepath = data_("untitled")
else:
blend_filepath = os.path.splitext(blend_filepath)[0]