Make name of editor file dialog filters translatable

This commit is contained in:
Haoyu Qiu 2022-03-05 12:44:17 +08:00
parent 5b3dfe1ffa
commit 61e35b4f6e
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");