Merge pull request #58774 from timothyqiu/file-dialog-filter-i18n-3.x

[3.x] Make name of editor file dialog filters translatable
This commit is contained in:
Rémi Verschelde 2022-03-05 09:21:23 +01:00 committed by GitHub
commit 56310caee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -1345,7 +1345,7 @@ EditorAudioBuses::EditorAudioBuses() {
List<String> ext;
ResourceLoader::get_recognized_extensions_for_type("AudioBusLayout", &ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
file_dialog->add_filter("*." + E->get() + "; Audio Bus Layout");
file_dialog->add_filter(vformat("*.%s; %s", E->get(), TTR("Audio Bus Layout")));
}
add_child(file_dialog);
file_dialog->connect("file_selected", this, "_file_dialog_callback");

View File

@ -160,7 +160,7 @@ BakedLightmapEditorPlugin::BakedLightmapEditorPlugin(EditorNode *p_node) {
file_dialog = memnew(EditorFileDialog);
file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE);
file_dialog->add_filter("*.lmbake ; LightMap Bake");
file_dialog->add_filter("*.lmbake ; " + TTR("LightMap Bake"));
file_dialog->set_title(TTR("Select lightmap bake file:"));
file_dialog->connect("file_selected", this, "_bake_select_file");
bake->add_child(file_dialog);

View File

@ -1881,7 +1881,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog() {
List<String> ext;
ResourceLoader::get_recognized_extensions_for_type("Theme", &ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
import_another_theme_dialog->add_filter("*." + E->get() + "; Theme Resource");
import_another_theme_dialog->add_filter(vformat("*.%s; %s", E->get(), TTR("Theme Resource")));
}
import_another_file_hb->add_child(import_another_theme_dialog);
import_another_theme_dialog->connect("file_selected", this, "_select_another_theme_cbk");
@ -3281,7 +3281,7 @@ ThemeEditor::ThemeEditor() {
List<String> ext;
ResourceLoader::get_recognized_extensions_for_type("PackedScene", &ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
preview_scene_dialog->add_filter("*." + E->get() + "; Scene");
preview_scene_dialog->add_filter(vformat("*.%s; %s", E->get(), TTR("Scene")));
}
main_hs->add_child(preview_scene_dialog);
preview_scene_dialog->connect("file_selected", this, "_preview_scene_dialog_cbk");