diff options
Diffstat (limited to '')
| -rw-r--r-- | src/help.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/help.cpp b/src/help.cpp index 3c76797c0..fd935e8c2 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -17,28 +17,36 @@ #include "file.h" #include "help.h" +#include "io/resource.h" #include "io/sys.h" #include "path-prefix.h" #include "ui/dialog/aboutbox.h" #include "ui/interface.h" + +using namespace Inkscape::IO::Resource; + + void sp_help_about() { Inkscape::UI::Dialog::AboutBox::show_about(); } -void sp_help_open_tutorial(GtkMenuItem *, void* data) +void sp_help_open_tutorial(Glib::ustring name) { - gchar const *name = static_cast<gchar const *>(data); - gchar *c = g_build_filename(INKSCAPE_TUTORIALSDIR, name, NULL); - if (Inkscape::IO::file_test(c, G_FILE_TEST_EXISTS)) { - sp_file_open(c, nullptr, false, false); + Glib::ustring filename = name + ".svg"; + // TRANSLATORS: 'en' is a ISO 639-1 language code. + // Replace with language code for your language (i.e. the name of your .po file) + Glib::ustring filename_localized = name + "." + _("en") + ".svg"; + + filename = get_filename(TUTORIALS, filename.c_str(), filename_localized.c_str()); + if (!filename.empty()) { + sp_file_open(filename.c_str(), nullptr, false, false); } else { sp_ui_error_dialog(_("The tutorial files are not installed.\nFor Linux, you may need to install " "'inkscape-tutorials'; for Windows, please re-run the setup and select 'Tutorials'.\nThe " "tutorials can also be found online at https://inkscape.org/learn/tutorials/")); } - g_free(c); } /* |
