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

@@ -3019,7 +3019,9 @@ void WM_OT_recover_auto_save(wmOperatorType *ot)
static void wm_filepath_default(const Main *bmain, char *filepath)
{
if (bmain->filepath[0] == '\0') {
BLI_path_filename_ensure(filepath, FILE_MAX, "untitled.blend");
char filename_untitled[FILE_MAXFILE];
SNPRINTF(filename_untitled, "%s.blend", DATA_("untitled"));
BLI_path_filename_ensure(filepath, FILE_MAX, filename_untitled);
}
}
@@ -3652,7 +3654,7 @@ static uiBlock *block_create__close_file_dialog(struct bContext *C,
BLI_split_file_part(blendfile_path, filename, sizeof(filename));
}
else {
STRNCPY(filename, "untitled.blend");
SNPRINTF(filename, "%s.blend", DATA_("untitled"));
}
uiItemL(layout, filename, ICON_NONE);