From 672753784f398a80f8604089f63a1f9f7effc360 Mon Sep 17 00:00:00 2001 From: Tim Rawlinson Date: Fri, 8 Feb 2019 11:03:24 +0000 Subject: [PATCH 01/28] Add escaping to allow spaces in ${CMAKE_CURRENT_BINARY_DIR} --- share/templates/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/templates/CMakeLists.txt b/share/templates/CMakeLists.txt index aecdca6bb9..fbcf63d404 100644 --- a/share/templates/CMakeLists.txt +++ b/share/templates/CMakeLists.txt @@ -18,7 +18,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${INKSCAPE_SHARE_INSTA add_custom_target(inkscape_default_svg ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/create_defaults.pl ${CMAKE_CURRENT_SOURCE_DIR}/default.svg #BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/default-* - COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/create_defaults.pl" - COMMAND sh -c "mv default-* ${CMAKE_CURRENT_BINARY_DIR}" + COMMAND sh -c \"\\\"${CMAKE_CURRENT_SOURCE_DIR}/create_defaults.pl\\\"\" + COMMAND sh -c \"mv default-* \\\"${CMAKE_CURRENT_BINARY_DIR}\\\"\" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -- GitLab From 41808e6ddf515ec56e8157bb7b7dc695f1b33a54 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Sun, 10 Feb 2019 20:22:14 +0000 Subject: [PATCH 02/28] Add initial UI text style guide --- doc/ui-text-styleguide.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 doc/ui-text-styleguide.md diff --git a/doc/ui-text-styleguide.md b/doc/ui-text-styleguide.md new file mode 100644 index 0000000000..2c567f018d --- /dev/null +++ b/doc/ui-text-styleguide.md @@ -0,0 +1,6 @@ + +## Micro-Typography + +### Ellipsis + +... -> … -- GitLab From 8361ce28aadac5763d796408498b3a5c1cbd637e Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Sun, 10 Feb 2019 20:23:41 +0000 Subject: [PATCH 03/28] Change ellipses in UI text to use the Unicode symbol --- src/extension/execution-env.cpp | 2 +- src/file-update.cpp | 2 +- src/file.cpp | 4 +- src/inkscape.cpp | 2 +- src/live_effects/lpe-ruler.cpp | 2 +- src/object/sp-use.cpp | 2 +- src/path-chemistry.cpp | 8 +- src/selection-chemistry.cpp | 2 +- src/splivarot.cpp | 2 +- src/trace/trace.cpp | 2 +- src/ui/contextmenu.cpp | 22 +++--- src/ui/dialog/clonetiler.cpp | 2 +- src/ui/dialog/document-properties.cpp | 4 +- src/ui/dialog/export.cpp | 6 +- src/ui/dialog/inkscape-preferences.cpp | 8 +- src/ui/dialog/objects.cpp | 2 +- src/ui/dialog/ocaldialogs.cpp | 4 +- src/ui/dialog/spellcheck.cpp | 2 +- src/ui/dialog/svg-fonts-dialog.cpp | 4 +- src/ui/dialog/swatches.cpp | 2 +- src/ui/dialog/symbols.cpp | 17 ++-- src/ui/widget/page-sizer.cpp | 4 +- src/ui/widget/preferences-widget.cpp | 2 +- src/ui/widget/selected-style.cpp | 2 +- src/verbs.cpp | 104 ++++++++++++------------- 25 files changed, 106 insertions(+), 107 deletions(-) diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index ca770e1f6f..f036b63d11 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -117,7 +117,7 @@ ExecutionEnv::createWorkingDialog () { return; Gtk::Window *window = Glib::wrap(GTK_WINDOW(toplevel), false); - gchar * dlgmessage = g_strdup_printf(_("'%s' working, please wait..."), _(_effect->get_name())); + gchar * dlgmessage = g_strdup_printf(_("'%s' working, please wait…"), _(_effect->get_name())); _visibleDialog = new Gtk::MessageDialog(*window, dlgmessage, false, // use markup diff --git a/src/file-update.cpp b/src/file-update.cpp index 0aa40ab625..5d44ca1f34 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -357,7 +357,7 @@ void sp_file_convert_dpi(SPDocument *doc) Gtk::RadioButton choice2_2(c2, _("The accuracy of the physical unit size and position values of objects\n" "in the file is most important. (Experimental.)")); Gtk::CheckButton backup_button(_("Create a backup file in same directory.")); - Gtk::Expander moreinfo(_("More details...")); + Gtk::Expander moreinfo(_("More details…")); Gtk::Label moreinfo_text("", Gtk::ALIGN_START); moreinfo_text.set_markup( _("We've updated Inkscape to follow the CSS standard of 96 DPI for " diff --git a/src/file.cpp b/src/file.cpp index cce8318273..6fbe5e9e71 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -910,7 +910,7 @@ sp_file_save(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*data*/) if (!SP_ACTIVE_DOCUMENT) return false; - SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Saving document...")); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Saving document…")); sp_namedview_document_from_window(SP_ACTIVE_DESKTOP); return sp_file_save_document(parentWindow, SP_ACTIVE_DOCUMENT); @@ -1686,7 +1686,7 @@ sp_file_export_to_ocal(Gtk::Window &parentWindow) return; bool success = sp_file_export_to_ocal_dialog(parentWindow); if (success) - SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document exported...")); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document exported…")); } */ diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 53536b878e..f274dd62f1 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -243,7 +243,7 @@ int Application::autosave() gint docnum = 0; int pid = ::getpid(); - SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Autosaving documents...")); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Autosaving documents…")); for (auto & iter : _document_set) { SPDocument *doc = iter.first; diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index 75052ad33e..7590e44290 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -40,7 +40,7 @@ LPERuler::LPERuler(LivePathEffectObject *lpeobject) : unit(_("Unit:"), _("Unit"), "unit", &wr, this), mark_length(_("Ma_jor length:"), _("Length of major ruler marks"), "mark_length", &wr, this, 14.0), minor_mark_length(_("Mino_r length:"), _("Length of minor ruler marks"), "minor_mark_length", &wr, this, 7.0), - major_mark_steps(_("Major steps_:"), _("Draw a major mark every ... steps"), "major_mark_steps", &wr, this, 5), + major_mark_steps(_("Major steps_:"), _("Draw a major mark every … steps"), "major_mark_steps", &wr, this, 5), shift(_("Shift marks _by:"), _("Shift marks by this many steps"), "shift", &wr, this, 0), mark_dir(_("Mark direction:"), _("Direction of marks (when viewing along the path from start to end)"), "mark_dir", MarkDirTypeConverter, &wr, this, MARKDIR_LEFT), offset(_("_Offset:"), _("Offset of first mark"), "offset", &wr, this, 0.0), diff --git a/src/object/sp-use.cpp b/src/object/sp-use.cpp index 3618cf18fb..331aeeacb9 100644 --- a/src/object/sp-use.cpp +++ b/src/object/sp-use.cpp @@ -254,7 +254,7 @@ gchar* SPUse::description() const { if (recursion_depth >= 4) { /* TRANSLATORS: Used for statusbar description for long chains: * "Clone of: Clone of: ... in Layer 1". */ - return g_strdup(_("...")); + return g_strdup(_("…")); /* We could do better, e.g. chasing the href chain until we reach something other than * a , and giving its description. */ } diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 8efd27be88..9aad0066ea 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -70,7 +70,7 @@ ObjectSet::combine(bool skip_undo) } if(desktop()){ - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Combining paths...")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Combining paths…")); // set "busy" cursor desktop()->setWaitingCursor(); } @@ -205,7 +205,7 @@ ObjectSet::breakApart(bool skip_undo) return; } if(desktop()){ - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Breaking apart paths...")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Breaking apart paths…")); // set "busy" cursor desktop()->setWaitingCursor(); // disable redrawing during the break-apart operation for remarkable speedup for large paths @@ -310,7 +310,7 @@ void ObjectSet::toCurves(bool skip_undo) bool did = false; if (desktop()) { - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Converting objects to paths...")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Converting objects to paths…")); // set "busy" cursor desktop()->setWaitingCursor(); } @@ -643,7 +643,7 @@ ObjectSet::pathReverse() // set "busy" cursor if(desktop()){ desktop()->setWaitingCursor(); - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Reversing paths...")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Reversing paths…")); } bool did = false; diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index ed4c23bbc7..41e628d24a 100755 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3606,7 +3606,7 @@ void ObjectSet::createBitmapCopy() return; } if(desktop()){ - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Rendering bitmap...")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Rendering bitmap…")); // set "busy" cursor desktop()->setWaitingCursor(); } diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 38b5c7f89c..891fd19a06 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -2349,7 +2349,7 @@ sp_selected_path_simplify_items(SPDesktop *desktop, pathsSimplified++; if (pathsSimplified % 20 == 0) { - gchar *message = g_strdup_printf(_("%s %d of %d paths simplified..."), + gchar *message = g_strdup_printf(_("%s %d of %d paths simplified…"), simplificationType, pathsSimplified, totalPathCount); desktop->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, message); g_free(message); diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp index 9c4702fdcc..83ce3be831 100644 --- a/src/trace/trace.cpp +++ b/src/trace/trace.cpp @@ -445,7 +445,7 @@ void Tracer::traceThread() return; } - msgStack->flash(Inkscape::NORMAL_MESSAGE, _("Trace: Starting trace...")); + msgStack->flash(Inkscape::NORMAL_MESSAGE, _("Trace: Starting trace…")); desktop->updateCanvasNow(); std::vector results = diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp index 486af0ddab..90e24177e5 100644 --- a/src/ui/contextmenu.cpp +++ b/src/ui/contextmenu.cpp @@ -355,7 +355,7 @@ void ContextMenu::MakeItemMenu () Gtk::MenuItem* mi; /* Item dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Object Properties..."),true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Object Properties…"),true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ItemProperties)); mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); @@ -420,7 +420,7 @@ void ContextMenu::MakeItemMenu () select_same_submenu->append(*mi); /* Move to layer */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Move to layer ..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Move to layer…"), true)); if (_desktop->selection->isEmpty()) { mi->set_sensitive(FALSE); } else { @@ -640,7 +640,7 @@ void ContextMenu::MakeAnchorMenu() Gtk::MenuItem* mi; /* Link dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("Link _Properties..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Link _Properties…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::AnchorLinkProperties)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -693,13 +693,13 @@ void ContextMenu::MakeImageMenu () const gchar *href = ir->attribute("xlink:href"); /* Image properties */ - mi = Gtk::manage(new Gtk::MenuItem(_("Image _Properties..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Image _Properties…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageProperties)); mi->show(); insert(*mi,positionOfLastDialog++); /* Edit externally */ - mi = Gtk::manage(new Gtk::MenuItem(_("Edit Externally..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Edit Externally…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageEdit)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -708,7 +708,7 @@ void ContextMenu::MakeImageMenu () } /* Trace Bitmap */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Trace Bitmap..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Trace Bitmap…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageTraceBitmap)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -738,7 +738,7 @@ void ContextMenu::MakeImageMenu () /* Extract image */ if (Inkscape::Verb::getbyid( "org.ekips.filter.extractimage" )) { - mi = Gtk::manage(new Gtk::MenuItem(C_("Context menu", "Extract Image..."))); + mi = Gtk::manage(new Gtk::MenuItem(C_("Context menu", "Extract Image…"))); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageExtract)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -899,7 +899,7 @@ void ContextMenu::MakeShapeMenu () Gtk::MenuItem* mi; /* Item dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::FillSettings)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -919,19 +919,19 @@ void ContextMenu::MakeTextMenu () Gtk::MenuItem* mi; /* Fill and Stroke dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::FillSettings)); mi->show(); insert(*mi,positionOfLastDialog++); /* Edit Text dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Text and Font..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Text and Font…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::TextSettings)); mi->show(); insert(*mi,positionOfLastDialog++); /* Spellcheck dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g..."), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g…"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SpellcheckSettings)); mi->show(); insert(*mi,positionOfLastDialog++); diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index 8aacf6c131..ca4a336de4 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -2074,7 +2074,7 @@ void CloneTiler::apply() desktop->setWaitingCursor(); // set statusbar text - gtk_label_set_markup (GTK_LABEL(_status), _("Creating tiled clones...")); + gtk_label_set_markup (GTK_LABEL(_status), _("Creating tiled clones…")); gtk_widget_queue_draw(GTK_WIDGET(_status)); SPObject *obj = selection->singleItem(); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index ba101921b9..d70414284b 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1086,7 +1086,7 @@ void DocumentProperties::addExternalScript(){ xml_doc->root()->addChild(scriptRepr, nullptr); // inform the document, so we can undo - DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script...")); + DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script…")); populate_script_lists(); } @@ -1153,7 +1153,7 @@ void DocumentProperties::addEmbeddedScript(){ xml_doc->root()->addChild(scriptRepr, nullptr); // inform the document, so we can undo - DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EMBEDDED_SCRIPT, _("Add embedded script...")); + DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EMBEDDED_SCRIPT, _("Add embedded script…")); populate_script_lists(); } diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index b02fbb5dcf..eb5bc44646 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -134,7 +134,7 @@ Export::Export () : unit_selector(), units_label(_("Units:")), filename_box(false, 5), - browse_label(_("_Export As..."), true), + browse_label(_("_Export As…"), true), browse_image(), batch_box(false, 5), batch_export(_("B_atch export all selected objects")), @@ -1055,9 +1055,9 @@ void Export::onExport () // Do export gchar * safeFile = Inkscape::IO::sanitizeString(path.c_str()); MessageCleaner msgCleanup(desktop->messageStack()->pushF(Inkscape::IMMEDIATE_MESSAGE, - _("Exporting file %s..."), safeFile), desktop); + _("Exporting file %s…"), safeFile), desktop); MessageCleaner msgFlashCleanup(desktop->messageStack()->flashF(Inkscape::IMMEDIATE_MESSAGE, - _("Exporting file %s..."), safeFile), desktop); + _("Exporting file %s…"), safeFile), desktop); std::vector x; std::vector selected(desktop->getSelection()->items().begin(), desktop->getSelection()->items().end()); if (!sp_export_png_file (doc, path.c_str(), diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 9248b59449..937a418617 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1259,9 +1259,9 @@ void InkscapePreferences::initPageIO() Gtk::TreeModel::iterator iter_io = this->AddPage(_page_io, _("Input/Output"), PREFS_PAGE_IO); _path_io = _page_list.get_model()->get_path(iter_io); - _save_use_current_dir.init( _("Use current directory for \"Save As ...\""), "/dialogs/save_as/use_current_dir", true); + _save_use_current_dir.init( _("Use current directory for \"Save As…\""), "/dialogs/save_as/use_current_dir", true); _page_io.add_line( false, "", _save_use_current_dir, "", - _("When this option is on, the \"Save as...\" and \"Save a Copy...\" dialogs will always open in the directory where the currently open document is; when it's off, each will open in the directory where you last saved a file using it"), true); + _("When this option is on, the \"Save as…\" and \"Save a Copy…\" dialogs will always open in the directory where the currently open document is; when it's off, each will open in the directory where you last saved a file using it"), true); _misc_comment.init( _("Add label comments to printing output"), "/printing/debug/show-label-comments", false); _page_io.add_line( false, "", _misc_comment, "", @@ -2042,12 +2042,12 @@ void InkscapePreferences::initKeyboardShortcuts(Gtk::TreeModel::iterator iter_ui box_buttons->pack_start(*kb_reset, true, true, 6); box_buttons->set_child_secondary(*kb_reset); - auto kb_import = Gtk::manage(new Gtk::Button(_("Import ..."))); + auto kb_import = Gtk::manage(new Gtk::Button(_("Import…"))); kb_import->set_use_underline(); kb_import->set_tooltip_text(_("Import custom keyboard shortcuts from a file")); box_buttons->pack_end(*kb_import, true, true, 6); - auto kb_export = Gtk::manage(new Gtk::Button(_("Export ..."))); + auto kb_export = Gtk::manage(new Gtk::Button(_("Export…"))); kb_export->set_use_underline(); kb_export->set_tooltip_text(_("Export custom keyboard shortcuts to a file")); box_buttons->pack_end(*kb_export, true, true, 6); diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index f02df80428..97e3d63d25 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -1822,7 +1822,7 @@ ObjectsPanel::ObjectsPanel() : //Add object/layer Gtk::Button* btn = Gtk::manage( new Gtk::Button() ); - _styleButton(*btn, INKSCAPE_ICON("list-add"), _("Add layer...")); + _styleButton(*btn, INKSCAPE_ICON("list-add"), _("Add layer…")); btn->set_relief(Gtk::RELIEF_NONE); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_NEW) ); _buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK); diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index 52692999ab..5b9eef1712 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -627,7 +627,7 @@ void ImportDialog::on_button_import_clicked() { button_import->set_sensitive(false); button_close->hide(); button_cancel->show(); - widget_status->start_process(_("Downloading image...")); + widget_status->start_process(_("Downloading image…")); download_resource(TYPE_IMAGE, row); } @@ -942,7 +942,7 @@ void ImportDialog::on_button_cancel_clicked() void ImportDialog::on_entry_search_activated() { preview_files->clear(); - widget_status->start_process(_("Searching clipart...")); + widget_status->start_process(_("Searching clipart…")); notebook_content->set_current_page(NOTEBOOK_PAGE_LOGO); diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp index 83b7dbef6e..c737c6ec99 100644 --- a/src/ui/dialog/spellcheck.cpp +++ b/src/ui/dialog/spellcheck.cpp @@ -694,7 +694,7 @@ SpellCheck::deleteLastRect () void SpellCheck::doSpellcheck () { - banner_label.set_markup(_("Checking...")); + banner_label.set_markup(_("Checking…")); //desktop->setWaitingCursor(); diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 17eec56d2f..f203f06ad8 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -801,7 +801,7 @@ Gtk::VBox* SvgFontsDialog::glyphs_tab(){ missing_glyph_hbox->pack_start(*missing_glyph_label, false,false); missing_glyph_hbox->pack_start(missing_glyph_button, false,false); missing_glyph_hbox->pack_start(missing_glyph_reset_button, false,false); - missing_glyph_button.set_label(_("From selection...")); + missing_glyph_button.set_label(_("From selection…")); missing_glyph_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::missing_glyph_description_from_selected_path)); missing_glyph_reset_button.set_label(_("Reset")); missing_glyph_reset_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::reset_missing_glyph_description)); @@ -825,7 +825,7 @@ Gtk::VBox* SvgFontsDialog::glyphs_tab(){ hb->pack_start(glyph_from_path_button, false,false); glyphs_vbox.pack_start(*hb, false, false); - glyph_from_path_button.set_label(_("Get curves from selection...")); + glyph_from_path_button.set_label(_("Get curves from selection…")); glyph_from_path_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::set_glyph_description_from_selected_path)); dynamic_cast( _GlyphsList.get_column_cell_renderer(0))->signal_edited().connect( diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 7884e39f0e..5d5ae1efe6 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -289,7 +289,7 @@ bool colorItemHandleButtonPress(GdkEventButton* event, UI::Widget::Preview *prev popupExtras.push_back(child); gtk_widget_set_sensitive( child, FALSE ); - child = gtk_menu_item_new_with_label(_("Edit...")); + child = gtk_menu_item_new_with_label(_("Edit…")); g_signal_connect( G_OBJECT(child), "activate", G_CALLBACK(editGradient), diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 06a76605bd..5886019186 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -453,9 +453,8 @@ void SymbolsDialog::rebuild() { icons_found = false; //We are not in search all docs - if (search->get_text() != _("Searching...") && - search->get_text() != _("Loading all symbols...") && - search->get_text() != _("Searching....") ) + if (search->get_text() != _("Searching…") && + search->get_text() != _("Loading all symbols…") ) { search_str = ""; search->set_text(""); @@ -475,7 +474,7 @@ void SymbolsDialog::showOverlay() { if (!all_docs_processed ) { overlay_icon->show(); overlay_title->set_markup(Glib::ustring("") + - Glib::ustring(_("Search in all symbol sets...")) + Glib::ustring("")); + Glib::ustring(_("Search in all symbol sets…")) + Glib::ustring("")); overlay_desc->set_markup(Glib::ustring("") + Glib::ustring(_("First search can be slow.")) + Glib::ustring("")); } else if (!icons_found && !search_str.empty()) { @@ -484,7 +483,7 @@ void SymbolsDialog::showOverlay() { } else { overlay_icon->show(); overlay_title->set_markup(Glib::ustring("") + - Glib::ustring(_("Search in all symbol sets...")) + Glib::ustring("")); + Glib::ustring(_("Search in all symbol sets…")) + Glib::ustring("")); overlay_desc->set_markup(Glib::ustring("") + Glib::ustring("")); } @@ -1053,14 +1052,14 @@ void SymbolsDialog::beforeSearch(GdkEventKey* evt) SPDocument* symbol_document = selectedSymbols(); if (symbol_document) { //We are not in search all docs - search->set_text(_("Searching...")); + search->set_text(_("Searching…")); store->clear(); icons_found = false; addSymbolsInDoc(symbol_document); } else { idleconn.disconnect(); idleconn = Glib::signal_idle().connect( sigc::mem_fun(*this, &SymbolsDialog::callbackAllSymbols)); - search->set_text(_("Loading all symbols...")); + search->set_text(_("Loading all symbols…")); } } @@ -1124,7 +1123,7 @@ bool SymbolsDialog::callbackSymbols(){ bool SymbolsDialog::callbackAllSymbols(){ Glib::ustring current = symbol_set->get_active_text(); - if (current == ALLDOCS && search->get_text() == _("Loading all symbols...")) { + if (current == ALLDOCS && search->get_text() == _("Loading all symbols…")) { size_t counter = 0; std::map symbol_sets_tmp = symbol_sets; for(auto const &symbol_document_map : symbol_sets_tmp) { @@ -1146,7 +1145,7 @@ bool SymbolsDialog::callbackAllSymbols(){ progress_bar->set_fraction(1.0); all_docs_processed = true; addSymbols(); - search->set_text("Searching..."); + search->set_text("Searching…"); return false; } return true; diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 030e90af07..15a8d12798 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -210,7 +210,7 @@ PageSizer::PageSizer(Registry & _wr) //## Set up fit page expander _fitPageMarginExpander.set_use_underline(); - _fitPageMarginExpander.set_label(_("Resi_ze page to content...")); + _fitPageMarginExpander.set_label(_("Resi_ze page to content…")); _fitPageMarginExpander.add(_marginTable); //## Set up margin settings @@ -280,7 +280,7 @@ PageSizer::PageSizer(Registry & _wr) _scaleTable.attach(_viewboxExpander, 0, 2, 2, 1); _viewboxExpander.set_use_underline(); - _viewboxExpander.set_label(_("_Viewbox...")); + _viewboxExpander.set_label(_("_Viewbox…")); _viewboxExpander.add(_viewboxTable); _viewboxTable.set_row_spacing(2); diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 7e79abb5bf..c6899fb982 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -761,7 +761,7 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path, Gtk::Image *im = sp_get_icon_image("applications-graphics", Gtk::ICON_SIZE_BUTTON); pixlabel->pack_start(*im); Gtk::Label *l = new Gtk::Label(); - l->set_markup_with_mnemonic(_("_Browse...")); + l->set_markup_with_mnemonic(_("_Browse…")); pixlabel->pack_start(*l); relatedButton->add(*pixlabel); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 149b70f6fc..09ea5e6c2c 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -255,7 +255,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _multiple[i].show_all(); __multiple[i] = (i == SS_FILL)? (_("Multiple selected objects have the same fill")) : (_("Multiple selected objects have the same stroke")); - _popup_edit[i].add(*(new Gtk::Label((i == SS_FILL)? _("Edit fill...") : _("Edit stroke..."), Gtk::ALIGN_START))); + _popup_edit[i].add(*(new Gtk::Label((i == SS_FILL)? _("Edit fill…") : _("Edit stroke…"), Gtk::ALIGN_START))); _popup_edit[i].signal_activate().connect(sigc::mem_fun(*this, (i == SS_FILL)? &SelectedStyle::on_fill_edit : &SelectedStyle::on_stroke_edit )); diff --git a/src/verbs.cpp b/src/verbs.cpp index e18ea71c72..8fa001be70 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2592,30 +2592,30 @@ Verb *Verb::_base_verbs[] = { // File new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("_New"), N_("Create new document from the default template"), INKSCAPE_ICON("document-new")), - new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."), N_("Open an existing document"), + new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open…"), N_("Open an existing document"), INKSCAPE_ICON("document-open")), new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"), N_("Revert to the last saved version of document (changes will be lost)"), INKSCAPE_ICON("document-revert")), new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"), INKSCAPE_ICON("document-save")), - new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."), N_("Save document under a new name"), + new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As…"), N_("Save document under a new name"), INKSCAPE_ICON("document-save-as")), - new FileVerb(SP_VERB_FILE_SAVE_A_COPY, "FileSaveACopy", N_("Save a Cop_y..."), + new FileVerb(SP_VERB_FILE_SAVE_A_COPY, "FileSaveACopy", N_("Save a Cop_y…"), N_("Save a copy of the document under a new name"), nullptr), - new FileVerb(SP_VERB_FILE_SAVE_TEMPLATE, "FileSaveTemplate", N_("Save template ..."), + new FileVerb(SP_VERB_FILE_SAVE_TEMPLATE, "FileSaveTemplate", N_("Save template…"), N_("Save a copy of the document as template"), nullptr), - new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"), + new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print…"), N_("Print document"), INKSCAPE_ICON("document-print")), // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions) new FileVerb( SP_VERB_FILE_VACUUM, "FileVacuum", N_("Clean _up document"), N_("Remove unused definitions (such as gradients or clipping paths) from the <defs> of the document"), INKSCAPE_ICON("document-cleanup")), - new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."), + new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import…"), N_("Import a bitmap or SVG image into this document"), INKSCAPE_ICON("document-import")), - // new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."), N_("Export this document or a + // new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap…"), N_("Export this document or a // selection as a bitmap image"), INKSCAPE_ICON("document-export")), - new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import Clip Art..."), + new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import Clip Art…"), N_("Import clipart from Open Clip Art Library"), INKSCAPE_ICON("document-import-ocal")), // new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To Open Clip Art Library"), // N_("Export this document to Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_EXPORT_OCAL), @@ -2626,7 +2626,7 @@ Verb *Verb::_base_verbs[] = { new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"), N_("Close this document window"), INKSCAPE_ICON("window-close")), new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), INKSCAPE_ICON("application-exit")), - new FileVerb(SP_VERB_FILE_TEMPLATES, "FileTemplates", N_("New from _Template..."), + new FileVerb(SP_VERB_FILE_TEMPLATES, "FileTemplates", N_("New from _Template…"), N_("Create new project from template"), INKSCAPE_ICON("dialog-templates")), // Edit @@ -2831,11 +2831,11 @@ Verb *Verb::_base_verbs[] = { #if HAVE_POTRACE // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize) - new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."), + new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap…"), N_("Create one or more paths from a bitmap by tracing it"), INKSCAPE_ICON("bitmap-trace")), #endif - new SelectionVerb(SP_VERB_SELECTION_PIXEL_ART, "SelectionPixelArt", N_("Trace Pixel Art..."), + new SelectionVerb(SP_VERB_SELECTION_PIXEL_ART, "SelectionPixelArt", N_("Trace Pixel Art…"), N_("Create paths using Kopf-Lischinski algorithm to vectorize pixel art"), INKSCAPE_ICON("pixelart-trace")), new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("Make a _Bitmap Copy"), @@ -2847,12 +2847,12 @@ Verb *Verb::_base_verbs[] = { // Advanced tutorial for more info new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"), N_("Break selected paths into subpaths"), INKSCAPE_ICON("path-break-apart")), - new SelectionVerb(SP_VERB_SELECTION_ARRANGE, "DialogArrange", N_("_Arrange..."), + new SelectionVerb(SP_VERB_SELECTION_ARRANGE, "DialogArrange", N_("_Arrange…"), N_("Arrange selected objects in a table or circle"), INKSCAPE_ICON("dialog-rows-and-columns")), // Layer - new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."), N_("Create a new layer"), + new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer…"), N_("Create a new layer"), INKSCAPE_ICON("layer-new")), - new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."), N_("Rename the current layer"), + new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer…"), N_("Rename the current layer"), INKSCAPE_ICON("layer-rename")), new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"), N_("Switch to the layer above the current"), INKSCAPE_ICON("layer-previous")), @@ -2862,7 +2862,7 @@ Verb *Verb::_base_verbs[] = { N_("Move selection to the layer above the current"), INKSCAPE_ICON("selection-move-to-layer-above")), new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"), N_("Move selection to the layer below the current"), INKSCAPE_ICON("selection-move-to-layer-below")), - new LayerVerb(SP_VERB_LAYER_MOVE_TO, "LayerMoveTo", N_("Move Selection to Layer..."), N_("Move selection to layer"), + new LayerVerb(SP_VERB_LAYER_MOVE_TO, "LayerMoveTo", N_("Move Selection to Layer…"), N_("Move selection to layer"), INKSCAPE_ICON("layer-rename")), new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"), N_("Raise the current layer to the top"), INKSCAPE_ICON("layer-top")), @@ -3129,86 +3129,86 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"), N_("Toggle color-managed display for this document window"), INKSCAPE_ICON("color-management")), - new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), + new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview…"), N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON("dialog-icon-preview")), // Dialogs - new DialogVerb(SP_VERB_DIALOG_PROTOTYPE, "DialogPrototype", N_("Prototype..."), N_("Prototype Dialog"), + new DialogVerb(SP_VERB_DIALOG_PROTOTYPE, "DialogPrototype", N_("Prototype…"), N_("Prototype Dialog"), INKSCAPE_ICON("preferences-system")), - new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references..."), + new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references…"), N_("Edit global Inkscape preferences"), INKSCAPE_ICON("preferences-system")), - new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."), + new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties…"), N_("Edit properties of this document (to be saved with the document)"), INKSCAPE_ICON("document-properties")), - new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."), + new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata…"), N_("Edit document metadata (to be saved with the document)"), INKSCAPE_ICON("document-metadata")), - new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."), - N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties..."), + new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke…"), + N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties"), INKSCAPE_ICON("dialog-fill-and-stroke")), // FIXME: Probably better to either use something from the icon naming spec or ship our own "select-font" icon // Technically what we show are unicode code points and not glyphs. The actual glyphs shown are determined by the // shaping engines. - new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("_Unicode Characters..."), + new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("_Unicode Characters…"), N_("Select Unicode characters from a palette"), INKSCAPE_ICON("gtk-select-font")), // FIXME: Probably better to either use something from the icon naming spec or ship our own "select-color" icon // TRANSLATORS: "Swatches" means: color samples - new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."), + new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches…"), N_("Select colors from a swatches palette"), INKSCAPE_ICON("swatches")), - new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols..."), + new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols…"), N_("Select symbol from a symbols palette"), INKSCAPE_ICON("symbols")), - new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."), + new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m…"), N_("Precisely control objects' transformations"), INKSCAPE_ICON("dialog-transform")), - new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."), + new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute…"), N_("Align and distribute objects"), INKSCAPE_ICON("dialog-align-and-distribute")), - new DialogVerb(SP_VERB_DIALOG_SPRAY_OPTION, "DialogSprayOption", N_("_Spray options..."), + new DialogVerb(SP_VERB_DIALOG_SPRAY_OPTION, "DialogSprayOption", N_("_Spray options…"), N_("Some options for the spray"), INKSCAPE_ICON("dialog-spray-options")), - new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."), N_("Undo History"), + new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History…"), N_("Undo History"), INKSCAPE_ICON("edit-undo-history")), - new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."), + new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font…"), N_("View and select font family, font size and other text properties"), INKSCAPE_ICON("dialog-text-and-font")), - new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."), + new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor…"), N_("View and edit the XML tree of the document"), INKSCAPE_ICON("dialog-xml-editor")), - new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find/Replace..."), N_("Find objects in document"), + new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find/Replace…"), N_("Find objects in document"), INKSCAPE_ICON("edit-find")), - new DialogVerb(SP_VERB_DIALOG_FINDREPLACE, "DialogFindReplace", N_("Find and _Replace Text..."), + new DialogVerb(SP_VERB_DIALOG_FINDREPLACE, "DialogFindReplace", N_("Find and _Replace Text…"), N_("Find and replace text in document"), INKSCAPE_ICON("edit-find-replace")), - new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g..."), + new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g…"), N_("Check spelling of text in document"), INKSCAPE_ICON("tools-check-spelling")), - new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."), N_("View debug messages"), + new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages…"), N_("View debug messages"), INKSCAPE_ICON("dialog-messages")), new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"), N_("Show or hide all open dialogs"), INKSCAPE_ICON("show-dialogs")), - new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."), + new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones…"), N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), INKSCAPE_ICON("dialog-tile-clones")), - new DialogVerb(SP_VERB_DIALOG_ATTR, "DialogObjectAttributes", N_("_Object attributes..."), - N_("Edit the object attributes..."), INKSCAPE_ICON("dialog-object-properties")), - new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."), + new DialogVerb(SP_VERB_DIALOG_ATTR, "DialogObjectAttributes", N_("_Object attributes…"), + N_("Edit the object attributes"), INKSCAPE_ICON("dialog-object-properties")), + new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties…"), N_("Edit the ID, locked and visible status, and other object properties"), INKSCAPE_ICON("dialog-object-properties")), - new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."), + new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices…"), N_("Configure extended input devices, such as a graphics tablet"), INKSCAPE_ICON("dialog-input-devices")), - new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."), + new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions…"), N_("Query information about extensions"), nullptr), - new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."), N_("View Layers"), + new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s…"), N_("View Layers"), INKSCAPE_ICON("dialog-layers")), - new DialogVerb(SP_VERB_DIALOG_OBJECTS, "DialogObjects", N_("Object_s..."), N_("View Objects"), + new DialogVerb(SP_VERB_DIALOG_OBJECTS, "DialogObjects", N_("Object_s…"), N_("View Objects"), INKSCAPE_ICON("dialog-layers")), - new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogTags", N_("Selection se_ts..."), N_("View Tags"), + new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogTags", N_("Selection se_ts…"), N_("View Tags"), INKSCAPE_ICON("edit-select-all-layers")), - new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog..."), N_("View Style Dialog"), nullptr), - new DialogVerb(SP_VERB_DIALOG_CSS, "DialogCss", N_("Css Dialog..."), N_("View Css Dialog"), nullptr), - new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects ..."), + new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog…"), N_("View Style Dialog"), nullptr), + new DialogVerb(SP_VERB_DIALOG_CSS, "DialogCss", N_("Css Dialog…"), N_("View Css Dialog"), nullptr), + new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects…"), N_("Manage, edit, and apply path effects"), INKSCAPE_ICON("dialog-path-effects")), - new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor..."), + new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor…"), N_("Manage, edit, and apply SVG filters"), INKSCAPE_ICON("dialog-filters")), - new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Font Editor..."), N_("Edit SVG fonts"), nullptr), - new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors..."), + new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Font Editor…"), N_("Edit SVG fonts"), nullptr), + new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors…"), N_("Select which color separations to render in Print Colors Preview rendermode"), nullptr), - new DialogVerb(SP_VERB_DIALOG_EXPORT, "DialogExport", N_("_Export PNG Image..."), + new DialogVerb(SP_VERB_DIALOG_EXPORT, "DialogExport", N_("_Export PNG Image…"), N_("Export this document or a selection as a PNG image"), INKSCAPE_ICON("document-export")), // Help new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"), @@ -3248,7 +3248,7 @@ Verb *Verb::_base_verbs[] = { // Effect -- renamed Extension new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Exte_nsion"), N_("Repeat the last extension with the same settings"), nullptr), - new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("_Previous Extension Settings..."), + new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("_Previous Extension Settings…"), N_("Repeat the last extension with new settings"), nullptr), // Fit Page -- GitLab From 9d9057c420694470ad39eae7c77f55f908aa11db Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Mon, 11 Feb 2019 11:58:25 +0000 Subject: [PATCH 04/28] Revert last two commits; they were made in error. --- doc/ui-text-styleguide.md | 6 -- src/extension/execution-env.cpp | 2 +- src/file-update.cpp | 2 +- src/file.cpp | 4 +- src/inkscape.cpp | 2 +- src/live_effects/lpe-ruler.cpp | 2 +- src/object/sp-use.cpp | 2 +- src/path-chemistry.cpp | 8 +- src/selection-chemistry.cpp | 2 +- src/splivarot.cpp | 2 +- src/trace/trace.cpp | 2 +- src/ui/contextmenu.cpp | 22 +++--- src/ui/dialog/clonetiler.cpp | 2 +- src/ui/dialog/document-properties.cpp | 4 +- src/ui/dialog/export.cpp | 6 +- src/ui/dialog/inkscape-preferences.cpp | 8 +- src/ui/dialog/objects.cpp | 2 +- src/ui/dialog/ocaldialogs.cpp | 4 +- src/ui/dialog/spellcheck.cpp | 2 +- src/ui/dialog/svg-fonts-dialog.cpp | 4 +- src/ui/dialog/swatches.cpp | 2 +- src/ui/dialog/symbols.cpp | 17 ++-- src/ui/widget/page-sizer.cpp | 4 +- src/ui/widget/preferences-widget.cpp | 2 +- src/ui/widget/selected-style.cpp | 2 +- src/verbs.cpp | 104 ++++++++++++------------- 26 files changed, 107 insertions(+), 112 deletions(-) delete mode 100644 doc/ui-text-styleguide.md diff --git a/doc/ui-text-styleguide.md b/doc/ui-text-styleguide.md deleted file mode 100644 index 2c567f018d..0000000000 --- a/doc/ui-text-styleguide.md +++ /dev/null @@ -1,6 +0,0 @@ - -## Micro-Typography - -### Ellipsis - -... -> … diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index f036b63d11..ca770e1f6f 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -117,7 +117,7 @@ ExecutionEnv::createWorkingDialog () { return; Gtk::Window *window = Glib::wrap(GTK_WINDOW(toplevel), false); - gchar * dlgmessage = g_strdup_printf(_("'%s' working, please wait…"), _(_effect->get_name())); + gchar * dlgmessage = g_strdup_printf(_("'%s' working, please wait..."), _(_effect->get_name())); _visibleDialog = new Gtk::MessageDialog(*window, dlgmessage, false, // use markup diff --git a/src/file-update.cpp b/src/file-update.cpp index 5d44ca1f34..0aa40ab625 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -357,7 +357,7 @@ void sp_file_convert_dpi(SPDocument *doc) Gtk::RadioButton choice2_2(c2, _("The accuracy of the physical unit size and position values of objects\n" "in the file is most important. (Experimental.)")); Gtk::CheckButton backup_button(_("Create a backup file in same directory.")); - Gtk::Expander moreinfo(_("More details…")); + Gtk::Expander moreinfo(_("More details...")); Gtk::Label moreinfo_text("", Gtk::ALIGN_START); moreinfo_text.set_markup( _("We've updated Inkscape to follow the CSS standard of 96 DPI for " diff --git a/src/file.cpp b/src/file.cpp index 6fbe5e9e71..cce8318273 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -910,7 +910,7 @@ sp_file_save(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*data*/) if (!SP_ACTIVE_DOCUMENT) return false; - SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Saving document…")); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Saving document...")); sp_namedview_document_from_window(SP_ACTIVE_DESKTOP); return sp_file_save_document(parentWindow, SP_ACTIVE_DOCUMENT); @@ -1686,7 +1686,7 @@ sp_file_export_to_ocal(Gtk::Window &parentWindow) return; bool success = sp_file_export_to_ocal_dialog(parentWindow); if (success) - SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document exported…")); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document exported...")); } */ diff --git a/src/inkscape.cpp b/src/inkscape.cpp index f274dd62f1..53536b878e 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -243,7 +243,7 @@ int Application::autosave() gint docnum = 0; int pid = ::getpid(); - SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Autosaving documents…")); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Autosaving documents...")); for (auto & iter : _document_set) { SPDocument *doc = iter.first; diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index 7590e44290..75052ad33e 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -40,7 +40,7 @@ LPERuler::LPERuler(LivePathEffectObject *lpeobject) : unit(_("Unit:"), _("Unit"), "unit", &wr, this), mark_length(_("Ma_jor length:"), _("Length of major ruler marks"), "mark_length", &wr, this, 14.0), minor_mark_length(_("Mino_r length:"), _("Length of minor ruler marks"), "minor_mark_length", &wr, this, 7.0), - major_mark_steps(_("Major steps_:"), _("Draw a major mark every … steps"), "major_mark_steps", &wr, this, 5), + major_mark_steps(_("Major steps_:"), _("Draw a major mark every ... steps"), "major_mark_steps", &wr, this, 5), shift(_("Shift marks _by:"), _("Shift marks by this many steps"), "shift", &wr, this, 0), mark_dir(_("Mark direction:"), _("Direction of marks (when viewing along the path from start to end)"), "mark_dir", MarkDirTypeConverter, &wr, this, MARKDIR_LEFT), offset(_("_Offset:"), _("Offset of first mark"), "offset", &wr, this, 0.0), diff --git a/src/object/sp-use.cpp b/src/object/sp-use.cpp index 331aeeacb9..3618cf18fb 100644 --- a/src/object/sp-use.cpp +++ b/src/object/sp-use.cpp @@ -254,7 +254,7 @@ gchar* SPUse::description() const { if (recursion_depth >= 4) { /* TRANSLATORS: Used for statusbar description for long chains: * "Clone of: Clone of: ... in Layer 1". */ - return g_strdup(_("…")); + return g_strdup(_("...")); /* We could do better, e.g. chasing the href chain until we reach something other than * a , and giving its description. */ } diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 9aad0066ea..8efd27be88 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -70,7 +70,7 @@ ObjectSet::combine(bool skip_undo) } if(desktop()){ - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Combining paths…")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Combining paths...")); // set "busy" cursor desktop()->setWaitingCursor(); } @@ -205,7 +205,7 @@ ObjectSet::breakApart(bool skip_undo) return; } if(desktop()){ - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Breaking apart paths…")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Breaking apart paths...")); // set "busy" cursor desktop()->setWaitingCursor(); // disable redrawing during the break-apart operation for remarkable speedup for large paths @@ -310,7 +310,7 @@ void ObjectSet::toCurves(bool skip_undo) bool did = false; if (desktop()) { - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Converting objects to paths…")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Converting objects to paths...")); // set "busy" cursor desktop()->setWaitingCursor(); } @@ -643,7 +643,7 @@ ObjectSet::pathReverse() // set "busy" cursor if(desktop()){ desktop()->setWaitingCursor(); - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Reversing paths…")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Reversing paths...")); } bool did = false; diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 41e628d24a..ed4c23bbc7 100755 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3606,7 +3606,7 @@ void ObjectSet::createBitmapCopy() return; } if(desktop()){ - desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Rendering bitmap…")); + desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Rendering bitmap...")); // set "busy" cursor desktop()->setWaitingCursor(); } diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 891fd19a06..38b5c7f89c 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -2349,7 +2349,7 @@ sp_selected_path_simplify_items(SPDesktop *desktop, pathsSimplified++; if (pathsSimplified % 20 == 0) { - gchar *message = g_strdup_printf(_("%s %d of %d paths simplified…"), + gchar *message = g_strdup_printf(_("%s %d of %d paths simplified..."), simplificationType, pathsSimplified, totalPathCount); desktop->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, message); g_free(message); diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp index 83ce3be831..9c4702fdcc 100644 --- a/src/trace/trace.cpp +++ b/src/trace/trace.cpp @@ -445,7 +445,7 @@ void Tracer::traceThread() return; } - msgStack->flash(Inkscape::NORMAL_MESSAGE, _("Trace: Starting trace…")); + msgStack->flash(Inkscape::NORMAL_MESSAGE, _("Trace: Starting trace...")); desktop->updateCanvasNow(); std::vector results = diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp index 90e24177e5..486af0ddab 100644 --- a/src/ui/contextmenu.cpp +++ b/src/ui/contextmenu.cpp @@ -355,7 +355,7 @@ void ContextMenu::MakeItemMenu () Gtk::MenuItem* mi; /* Item dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Object Properties…"),true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Object Properties..."),true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ItemProperties)); mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); @@ -420,7 +420,7 @@ void ContextMenu::MakeItemMenu () select_same_submenu->append(*mi); /* Move to layer */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Move to layer…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Move to layer ..."), true)); if (_desktop->selection->isEmpty()) { mi->set_sensitive(FALSE); } else { @@ -640,7 +640,7 @@ void ContextMenu::MakeAnchorMenu() Gtk::MenuItem* mi; /* Link dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("Link _Properties…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Link _Properties..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::AnchorLinkProperties)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -693,13 +693,13 @@ void ContextMenu::MakeImageMenu () const gchar *href = ir->attribute("xlink:href"); /* Image properties */ - mi = Gtk::manage(new Gtk::MenuItem(_("Image _Properties…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Image _Properties..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageProperties)); mi->show(); insert(*mi,positionOfLastDialog++); /* Edit externally */ - mi = Gtk::manage(new Gtk::MenuItem(_("Edit Externally…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Edit Externally..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageEdit)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -708,7 +708,7 @@ void ContextMenu::MakeImageMenu () } /* Trace Bitmap */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Trace Bitmap…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Trace Bitmap..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageTraceBitmap)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -738,7 +738,7 @@ void ContextMenu::MakeImageMenu () /* Extract image */ if (Inkscape::Verb::getbyid( "org.ekips.filter.extractimage" )) { - mi = Gtk::manage(new Gtk::MenuItem(C_("Context menu", "Extract Image…"))); + mi = Gtk::manage(new Gtk::MenuItem(C_("Context menu", "Extract Image..."))); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageExtract)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -899,7 +899,7 @@ void ContextMenu::MakeShapeMenu () Gtk::MenuItem* mi; /* Item dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::FillSettings)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -919,19 +919,19 @@ void ContextMenu::MakeTextMenu () Gtk::MenuItem* mi; /* Fill and Stroke dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::FillSettings)); mi->show(); insert(*mi,positionOfLastDialog++); /* Edit Text dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Text and Font…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Text and Font..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::TextSettings)); mi->show(); insert(*mi,positionOfLastDialog++); /* Spellcheck dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g…"), true)); + mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SpellcheckSettings)); mi->show(); insert(*mi,positionOfLastDialog++); diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index ca4a336de4..8aacf6c131 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -2074,7 +2074,7 @@ void CloneTiler::apply() desktop->setWaitingCursor(); // set statusbar text - gtk_label_set_markup (GTK_LABEL(_status), _("Creating tiled clones…")); + gtk_label_set_markup (GTK_LABEL(_status), _("Creating tiled clones...")); gtk_widget_queue_draw(GTK_WIDGET(_status)); SPObject *obj = selection->singleItem(); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index d70414284b..ba101921b9 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1086,7 +1086,7 @@ void DocumentProperties::addExternalScript(){ xml_doc->root()->addChild(scriptRepr, nullptr); // inform the document, so we can undo - DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script…")); + DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script...")); populate_script_lists(); } @@ -1153,7 +1153,7 @@ void DocumentProperties::addEmbeddedScript(){ xml_doc->root()->addChild(scriptRepr, nullptr); // inform the document, so we can undo - DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EMBEDDED_SCRIPT, _("Add embedded script…")); + DocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EMBEDDED_SCRIPT, _("Add embedded script...")); populate_script_lists(); } diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index eb5bc44646..b02fbb5dcf 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -134,7 +134,7 @@ Export::Export () : unit_selector(), units_label(_("Units:")), filename_box(false, 5), - browse_label(_("_Export As…"), true), + browse_label(_("_Export As..."), true), browse_image(), batch_box(false, 5), batch_export(_("B_atch export all selected objects")), @@ -1055,9 +1055,9 @@ void Export::onExport () // Do export gchar * safeFile = Inkscape::IO::sanitizeString(path.c_str()); MessageCleaner msgCleanup(desktop->messageStack()->pushF(Inkscape::IMMEDIATE_MESSAGE, - _("Exporting file %s…"), safeFile), desktop); + _("Exporting file %s..."), safeFile), desktop); MessageCleaner msgFlashCleanup(desktop->messageStack()->flashF(Inkscape::IMMEDIATE_MESSAGE, - _("Exporting file %s…"), safeFile), desktop); + _("Exporting file %s..."), safeFile), desktop); std::vector x; std::vector selected(desktop->getSelection()->items().begin(), desktop->getSelection()->items().end()); if (!sp_export_png_file (doc, path.c_str(), diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 937a418617..9248b59449 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1259,9 +1259,9 @@ void InkscapePreferences::initPageIO() Gtk::TreeModel::iterator iter_io = this->AddPage(_page_io, _("Input/Output"), PREFS_PAGE_IO); _path_io = _page_list.get_model()->get_path(iter_io); - _save_use_current_dir.init( _("Use current directory for \"Save As…\""), "/dialogs/save_as/use_current_dir", true); + _save_use_current_dir.init( _("Use current directory for \"Save As ...\""), "/dialogs/save_as/use_current_dir", true); _page_io.add_line( false, "", _save_use_current_dir, "", - _("When this option is on, the \"Save as…\" and \"Save a Copy…\" dialogs will always open in the directory where the currently open document is; when it's off, each will open in the directory where you last saved a file using it"), true); + _("When this option is on, the \"Save as...\" and \"Save a Copy...\" dialogs will always open in the directory where the currently open document is; when it's off, each will open in the directory where you last saved a file using it"), true); _misc_comment.init( _("Add label comments to printing output"), "/printing/debug/show-label-comments", false); _page_io.add_line( false, "", _misc_comment, "", @@ -2042,12 +2042,12 @@ void InkscapePreferences::initKeyboardShortcuts(Gtk::TreeModel::iterator iter_ui box_buttons->pack_start(*kb_reset, true, true, 6); box_buttons->set_child_secondary(*kb_reset); - auto kb_import = Gtk::manage(new Gtk::Button(_("Import…"))); + auto kb_import = Gtk::manage(new Gtk::Button(_("Import ..."))); kb_import->set_use_underline(); kb_import->set_tooltip_text(_("Import custom keyboard shortcuts from a file")); box_buttons->pack_end(*kb_import, true, true, 6); - auto kb_export = Gtk::manage(new Gtk::Button(_("Export…"))); + auto kb_export = Gtk::manage(new Gtk::Button(_("Export ..."))); kb_export->set_use_underline(); kb_export->set_tooltip_text(_("Export custom keyboard shortcuts to a file")); box_buttons->pack_end(*kb_export, true, true, 6); diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 97e3d63d25..f02df80428 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -1822,7 +1822,7 @@ ObjectsPanel::ObjectsPanel() : //Add object/layer Gtk::Button* btn = Gtk::manage( new Gtk::Button() ); - _styleButton(*btn, INKSCAPE_ICON("list-add"), _("Add layer…")); + _styleButton(*btn, INKSCAPE_ICON("list-add"), _("Add layer...")); btn->set_relief(Gtk::RELIEF_NONE); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_NEW) ); _buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK); diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index 5b9eef1712..52692999ab 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -627,7 +627,7 @@ void ImportDialog::on_button_import_clicked() { button_import->set_sensitive(false); button_close->hide(); button_cancel->show(); - widget_status->start_process(_("Downloading image…")); + widget_status->start_process(_("Downloading image...")); download_resource(TYPE_IMAGE, row); } @@ -942,7 +942,7 @@ void ImportDialog::on_button_cancel_clicked() void ImportDialog::on_entry_search_activated() { preview_files->clear(); - widget_status->start_process(_("Searching clipart…")); + widget_status->start_process(_("Searching clipart...")); notebook_content->set_current_page(NOTEBOOK_PAGE_LOGO); diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp index c737c6ec99..83b7dbef6e 100644 --- a/src/ui/dialog/spellcheck.cpp +++ b/src/ui/dialog/spellcheck.cpp @@ -694,7 +694,7 @@ SpellCheck::deleteLastRect () void SpellCheck::doSpellcheck () { - banner_label.set_markup(_("Checking…")); + banner_label.set_markup(_("Checking...")); //desktop->setWaitingCursor(); diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index f203f06ad8..17eec56d2f 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -801,7 +801,7 @@ Gtk::VBox* SvgFontsDialog::glyphs_tab(){ missing_glyph_hbox->pack_start(*missing_glyph_label, false,false); missing_glyph_hbox->pack_start(missing_glyph_button, false,false); missing_glyph_hbox->pack_start(missing_glyph_reset_button, false,false); - missing_glyph_button.set_label(_("From selection…")); + missing_glyph_button.set_label(_("From selection...")); missing_glyph_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::missing_glyph_description_from_selected_path)); missing_glyph_reset_button.set_label(_("Reset")); missing_glyph_reset_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::reset_missing_glyph_description)); @@ -825,7 +825,7 @@ Gtk::VBox* SvgFontsDialog::glyphs_tab(){ hb->pack_start(glyph_from_path_button, false,false); glyphs_vbox.pack_start(*hb, false, false); - glyph_from_path_button.set_label(_("Get curves from selection…")); + glyph_from_path_button.set_label(_("Get curves from selection...")); glyph_from_path_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::set_glyph_description_from_selected_path)); dynamic_cast( _GlyphsList.get_column_cell_renderer(0))->signal_edited().connect( diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 5d5ae1efe6..7884e39f0e 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -289,7 +289,7 @@ bool colorItemHandleButtonPress(GdkEventButton* event, UI::Widget::Preview *prev popupExtras.push_back(child); gtk_widget_set_sensitive( child, FALSE ); - child = gtk_menu_item_new_with_label(_("Edit…")); + child = gtk_menu_item_new_with_label(_("Edit...")); g_signal_connect( G_OBJECT(child), "activate", G_CALLBACK(editGradient), diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 5886019186..06a76605bd 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -453,8 +453,9 @@ void SymbolsDialog::rebuild() { icons_found = false; //We are not in search all docs - if (search->get_text() != _("Searching…") && - search->get_text() != _("Loading all symbols…") ) + if (search->get_text() != _("Searching...") && + search->get_text() != _("Loading all symbols...") && + search->get_text() != _("Searching....") ) { search_str = ""; search->set_text(""); @@ -474,7 +475,7 @@ void SymbolsDialog::showOverlay() { if (!all_docs_processed ) { overlay_icon->show(); overlay_title->set_markup(Glib::ustring("") + - Glib::ustring(_("Search in all symbol sets…")) + Glib::ustring("")); + Glib::ustring(_("Search in all symbol sets...")) + Glib::ustring("")); overlay_desc->set_markup(Glib::ustring("") + Glib::ustring(_("First search can be slow.")) + Glib::ustring("")); } else if (!icons_found && !search_str.empty()) { @@ -483,7 +484,7 @@ void SymbolsDialog::showOverlay() { } else { overlay_icon->show(); overlay_title->set_markup(Glib::ustring("") + - Glib::ustring(_("Search in all symbol sets…")) + Glib::ustring("")); + Glib::ustring(_("Search in all symbol sets...")) + Glib::ustring("")); overlay_desc->set_markup(Glib::ustring("") + Glib::ustring("")); } @@ -1052,14 +1053,14 @@ void SymbolsDialog::beforeSearch(GdkEventKey* evt) SPDocument* symbol_document = selectedSymbols(); if (symbol_document) { //We are not in search all docs - search->set_text(_("Searching…")); + search->set_text(_("Searching...")); store->clear(); icons_found = false; addSymbolsInDoc(symbol_document); } else { idleconn.disconnect(); idleconn = Glib::signal_idle().connect( sigc::mem_fun(*this, &SymbolsDialog::callbackAllSymbols)); - search->set_text(_("Loading all symbols…")); + search->set_text(_("Loading all symbols...")); } } @@ -1123,7 +1124,7 @@ bool SymbolsDialog::callbackSymbols(){ bool SymbolsDialog::callbackAllSymbols(){ Glib::ustring current = symbol_set->get_active_text(); - if (current == ALLDOCS && search->get_text() == _("Loading all symbols…")) { + if (current == ALLDOCS && search->get_text() == _("Loading all symbols...")) { size_t counter = 0; std::map symbol_sets_tmp = symbol_sets; for(auto const &symbol_document_map : symbol_sets_tmp) { @@ -1145,7 +1146,7 @@ bool SymbolsDialog::callbackAllSymbols(){ progress_bar->set_fraction(1.0); all_docs_processed = true; addSymbols(); - search->set_text("Searching…"); + search->set_text("Searching..."); return false; } return true; diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 15a8d12798..030e90af07 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -210,7 +210,7 @@ PageSizer::PageSizer(Registry & _wr) //## Set up fit page expander _fitPageMarginExpander.set_use_underline(); - _fitPageMarginExpander.set_label(_("Resi_ze page to content…")); + _fitPageMarginExpander.set_label(_("Resi_ze page to content...")); _fitPageMarginExpander.add(_marginTable); //## Set up margin settings @@ -280,7 +280,7 @@ PageSizer::PageSizer(Registry & _wr) _scaleTable.attach(_viewboxExpander, 0, 2, 2, 1); _viewboxExpander.set_use_underline(); - _viewboxExpander.set_label(_("_Viewbox…")); + _viewboxExpander.set_label(_("_Viewbox...")); _viewboxExpander.add(_viewboxTable); _viewboxTable.set_row_spacing(2); diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index c6899fb982..7e79abb5bf 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -761,7 +761,7 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path, Gtk::Image *im = sp_get_icon_image("applications-graphics", Gtk::ICON_SIZE_BUTTON); pixlabel->pack_start(*im); Gtk::Label *l = new Gtk::Label(); - l->set_markup_with_mnemonic(_("_Browse…")); + l->set_markup_with_mnemonic(_("_Browse...")); pixlabel->pack_start(*l); relatedButton->add(*pixlabel); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 09ea5e6c2c..149b70f6fc 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -255,7 +255,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _multiple[i].show_all(); __multiple[i] = (i == SS_FILL)? (_("Multiple selected objects have the same fill")) : (_("Multiple selected objects have the same stroke")); - _popup_edit[i].add(*(new Gtk::Label((i == SS_FILL)? _("Edit fill…") : _("Edit stroke…"), Gtk::ALIGN_START))); + _popup_edit[i].add(*(new Gtk::Label((i == SS_FILL)? _("Edit fill...") : _("Edit stroke..."), Gtk::ALIGN_START))); _popup_edit[i].signal_activate().connect(sigc::mem_fun(*this, (i == SS_FILL)? &SelectedStyle::on_fill_edit : &SelectedStyle::on_stroke_edit )); diff --git a/src/verbs.cpp b/src/verbs.cpp index 8fa001be70..e18ea71c72 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2592,30 +2592,30 @@ Verb *Verb::_base_verbs[] = { // File new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("_New"), N_("Create new document from the default template"), INKSCAPE_ICON("document-new")), - new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open…"), N_("Open an existing document"), + new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."), N_("Open an existing document"), INKSCAPE_ICON("document-open")), new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"), N_("Revert to the last saved version of document (changes will be lost)"), INKSCAPE_ICON("document-revert")), new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"), INKSCAPE_ICON("document-save")), - new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As…"), N_("Save document under a new name"), + new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."), N_("Save document under a new name"), INKSCAPE_ICON("document-save-as")), - new FileVerb(SP_VERB_FILE_SAVE_A_COPY, "FileSaveACopy", N_("Save a Cop_y…"), + new FileVerb(SP_VERB_FILE_SAVE_A_COPY, "FileSaveACopy", N_("Save a Cop_y..."), N_("Save a copy of the document under a new name"), nullptr), - new FileVerb(SP_VERB_FILE_SAVE_TEMPLATE, "FileSaveTemplate", N_("Save template…"), + new FileVerb(SP_VERB_FILE_SAVE_TEMPLATE, "FileSaveTemplate", N_("Save template ..."), N_("Save a copy of the document as template"), nullptr), - new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print…"), N_("Print document"), + new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"), INKSCAPE_ICON("document-print")), // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions) new FileVerb( SP_VERB_FILE_VACUUM, "FileVacuum", N_("Clean _up document"), N_("Remove unused definitions (such as gradients or clipping paths) from the <defs> of the document"), INKSCAPE_ICON("document-cleanup")), - new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import…"), + new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."), N_("Import a bitmap or SVG image into this document"), INKSCAPE_ICON("document-import")), - // new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap…"), N_("Export this document or a + // new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."), N_("Export this document or a // selection as a bitmap image"), INKSCAPE_ICON("document-export")), - new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import Clip Art…"), + new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import Clip Art..."), N_("Import clipart from Open Clip Art Library"), INKSCAPE_ICON("document-import-ocal")), // new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To Open Clip Art Library"), // N_("Export this document to Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_EXPORT_OCAL), @@ -2626,7 +2626,7 @@ Verb *Verb::_base_verbs[] = { new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"), N_("Close this document window"), INKSCAPE_ICON("window-close")), new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), INKSCAPE_ICON("application-exit")), - new FileVerb(SP_VERB_FILE_TEMPLATES, "FileTemplates", N_("New from _Template…"), + new FileVerb(SP_VERB_FILE_TEMPLATES, "FileTemplates", N_("New from _Template..."), N_("Create new project from template"), INKSCAPE_ICON("dialog-templates")), // Edit @@ -2831,11 +2831,11 @@ Verb *Verb::_base_verbs[] = { #if HAVE_POTRACE // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize) - new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap…"), + new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."), N_("Create one or more paths from a bitmap by tracing it"), INKSCAPE_ICON("bitmap-trace")), #endif - new SelectionVerb(SP_VERB_SELECTION_PIXEL_ART, "SelectionPixelArt", N_("Trace Pixel Art…"), + new SelectionVerb(SP_VERB_SELECTION_PIXEL_ART, "SelectionPixelArt", N_("Trace Pixel Art..."), N_("Create paths using Kopf-Lischinski algorithm to vectorize pixel art"), INKSCAPE_ICON("pixelart-trace")), new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("Make a _Bitmap Copy"), @@ -2847,12 +2847,12 @@ Verb *Verb::_base_verbs[] = { // Advanced tutorial for more info new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"), N_("Break selected paths into subpaths"), INKSCAPE_ICON("path-break-apart")), - new SelectionVerb(SP_VERB_SELECTION_ARRANGE, "DialogArrange", N_("_Arrange…"), + new SelectionVerb(SP_VERB_SELECTION_ARRANGE, "DialogArrange", N_("_Arrange..."), N_("Arrange selected objects in a table or circle"), INKSCAPE_ICON("dialog-rows-and-columns")), // Layer - new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer…"), N_("Create a new layer"), + new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."), N_("Create a new layer"), INKSCAPE_ICON("layer-new")), - new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer…"), N_("Rename the current layer"), + new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."), N_("Rename the current layer"), INKSCAPE_ICON("layer-rename")), new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"), N_("Switch to the layer above the current"), INKSCAPE_ICON("layer-previous")), @@ -2862,7 +2862,7 @@ Verb *Verb::_base_verbs[] = { N_("Move selection to the layer above the current"), INKSCAPE_ICON("selection-move-to-layer-above")), new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"), N_("Move selection to the layer below the current"), INKSCAPE_ICON("selection-move-to-layer-below")), - new LayerVerb(SP_VERB_LAYER_MOVE_TO, "LayerMoveTo", N_("Move Selection to Layer…"), N_("Move selection to layer"), + new LayerVerb(SP_VERB_LAYER_MOVE_TO, "LayerMoveTo", N_("Move Selection to Layer..."), N_("Move selection to layer"), INKSCAPE_ICON("layer-rename")), new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"), N_("Raise the current layer to the top"), INKSCAPE_ICON("layer-top")), @@ -3129,86 +3129,86 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"), N_("Toggle color-managed display for this document window"), INKSCAPE_ICON("color-management")), - new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview…"), + new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON("dialog-icon-preview")), // Dialogs - new DialogVerb(SP_VERB_DIALOG_PROTOTYPE, "DialogPrototype", N_("Prototype…"), N_("Prototype Dialog"), + new DialogVerb(SP_VERB_DIALOG_PROTOTYPE, "DialogPrototype", N_("Prototype..."), N_("Prototype Dialog"), INKSCAPE_ICON("preferences-system")), - new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references…"), + new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references..."), N_("Edit global Inkscape preferences"), INKSCAPE_ICON("preferences-system")), - new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties…"), + new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."), N_("Edit properties of this document (to be saved with the document)"), INKSCAPE_ICON("document-properties")), - new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata…"), + new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."), N_("Edit document metadata (to be saved with the document)"), INKSCAPE_ICON("document-metadata")), - new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke…"), - N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties"), + new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."), + N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties..."), INKSCAPE_ICON("dialog-fill-and-stroke")), // FIXME: Probably better to either use something from the icon naming spec or ship our own "select-font" icon // Technically what we show are unicode code points and not glyphs. The actual glyphs shown are determined by the // shaping engines. - new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("_Unicode Characters…"), + new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("_Unicode Characters..."), N_("Select Unicode characters from a palette"), INKSCAPE_ICON("gtk-select-font")), // FIXME: Probably better to either use something from the icon naming spec or ship our own "select-color" icon // TRANSLATORS: "Swatches" means: color samples - new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches…"), + new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."), N_("Select colors from a swatches palette"), INKSCAPE_ICON("swatches")), - new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols…"), + new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols..."), N_("Select symbol from a symbols palette"), INKSCAPE_ICON("symbols")), - new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m…"), + new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."), N_("Precisely control objects' transformations"), INKSCAPE_ICON("dialog-transform")), - new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute…"), + new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."), N_("Align and distribute objects"), INKSCAPE_ICON("dialog-align-and-distribute")), - new DialogVerb(SP_VERB_DIALOG_SPRAY_OPTION, "DialogSprayOption", N_("_Spray options…"), + new DialogVerb(SP_VERB_DIALOG_SPRAY_OPTION, "DialogSprayOption", N_("_Spray options..."), N_("Some options for the spray"), INKSCAPE_ICON("dialog-spray-options")), - new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History…"), N_("Undo History"), + new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."), N_("Undo History"), INKSCAPE_ICON("edit-undo-history")), - new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font…"), + new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."), N_("View and select font family, font size and other text properties"), INKSCAPE_ICON("dialog-text-and-font")), - new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor…"), + new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."), N_("View and edit the XML tree of the document"), INKSCAPE_ICON("dialog-xml-editor")), - new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find/Replace…"), N_("Find objects in document"), + new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find/Replace..."), N_("Find objects in document"), INKSCAPE_ICON("edit-find")), - new DialogVerb(SP_VERB_DIALOG_FINDREPLACE, "DialogFindReplace", N_("Find and _Replace Text…"), + new DialogVerb(SP_VERB_DIALOG_FINDREPLACE, "DialogFindReplace", N_("Find and _Replace Text..."), N_("Find and replace text in document"), INKSCAPE_ICON("edit-find-replace")), - new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g…"), + new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g..."), N_("Check spelling of text in document"), INKSCAPE_ICON("tools-check-spelling")), - new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages…"), N_("View debug messages"), + new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."), N_("View debug messages"), INKSCAPE_ICON("dialog-messages")), new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"), N_("Show or hide all open dialogs"), INKSCAPE_ICON("show-dialogs")), - new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones…"), + new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."), N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), INKSCAPE_ICON("dialog-tile-clones")), - new DialogVerb(SP_VERB_DIALOG_ATTR, "DialogObjectAttributes", N_("_Object attributes…"), - N_("Edit the object attributes"), INKSCAPE_ICON("dialog-object-properties")), - new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties…"), + new DialogVerb(SP_VERB_DIALOG_ATTR, "DialogObjectAttributes", N_("_Object attributes..."), + N_("Edit the object attributes..."), INKSCAPE_ICON("dialog-object-properties")), + new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."), N_("Edit the ID, locked and visible status, and other object properties"), INKSCAPE_ICON("dialog-object-properties")), - new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices…"), + new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."), N_("Configure extended input devices, such as a graphics tablet"), INKSCAPE_ICON("dialog-input-devices")), - new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions…"), + new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."), N_("Query information about extensions"), nullptr), - new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s…"), N_("View Layers"), + new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."), N_("View Layers"), INKSCAPE_ICON("dialog-layers")), - new DialogVerb(SP_VERB_DIALOG_OBJECTS, "DialogObjects", N_("Object_s…"), N_("View Objects"), + new DialogVerb(SP_VERB_DIALOG_OBJECTS, "DialogObjects", N_("Object_s..."), N_("View Objects"), INKSCAPE_ICON("dialog-layers")), - new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogTags", N_("Selection se_ts…"), N_("View Tags"), + new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogTags", N_("Selection se_ts..."), N_("View Tags"), INKSCAPE_ICON("edit-select-all-layers")), - new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog…"), N_("View Style Dialog"), nullptr), - new DialogVerb(SP_VERB_DIALOG_CSS, "DialogCss", N_("Css Dialog…"), N_("View Css Dialog"), nullptr), - new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects…"), + new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog..."), N_("View Style Dialog"), nullptr), + new DialogVerb(SP_VERB_DIALOG_CSS, "DialogCss", N_("Css Dialog..."), N_("View Css Dialog"), nullptr), + new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects ..."), N_("Manage, edit, and apply path effects"), INKSCAPE_ICON("dialog-path-effects")), - new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor…"), + new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor..."), N_("Manage, edit, and apply SVG filters"), INKSCAPE_ICON("dialog-filters")), - new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Font Editor…"), N_("Edit SVG fonts"), nullptr), - new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors…"), + new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Font Editor..."), N_("Edit SVG fonts"), nullptr), + new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors..."), N_("Select which color separations to render in Print Colors Preview rendermode"), nullptr), - new DialogVerb(SP_VERB_DIALOG_EXPORT, "DialogExport", N_("_Export PNG Image…"), + new DialogVerb(SP_VERB_DIALOG_EXPORT, "DialogExport", N_("_Export PNG Image..."), N_("Export this document or a selection as a PNG image"), INKSCAPE_ICON("document-export")), // Help new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"), @@ -3248,7 +3248,7 @@ Verb *Verb::_base_verbs[] = { // Effect -- renamed Extension new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Exte_nsion"), N_("Repeat the last extension with the same settings"), nullptr), - new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("_Previous Extension Settings…"), + new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("_Previous Extension Settings..."), N_("Repeat the last extension with new settings"), nullptr), // Fit Page -- GitLab From c4a5937ee4dcb85bfced099f2269fc971c7eba85 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 14 Feb 2019 00:11:12 +0000 Subject: [PATCH 05/28] Make units.xml translatable --- po/generate_POTFILES.sh | 1 + share/ui/units.xml | 217 ++++++++++++++++++++++------------------ src/util/units.cpp | 3 + 3 files changed, 122 insertions(+), 99 deletions(-) diff --git a/po/generate_POTFILES.sh b/po/generate_POTFILES.sh index bbdeff0a4a..f883b9b44d 100755 --- a/po/generate_POTFILES.sh +++ b/po/generate_POTFILES.sh @@ -39,6 +39,7 @@ rm -f POTFILES.in.new # - add any other UI files we might need in future # - evaluate to use xgettext with proper options directly and drop intltool-update echo "[type: gettext/xml] share/ui/menus.xml" + echo "[type: gettext/xml] share/ui/units.xml" #do not include files from POTFILES.skip in the generated list ) | grep -vx -f POTFILES.skip > POTFILES.in.new diff --git a/share/ui/units.xml b/share/ui/units.xml index 713a538d7f..29f91d91d4 100644 --- a/share/ui/units.xml +++ b/share/ui/units.xml @@ -1,101 +1,120 @@ - - - % - % - % - 1.00 - Percentage - - - pixel - pixels - px - 1.00 - CSS Pixels (96/inch) - - - point - points - pt - 1.333333333333333 - PostScript points (72/inch) - - - pica - picas - pc - 16.0 - 12 points - - - inch - inches - in - 96.0 - Inches (96 px/in) - - - millimeter - millimeters - mm - 3.779527559055119 - Millimeters (25.4 mm/in) - - - centimeter - centimeters - cm - 37.79527559055119 - Centimeters (10 mm/cm) - - - degree - degrees - ° - 1.00 - Degrees - - - radian - radians - rad - 57.29577951308232 - Radians (180/pi deg/rad) - - - gradian - gradians - grad - 0.9 - Gradians (360/400 deg/grad) - - - turn - turns - turn - 360 - Turns (360 deg/turn) - - - font-height - font-heights - em - 1.00 - Font height - - - x-height - x-heights - ex - 0.50 - Height of letter 'x' - - - half-em - half-ems - en - 0.50 - Half of font height - + + % + % + % + 1.00 + <_description>Percentage + + + <_name>Pixel + <_plural>Pixels + <_abbr>px + 1.00 + <_description>CSS pixels (96/inch) + + + + <_name>Point + + <_plural>Points + <_abbr>pt + 1.333333333333333 + <_description>PostScript points (72/inch) + + + + <_name>Pica + + <_plural>Picas + <_abbr>pc + 16.0 + + <_description>12 points + + + + <_name>Inch + + <_plural>Inches + <_abbr>in + 96.0 + <_description>Inches (96 px/in) + + + <_name>Millimeter + <_plural>Millimeters + <_abbr>mm + 3.779527559055119 + <_description>Millimeters (25.4 mm/in) + + + <_name>Centimeter + <_plural>Centimeters + <_abbr>cm + 37.79527559055119 + <_description>Centimeters (10 mm/cm) + + + + <_name>Degree + + <_plural>Degrees + <_abbr>° + 1.00 + <_description>Degrees + + + <_name>Radian + <_plural>Radians + <_abbr>rad + 57.29577951308232 + <_description>Radians (180/pi deg/rad) + + + <_name>Gradian + <_plural>Gradians + <_abbr>grad + 0.9 + <_description>Gradians (360/400 deg/grad) + + + + <_name>Turn + + <_plural>Turns + <_abbr>turn + 360 + <_description>Turns (360 deg/turn) + + + + <_name>Em + + <_plural>Ems + <_abbr>em + 1.00 + + <_description>The point size of the current font + + + + <_name>x-height + + <_plural>x-heights + <_abbr>ex + 0.50 + + <_description>The height of the letter 'x' in the current font + + + + <_name>half-em + + <_plural>half-ems + <_abbr>en + 0.50 + + <_description>Half of the point size of the current font + diff --git a/src/util/units.cpp b/src/util/units.cpp index 0a1fdbf31c..a6a50b0965 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -453,6 +453,9 @@ void UnitParser::on_start_element(Ctx &/*ctx*/, Glib::ustring const &name, AttrM void UnitParser::on_text(Ctx &ctx, Glib::ustring const &text) { Glib::ustring element = ctx.get_element(); + if (element.length() > 0 && element[0] == '_') { + element = element.substr(1); + } if (element == "name") { unit.name = text; } else if (element == "plural") { -- GitLab From ea1bca46adf590646d8fc643c85f616b4561b418 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 14 Feb 2019 20:44:04 +0000 Subject: [PATCH 06/28] Update units.xml for translation --- share/ui/units.xml | 244 ++++++++++++++++++++++++++++----------------- src/util/units.cpp | 12 +-- 2 files changed, 160 insertions(+), 96 deletions(-) diff --git a/share/ui/units.xml b/share/ui/units.xml index 29f91d91d4..f556046b34 100644 --- a/share/ui/units.xml +++ b/share/ui/units.xml @@ -1,120 +1,184 @@ - - % - % - % + + + + + <_name msgctxt="unit-name" >Unit + <_description msgctxt="unit-description" >Unnamed dimensionless unit (1) + <_text msgctxt="unit-text" >unit + <_text_plural msgctxt="unit-text-plural" >units + <_abbr msgctxt="unit-abbr" > + <_symbol msgctxt="unit-symbol" > + + <_symbol_format msgctxt="unit-symbol_format">%f - - <_name>Pixel - <_plural>Pixels - <_abbr>px + + <_name msgctxt="unit-name" >Percent + <_description msgctxt="unit-description" >Percentage (unit/100) + <_text msgctxt="unit-text" >percent + <_text_plural msgctxt="unit-text-plural" >percent + <_abbr msgctxt="unit-abbr" >% + <_symbol msgctxt="unit-symbol" >% + + <_symbol_format msgctxt="unit-symbol_format">%f%% 1.00 - <_description>CSS pixels (96/inch) - - - <_name>Point - - <_plural>Points - <_abbr>pt + + + <_name msgctxt="unit-name" >Pixel + <_description msgctxt="unit-description" >CSS pixels (96/inch) + <_text msgctxt="unit-text" >pixel + <_text_plural msgctxt="unit-text-plural" >pixels + <_abbr msgctxt="unit-abbr" >px + <_symbol msgctxt="unit-symbol" >px + + <_symbol_format msgctxt="unit-symbol_format">%f px + 1.00 + + + <_name msgctxt="unit-name" >Point + <_description msgctxt="unit-description" >PostScript points (72/inch) + <_text msgctxt="unit-text" >point + <_text_plural msgctxt="unit-text-plural" >points + <_abbr msgctxt="unit-abbr" >pt + <_symbol msgctxt="unit-symbol" >pt + + <_symbol_format msgctxt="unit-symbol_format">%f pt 1.333333333333333 - <_description>PostScript points (72/inch) - - - <_name>Pica - - <_plural>Picas - <_abbr>pc + + <_name msgctxt="unit-name" >Pica + <_description msgctxt="unit-description" >12 points (6/inch) + <_text msgctxt="unit-text" >pica + <_text_plural msgctxt="unit-text-plural" >picas + <_abbr msgctxt="unit-abbr" >pc + <_symbol msgctxt="unit-symbol" >pc + + <_symbol_format msgctxt="unit-symbol_format">%f pc 16.0 - - <_description>12 points - - - <_name>Inch - - <_plural>Inches - <_abbr>in + + <_name msgctxt="unit-name" >Inch + <_description msgctxt="unit-description" >Inches (96 px/in) + <_text msgctxt="unit-text" >inch + <_text_plural msgctxt="unit-text-plural" >inches + <_abbr msgctxt="unit-abbr" >in + <_symbol msgctxt="unit-symbol" >″ + + <_symbol_format msgctxt="unit-symbol_format">%f″ 96.0 - <_description>Inches (96 px/in) - - <_name>Millimeter - <_plural>Millimeters - <_abbr>mm + + <_name msgctxt="unit-name" >Millimeter + <_description msgctxt="unit-description" >Millimeters (25.4 mm/in) + <_text msgctxt="unit-text" >millimeter + <_text_plural msgctxt="unit-text-plural" >millimeters + <_abbr msgctxt="unit-abbr" >mm + <_symbol msgctxt="unit-symbol" >mm + + <_symbol_format msgctxt="unit-symbol_format">%f mm 3.779527559055119 - <_description>Millimeters (25.4 mm/in) - - <_name>Centimeter - <_plural>Centimeters - <_abbr>cm + + <_name msgctxt="unit-name" >Centimeter + <_description msgctxt="unit-description" >Centimeters (10 mm/cm) + <_text msgctxt="unit-text" >centimeter + <_text_plural msgctxt="unit-text-plural" >centimeters + <_abbr msgctxt="unit-abbr" >cm + <_symbol msgctxt="unit-symbol" >cm + + <_symbol_format msgctxt="unit-symbol_format">%f cm 37.79527559055119 - <_description>Centimeters (10 mm/cm) - - - <_name>Degree - - <_plural>Degrees - <_abbr>° + + + <_name msgctxt="unit-name" >Degree + <_description msgctxt="unit-description" >Degrees (turn/360) + <_text msgctxt="unit-text" >degree + <_text_plural msgctxt="unit-text-plural" >degrees + <_abbr msgctxt="unit-abbr" >deg + <_symbol msgctxt="unit-symbol" >° + + <_symbol_format msgctxt="unit-symbol_format">%f° 1.00 - <_description>Degrees - - <_name>Radian - <_plural>Radians - <_abbr>rad + + <_name msgctxt="unit-name" >Radian + <_description msgctxt="unit-description" >Radians (pi/180 rad/deg) + <_text msgctxt="unit-text" >radian + <_text_plural msgctxt="unit-text-plural" >radians + <_abbr msgctxt="unit-abbr" >rad + <_symbol msgctxt="unit-symbol" >rad + + <_symbol_format msgctxt="unit-symbol_format">%f rad 57.29577951308232 - <_description>Radians (180/pi deg/rad) - - <_name>Gradian - <_plural>Gradians - <_abbr>grad + + <_name msgctxt="unit-name" >Gradian + <_description msgctxt="unit-description" >Gradians (400/360 grad/deg) + <_text msgctxt="unit-text" >gradian + <_text_plural msgctxt="unit-text-plural" >gradians + <_abbr msgctxt="unit-abbr" >grad + <_symbol msgctxt="unit-symbol" >grad + + <_symbol_format msgctxt="unit-symbol_format">%f grad 0.9 - <_description>Gradians (360/400 deg/grad) - - - <_name>Turn - - <_plural>Turns - <_abbr>turn + + <_name msgctxt="unit-name" >Turn + <_description msgctxt="unit-description" >Turns (1/360 turn/deg) + <_text msgctxt="unit-text" >turn + <_text_plural msgctxt="unit-text-plural" >turns + <_abbr msgctxt="unit-abbr" >turn + <_symbol msgctxt="unit-symbol" >turn + + <_symbol_format msgctxt="unit-symbol_format">%f turn 360 - <_description>Turns (360 deg/turn) - - - <_name>Em - - <_plural>Ems - <_abbr>em + + + <_name msgctxt="unit-name" >Font Height + <_description msgctxt="unit-description" >The point size of the current font + <_text msgctxt="unit-text" >em + <_text_plural msgctxt="unit-text-plural" >ems + <_abbr msgctxt="unit-abbr" >em + <_symbol msgctxt="unit-symbol" >em + + <_symbol_format msgctxt="unit-symbol_format">%f em 1.00 - - <_description>The point size of the current font - - - <_name>x-height - - <_plural>x-heights - <_abbr>ex + + + <_name msgctxt="unit-name" >X-Height + <_description msgctxt="unit-description" >The height of the letter 'x' in the current font + <_text msgctxt="unit-text" >ex + <_text_plural msgctxt="unit-text-plural" >exes + <_abbr msgctxt="unit-abbr" >ex + <_symbol msgctxt="unit-symbol" >ex + + <_symbol_format msgctxt="unit-symbol_format">%f ex + <_name msgctxt="Unit, Font">ex 0.50 - - <_description>The height of the letter 'x' in the current font - - - <_name>half-em - - <_plural>half-ems - <_abbr>en + + <_name msgctxt="unit-name" >Half Font Height + <_description msgctxt="unit-description" >Half the size of the current font height + <_text msgctxt="unit-text" >en + <_text_plural msgctxt="unit-text-plural" >ens + <_abbr msgctxt="unit-abbr" >en + <_symbol msgctxt="unit-symbol" >en + + <_symbol_format msgctxt="unit-symbol_format">%f en 0.50 - - <_description>Half of the point size of the current font diff --git a/src/util/units.cpp b/src/util/units.cpp index a6a50b0965..c61a12b5e8 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -105,10 +105,10 @@ typedef std::unordered_map TypeMap; TypeMap make_type_map() { TypeMap tmap; - tmap["DIMENSIONLESS"] = UNIT_TYPE_DIMENSIONLESS; - tmap["LINEAR"] = UNIT_TYPE_LINEAR; - tmap["RADIAL"] = UNIT_TYPE_RADIAL; - tmap["FONT_HEIGHT"] = UNIT_TYPE_FONT_HEIGHT; + tmap["dimensionless"] = UNIT_TYPE_DIMENSIONLESS; + tmap["linear"] = UNIT_TYPE_LINEAR; + tmap["angular"] = UNIT_TYPE_RADIAL; + tmap["fontHeight"] = UNIT_TYPE_FONT_HEIGHT; // Note that code was not yet handling LINEAR_SCALED, TIME, QTY and NONE return tmap; @@ -444,7 +444,7 @@ void UnitParser::on_start_element(Ctx &/*ctx*/, Glib::ustring const &name, AttrM skip = true; } } - if ((f = attrs.find("pri")) != attrs.end()) { + if ((f = attrs.find("primary")) != attrs.end()) { primary = (f->second[0] == 'y' || f->second[0] == 'Y'); } } @@ -458,7 +458,7 @@ void UnitParser::on_text(Ctx &ctx, Glib::ustring const &text) } if (element == "name") { unit.name = text; - } else if (element == "plural") { + } else if (element == "text_plural") { unit.name_plural = text; } else if (element == "abbr") { unit.abbr = text; -- GitLab From 89eec8c9fba5732d5bff46e8c64f0128a66f17ef Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Fri, 15 Feb 2019 22:20:28 +0000 Subject: [PATCH 07/28] Add localized strings to UnitMenu --- src/ui/widget/unit-menu.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/ui/widget/unit-menu.cpp b/src/ui/widget/unit-menu.cpp index 9388512655..463af3909f 100644 --- a/src/ui/widget/unit-menu.cpp +++ b/src/ui/widget/unit-menu.cpp @@ -9,6 +9,7 @@ */ #include +#include #include "unit-menu.h" @@ -31,10 +32,10 @@ bool UnitMenu::setUnitType(UnitType unit_type) UnitTable::UnitMap m = unit_table.units(unit_type); for (auto & i : m) { - append(i.first); + append(i.first, g_dpgettext2(nullptr, "unit-abbr", i.first.c_str())); } _type = unit_type; - set_active_text(unit_table.primary(unit_type)); + set_active_id(unit_table.primary(unit_type)); return true; } @@ -49,30 +50,26 @@ bool UnitMenu::resetUnitType(UnitType unit_type) void UnitMenu::addUnit(Unit const& u) { unit_table.addUnit(u, false); - append(u.abbr); + append(u.abbr, g_dpgettext2(nullptr, "unit-abbr", u.abbr.c_str())); } Unit const * UnitMenu::getUnit() const { - if (get_active_text() == "") { + if (get_active_id() == "") { g_assert(_type != UNIT_TYPE_NONE); return unit_table.getUnit(unit_table.primary(_type)); } - return unit_table.getUnit(get_active_text()); + return unit_table.getUnit(get_active_id()); } bool UnitMenu::setUnit(Glib::ustring const & unit) { - // TODO: Determine if 'unit' is available in the dropdown. - // If not, return false - - set_active_text(unit); - return true; + return set_active_id(unit); } Glib::ustring UnitMenu::getUnitAbbr() const { - if (get_active_text() == "") { + if (get_active_id() == "") { return ""; } return getUnit()->abbr; -- GitLab From 345bbb48bc962c1cf6dc8d15ee9c48f3b5dda453 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Fri, 15 Feb 2019 22:22:37 +0000 Subject: [PATCH 08/28] Localize desktop widget rulers --- src/widgets/desktop-widget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 489582ca8e..2528e57f5e 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -387,7 +387,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->_hruler_box = Gtk::manage(new Gtk::EventBox()); Inkscape::Util::Unit const *pt = unit_table.getUnit("pt"); sp_ruler_set_unit(SP_RULER(dtw->_hruler->gobj()), pt); - dtw->_hruler_box->set_tooltip_text(gettext(pt->name_plural.c_str())); + dtw->_hruler_box->set_tooltip_text(g_dpgettext2(nullptr, "unit-text-plural", pt->name_plural.c_str())); dtw->_hruler_box->add(*dtw->_hruler); dtw->_hruler_box->signal_button_press_event().connect(sigc::bind(sigc::mem_fun(*dtw, &SPDesktopWidget::on_ruler_box_button_press_event), dtw->_hruler_box, true)); @@ -401,7 +401,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->_vruler->set_name("VerticalRuler"); dtw->_vruler_box = Gtk::manage(new Gtk::EventBox()); sp_ruler_set_unit (SP_RULER (dtw->_vruler->gobj()), pt); - dtw->_vruler_box->set_tooltip_text(gettext(pt->name_plural.c_str())); + dtw->_vruler_box->set_tooltip_text(g_dpgettext2(nullptr, "unit-text-plural", pt->name_plural.c_str())); dtw->_vruler_box->add(*dtw->_vruler); dtw->_vruler_box->signal_button_press_event().connect(sigc::bind(sigc::mem_fun(*dtw, &SPDesktopWidget::on_ruler_box_button_press_event), dtw->_vruler_box, false)); @@ -1772,8 +1772,8 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) } // children } // if aux_toolbox is a container - _hruler_box->set_tooltip_text(gettext(nv->display_units->name_plural.c_str())); - _vruler_box->set_tooltip_text(gettext(nv->display_units->name_plural.c_str())); + _hruler_box->set_tooltip_text(g_dpgettext2(nullptr, "unit-text-plural", nv->display_units->name_plural.c_str())); + _vruler_box->set_tooltip_text(g_dpgettext2(nullptr, "unit-text-plural", nv->display_units->name_plural.c_str())); update_rulers(); ToolboxFactory::updateSnapToolbox(this->desktop, nullptr, this->snap_toolbox); -- GitLab From 70d89a449e6721f4159e1b866f8dd6bf88d39374 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Fri, 15 Feb 2019 23:13:51 +0000 Subject: [PATCH 09/28] Localize units in the preferences dialog --- src/ui/dialog/inkscape-preferences.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 9248b59449..3917a6a7af 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -252,7 +252,7 @@ void InkscapePreferences::AddPencilPowerStrokePressureStep(DialogPage &p, Glib:: { PrefSpinButton* sb = Gtk::manage( new PrefSpinButton); sb->init ( prefs_path + "/ps-step-pressure", 1, 100, 1, 10, def_value, true, false); - p.add_line( false, _("Pressure change for new knot:"), *sb, _("%"), + p.add_line( false, _("Pressure change for new knot:"), *sb, C_("unit-abbr", "%"), _("Percentage increase / decrease of stylus pressure that is required to create a new PowerStroke knot."), false ); } @@ -417,7 +417,7 @@ void InkscapePreferences::initPageTools() _t_node_pathflash_selected.init ( _("Show temporary outline for selected paths"), "/tools/nodes/pathflash_selected", false); _page_node.add_line( true, "", _t_node_pathflash_selected, "", _("Show temporary outline even when a path is selected for editing")); _t_node_pathflash_timeout.init("/tools/nodes/pathflash_timeout", 0, 10000.0, 100.0, 100.0, 1000.0, true, false); - _page_node.add_line( false, _("_Flash time:"), _t_node_pathflash_timeout, "ms", _("Specifies how long the path outline will be visible after a mouse-over (in milliseconds); specify 0 to have the outline shown until mouse leaves the path"), false); + _page_node.add_line( false, _("_Flash time:"), _t_node_pathflash_timeout, C_("unit-abbr", "ms"), _("Specifies how long the path outline will be visible after a mouse-over (in milliseconds); specify 0 to have the outline shown until mouse leaves the path"), false); _page_node.add_group_header(_("Editing preferences")); _t_node_single_node_transform_handles.init(_("Show transform handles for single nodes"), "/tools/nodes/single_node_transform_handles", false); _page_node.add_line( true, "", _t_node_single_node_transform_handles, "", _("Show transform handles even when only a single node is selected")); @@ -562,7 +562,7 @@ void InkscapePreferences::initPageTools() _("When on, the Gradient Edit button in the Fill & Stroke dialog will show the legacy Gradient Editor dialog, when off the Gradient Tool will be used"), true); _misc_gradientangle.init("/dialogs/gradienteditor/angle", -359, 359, 1, 90, 0, false, false); - _page_gradient.add_line( false, _("Linear gradient _angle:"), _misc_gradientangle, "", + _page_gradient.add_line( false, _("Linear gradient _angle:"), _misc_gradientangle, _("degrees"), _("Default angle of new linear gradients in degrees (clockwise from horizontal)"), false); @@ -1133,7 +1133,7 @@ void InkscapePreferences::initPageUI() _win_trans_blur.init("/dialogs/transparency/on-blur", 0.0, 1.0, 0.01, 0.1, 0.5, false, false); _page_windows.add_line( true, _("Opacity when _unfocused:"), _win_trans_blur, "", "", false); _win_trans_time.init("/dialogs/transparency/animate-time", 0, 1000, 10, 100, 100, true, false); - _page_windows.add_line( true, _("_Time of opacity change animation:"), _win_trans_time, "ms", "", false); + _page_windows.add_line( true, _("_Time of opacity change animation:"), _win_trans_time, C_("unit-abbr", "ms"), "", false); _page_windows.add_group_header( _("Miscellaneous")); @@ -1273,10 +1273,10 @@ void InkscapePreferences::initPageIO() // Input devices options _mouse_sens.init ( "/options/cursortolerance/value", 0.0, 30.0, 1.0, 1.0, 8.0, true, false); - _page_mouse.add_line( false, _("_Grab sensitivity:"), _mouse_sens, _("pixels (requires restart)"), + _page_mouse.add_line( false, _("_Grab sensitivity:"), _mouse_sens, _("pixels (requires restart)"), // "pixels (requires restart)" should be seperated into two strings _("How close on the screen you need to be to an object to be able to grab it with mouse (in screen pixels)"), false); _mouse_thres.init ( "/options/dragtolerance/value", 0.0, 20.0, 1.0, 1.0, 4.0, true, false); - _page_mouse.add_line( false, _("_Click/drag threshold:"), _mouse_thres, _("pixels"), + _page_mouse.add_line( false, _("_Click/drag threshold:"), _mouse_thres, C_("unit-abbr", "px"), _("Maximum mouse drag (in screen pixels) which is considered a click, not a drag"), false); _mouse_grabsize.init("/options/grabsize/value", 1, 7, 1, 2, 3, 0); @@ -1532,7 +1532,7 @@ void InkscapePreferences::initPageIO() } _page_autosave.add_line(false, C_("Filesystem", "Autosave _directory:"), _save_autosave_path, "", _("The directory where autosaves will be written. This should be an absolute path (starts with / on UNIX or a drive letter such as C: on Windows). "), false); _save_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false); - _page_autosave.add_line(false, _("_Interval (in minutes):"), _save_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false); + _page_autosave.add_line(false, _("_Interval:"), _save_autosave_interval, _("minutes"), _("Interval (in minutes) at which document will be autosaved"), false); _save_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false); _page_autosave.add_line(false, _("_Maximum number of autosaves:"), _save_autosave_max, "", _("Maximum number of autosaved files; use this to limit the storage space used"), false); @@ -1639,11 +1639,11 @@ void InkscapePreferences::initPageBehavior() // Scrolling options _scroll_wheel.init ( "/options/wheelscroll/value", 0.0, 1000.0, 1.0, 1.0, 40.0, true, false); - _page_scrolling.add_line( false, _("Mouse _wheel scrolls by:"), _scroll_wheel, _("pixels"), + _page_scrolling.add_line( false, _("Mouse _wheel scrolls by:"), _scroll_wheel, C_("unit-abbr", "px"), _("One mouse wheel notch scrolls by this distance in screen pixels (horizontally with Shift)"), false); _page_scrolling.add_group_header( _("Ctrl+arrows")); _scroll_arrow_px.init ( "/options/keyscroll/value", 0.0, 1000.0, 1.0, 1.0, 10.0, true, false); - _page_scrolling.add_line( true, _("Sc_roll by:"), _scroll_arrow_px, _("pixels"), + _page_scrolling.add_line( true, _("Sc_roll by:"), _scroll_arrow_px, C_("unit-abbr", "px"), _("Pressing Ctrl+arrow key scrolls by this distance (in screen pixels)"), false); _scroll_arrow_acc.init ( "/options/scrollingacceleration/value", 0.0, 5.0, 0.01, 1.0, 0.35, false, false); _page_scrolling.add_line( true, _("_Acceleration:"), _scroll_arrow_acc, "", @@ -1653,7 +1653,7 @@ void InkscapePreferences::initPageBehavior() _page_scrolling.add_line( true, _("_Speed:"), _scroll_auto_speed, "", _("How fast the canvas autoscrolls when you drag beyond canvas edge (0 to turn autoscroll off)"), false); _scroll_auto_thres.init ( "/options/autoscrolldistance/value", -600.0, 600.0, 1.0, 1.0, -10.0, true, false); - _page_scrolling.add_line( true, _("_Threshold:"), _scroll_auto_thres, _("pixels"), + _page_scrolling.add_line( true, _("_Threshold:"), _scroll_auto_thres, C_("unit-abbr", "px"), _("How far (in screen pixels) you need to be from the canvas edge to trigger autoscroll; positive is outside the canvas, negative is within the canvas"), false); _scroll_space.init ( _("Mouse move pans when Space is pressed"), "/options/spacebarpans/value", true); _page_scrolling.add_line( true, "", _scroll_space, "", @@ -1679,7 +1679,7 @@ void InkscapePreferences::initPageBehavior() _snap_indicator.changed_signal.connect( sigc::mem_fun(_snap_persistence, &Gtk::Widget::set_sensitive) ); _snap_persistence.init("/options/snapindicatorpersistence/value", 0.1, 10, 0.1, 1, 2, 1); - _page_snapping.add_line( true, _("Snap indicator persistence (in seconds):"), _snap_persistence, "", + _page_snapping.add_line( true, _("Snap indicator persistence (seconds):"), _snap_persistence, "", _("Controls how long the snap indicator message will be shown, before it disappears"), true); _page_snapping.add_group_header( _("What should snap")); @@ -1699,7 +1699,7 @@ void InkscapePreferences::initPageBehavior() _page_snapping.add_group_header( _("Delayed snap")); _snap_delay.init("/options/snapdelay/value", 0, 1, 0.1, 0.2, 0.3, 1); - _page_snapping.add_line( true, _("Delay (in seconds):"), _snap_delay, "", + _page_snapping.add_line( true, _("Delay (seconds):"), _snap_delay, "", _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true); this->AddPage(_page_snapping, _("Snapping"), iter_behavior, PREFS_PAGE_BEHAVIOR_SNAPPING); @@ -1730,7 +1730,7 @@ void InkscapePreferences::initPageBehavior() _page_steps.add_line( false, "", _steps_rot_relative, "", _("When on, the snap angles when rotating a guideline will be relative to the original angle")); _steps_zoom.init ( "/options/zoomincrement/value", 101.0, 500.0, 1.0, 1.0, M_SQRT2, true, true); - _page_steps.add_line( false, _("_Zoom in/out by:"), _steps_zoom, _("%"), + _page_steps.add_line( false, _("_Zoom in/out by:"), _steps_zoom, C_("unit-abbr", "%"), _("Zoom tool click, +/- keys, and middle click zoom in and out by this multiplier"), false); _steps_rotate.init ( "/options/rotateincrement/value", 1, 90, 1.0, 5.0, 15, false, false); _page_steps.add_line( false, _("_Rotate canvas by:"), _steps_rotate, _("degrees"), -- GitLab From e7c4eb8c301b28c457918ffe979bc84f6d30756c Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Sat, 16 Feb 2019 12:09:27 +0000 Subject: [PATCH 10/28] Localize uses of Unit.abbr if appropriate --- src/live_effects/parameter/unit.cpp | 1 + src/ui/tools/lpe-tool.cpp | 8 ++++++-- src/ui/tools/measure-tool.cpp | 13 +++++++++---- src/ui/widget/page-sizer.cpp | 1 + src/ui/widget/selected-style.cpp | 4 +++- src/ui/widget/style-swatch.cpp | 3 ++- src/ui/widget/unit-menu.cpp | 1 + src/ui/widget/unit-tracker.cpp | 4 ++-- src/util/units.cpp | 2 ++ 9 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 109d7fcedf..a43e1bbe06 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -73,6 +73,7 @@ UnitParam::param_set_value(Inkscape::Util::Unit const &val) unit = new Inkscape::Util::Unit(val); } +// TODO: Should this be localized? const gchar * UnitParam::get_abbreviation() const { diff --git a/src/ui/tools/lpe-tool.cpp b/src/ui/tools/lpe-tool.cpp index 55ec014abd..da63b01c97 100644 --- a/src/ui/tools/lpe-tool.cpp +++ b/src/ui/tools/lpe-tool.cpp @@ -413,7 +413,9 @@ lpetool_create_measuring_items(LpeTool *lc, Inkscape::Selection *selection) lengthval = Geom::length(pwd2); lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); - arc_length = g_strdup_printf("%.2f %s", lengthval, unit->abbr.c_str()); + // TODO: convert to a localised format, \u202F is Narrow No-Break Space + arc_length = g_strdup_printf("-1-%.2f\u202F%s-1-", lengthval, + g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str())); sp_canvastext_set_text (canvas_text, arc_length); set_pos_and_anchor(canvas_text, pwd2, 0.5, 10); // TODO: must we free arc_length? @@ -451,7 +453,9 @@ lpetool_update_measuring_items(LpeTool *lc) } double lengthval = Geom::length(pwd2); lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); - gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, unit->abbr.c_str()); + // TODO: convert to a localised format, \u202F is Narrow No-Break Space + gchar *arc_length = g_strdup_printf("-2-%.2fu202F%s-2-", lengthval, + g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str())); sp_canvastext_set_text (SP_CANVASTEXT(i->second), arc_length); set_pos_and_anchor(SP_CANVASTEXT(i->second), pwd2, 0.5, 10); // TODO: must we free arc_length? diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index f8c8517c99..2d06eb7ccd 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -1040,10 +1040,11 @@ void MeasureTool::setMeasureCanvasText(bool is_angle, double precision, double a SPDesktop *desktop = SP_ACTIVE_DESKTOP; std::stringstream precision_str; precision_str.imbue(std::locale::classic()); + // TODO: Properly localize this? Degree symbol and value-unit spacing if(is_angle){ - precision_str << "%." << precision << "f °"; + precision_str << "%." << precision << "f°"; } else { - precision_str << "%." << precision << "f %s"; + precision_str << "%." << precision << "f\u202F%s"; // \u202F is Narrow No-Break Space } gchar *measure_str = g_strdup_printf(precision_str.str().c_str(), amount, unit_name.c_str()); SPCanvasText *canvas_tooltip = sp_canvastext_new(desktop->getTempGroup(), @@ -1364,7 +1365,9 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom, // Adjust positions repositionOverlappingLabels(placements, desktop, windowNormal, fontsize, precision); for (auto & place : placements) { - setMeasureCanvasText(false, precision, place.lengthVal * scale, fontsize, unit_name, place.end, 0x0000007f, TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); + setMeasureCanvasText(false, precision, place.lengthVal * scale, fontsize, + g_dpgettext2(nullptr, "unit-abbr", unit_name.c_str()), place.end, 0x0000007f, + TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); } Geom::Point angleDisplayPt = calcAngleDisplayAnchor(desktop, angle, baseAngle, start_p, end_p, @@ -1377,7 +1380,9 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom, double totallengthval = (end_p - start_p).length(); totallengthval = Inkscape::Util::Quantity::convert(totallengthval, "px", unit_name); Geom::Point origin = end_p + desktop->w2d(Geom::Point(3*fontsize, -fontsize)); - setMeasureCanvasText(false, precision, totallengthval * scale, fontsize, unit_name, origin, 0x3333337f, TEXT_ANCHOR_LEFT, to_item, to_phantom, measure_repr); + setMeasureCanvasText(false, precision, totallengthval * scale, fontsize, + g_dpgettext2(nullptr, "unit-abbr", unit_name.c_str()), origin, 0x3333337f, + TEXT_ANCHOR_LEFT, to_item, to_phantom, measure_repr); } if (intersections.size() > 2) { diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 030e90af07..21d6c1f322 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -624,6 +624,7 @@ PageSizer::updateScaleUI() Geom::Scale scale = doc->getDocumentScale(); SPNamedView *nv = dt->getNamedView(); + // TODO: Localize this. std::stringstream ss; ss << _("User units per ") << nv->display_units->abbr << "." ; _scaleLabel.set_text( ss.str() ); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 149b70f6fc..a8b89b767e 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -489,6 +489,7 @@ SelectedStyle::setDesktop(SPDesktop *desktop) _sw_unit = desktop->getNamedView()->display_units; + // TODO: Fix potential localization issues here. // Set the doc default unit active in the units list for ( auto mi:_unit_mis ) { if (mi && mi->get_label() == _sw_unit->abbr) { @@ -1106,7 +1107,8 @@ SelectedStyle::update() { gchar *str = g_strdup_printf(_("Stroke width: %.5g%s%s"), w, - _sw_unit? _sw_unit->abbr.c_str() : "px", + g_dpgettext2(nullptr, "unit-abbr", + _sw_unit? _sw_unit->abbr.c_str() : "px"), (result_sw == QUERY_STYLE_MULTIPLE_AVERAGED)? _(" (averaged)") : ""); _stroke_width_place.set_tooltip_text(str); diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp index 97b8015471..30f51cb56c 100644 --- a/src/ui/widget/style-swatch.cpp +++ b/src/ui/widget/style-swatch.cpp @@ -345,7 +345,8 @@ void StyleSwatch::setStyle(SPStyle *query) { gchar *str = g_strdup_printf(_("Stroke width: %.5g%s"), w, - _sw_unit? _sw_unit->abbr.c_str() : "px"); + g_dpgettext2(nullptr, "unit-abbr", + _sw_unit? _sw_unit->abbr.c_str() : "px")); _stroke_width_place.set_tooltip_text(str); g_free (str); } diff --git a/src/ui/widget/unit-menu.cpp b/src/ui/widget/unit-menu.cpp index 463af3909f..21e8c1cb86 100644 --- a/src/ui/widget/unit-menu.cpp +++ b/src/ui/widget/unit-menu.cpp @@ -67,6 +67,7 @@ bool UnitMenu::setUnit(Glib::ustring const & unit) return set_active_id(unit); } +// TODO: Should this be localized? Glib::ustring UnitMenu::getUnitAbbr() const { if (get_active_id() == "") { diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 665bb74971..b71ceafb01 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -126,7 +126,7 @@ void UnitTracker::addUnit(Inkscape::Util::Unit const *u) Gtk::TreeModel::Row row; row = *(_store->append()); - row[columns.col_label ] = u ? u->abbr.c_str() : ""; + row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()) : ""; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; @@ -138,7 +138,7 @@ void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) Gtk::TreeModel::Row row; row = *(_store->prepend()); - row[columns.col_label ] = u ? u->abbr.c_str() : ""; + row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()) : ""; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; diff --git a/src/util/units.cpp b/src/util/units.cpp index c61a12b5e8..43088c6dbb 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -519,9 +519,11 @@ double Quantity::value(char const *u) const return value(unit_table.getUnit(u)); } +// TODO: Should this be localized? Glib::ustring Quantity::string(Unit const *u) const { return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + u->abbr; } +// TODO: Should this be localized? Glib::ustring Quantity::string(Glib::ustring const &u) const { return string(unit_table.getUnit(u.c_str())); } -- GitLab From 7d35e0f153e737658fdc0936aae3709ef906b18b Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Sat, 16 Feb 2019 16:02:00 +0000 Subject: [PATCH 11/28] Add localization to UnitTracker --- src/ui/widget/unit-tracker.cpp | 41 +++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index b71ceafb01..e2073ff39e 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -47,10 +47,11 @@ UnitTracker::UnitTracker(UnitType unit_type) : for (auto & m_iter : m) { - Glib::ustring unit = m_iter.first; + Unit const *unit = unit_table.getUnit(m_iter.first); row = *(_store->append()); - row[columns.col_label ] = unit; + row[columns.col_data ] = const_cast(unit); + row[columns.col_label ] = g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str()); row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; @@ -94,10 +95,14 @@ void UnitTracker::setActiveUnit(Inkscape::Util::Unit const *unit) InkSelectOneActionColumns columns; int index = 0; for (auto& row: _store->children() ) { - Glib::ustring storedUnit = row[columns.col_label]; - if (!unit->abbr.compare (storedUnit)) { - _setActive (index); - break; + void* pointer = row[columns.col_data]; + if (pointer) + { + Unit const *storedUnit = static_cast(pointer); + if (!unit->abbr.compare(storedUnit->abbr)) { + _setActive (index); + break; + } } index++; } @@ -123,10 +128,15 @@ void UnitTracker::addAdjustment(GtkAdjustment *adj) void UnitTracker::addUnit(Inkscape::Util::Unit const *u) { InkSelectOneActionColumns columns; + + // Will u always be in scope so we don't need this? + // addUnit seems to only be called with unit_table->getUnit(...) as the argument. + Unit const *unit = unit_table.getUnit(u->abbr); Gtk::TreeModel::Row row; row = *(_store->append()); - row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()) : ""; + row[columns.col_data ] = const_cast(unit); + row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str()) : ""; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; @@ -134,10 +144,15 @@ void UnitTracker::addUnit(Inkscape::Util::Unit const *u) void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) { - InkSelectOneActionColumns columns; + InkSelectOneActionColumns columns; + + // Will u always be in scope so we don't need this? + // prependUnit seems to only be called with unit_table->getUnit(...) as the argument. + Unit const *unit = unit_table.getUnit(u->abbr); Gtk::TreeModel::Row row; row = *(_store->prepend()); + row[columns.col_data ] = const_cast(u); // Is this correct? row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()) : ""; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; @@ -228,8 +243,10 @@ void UnitTracker::_adjustmentFinalized(GObject *where_the_object_was) } } +// TODO: Rewrite, currently we go Unit* -> abbr -> Unit* void UnitTracker::_setActive(gint active) { + std::cerr << "_setActive" << std::endl; if ( active != _active || !_activeUnitInitialized ) { gint oldActive = _active; @@ -242,10 +259,14 @@ void UnitTracker::_setActive(gint active) Glib::ustring newAbbr( "NotFound" ); for (auto& row: _store->children() ) { if (index == _active) { - oldAbbr = row[columns.col_label]; + void* pointer = row[columns.col_data]; + if (pointer) + oldAbbr = static_cast(pointer)->abbr;; } if (index == active) { - newAbbr = row[columns.col_label]; + void* pointer = row[columns.col_data]; + if (pointer) + newAbbr = static_cast(pointer)->abbr; } if (newAbbr != "NotFound" && oldAbbr != "NotFound") break; ++index; -- GitLab From 09581f30ef159daa959c0e5aa674be3c79a9eec0 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 12:00:26 +0000 Subject: [PATCH 12/28] Update UnitTracker --- src/ui/widget/unit-tracker.cpp | 37 +++++++++++++--------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index e2073ff39e..7cb871f3e4 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -47,14 +47,7 @@ UnitTracker::UnitTracker(UnitType unit_type) : for (auto & m_iter : m) { - Unit const *unit = unit_table.getUnit(m_iter.first); - - row = *(_store->append()); - row[columns.col_data ] = const_cast(unit); - row[columns.col_label ] = g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str()); - row[columns.col_tooltip ] = (""); - row[columns.col_icon ] = "NotUsed"; - row[columns.col_sensitive] = true; + addUnit(unit_table.getUnit(m_iter.first)); } // Why? @@ -100,7 +93,7 @@ void UnitTracker::setActiveUnit(Inkscape::Util::Unit const *unit) { Unit const *storedUnit = static_cast(pointer); if (!unit->abbr.compare(storedUnit->abbr)) { - _setActive (index); + _setActive(index); break; } } @@ -128,15 +121,15 @@ void UnitTracker::addAdjustment(GtkAdjustment *adj) void UnitTracker::addUnit(Inkscape::Util::Unit const *u) { InkSelectOneActionColumns columns; - - // Will u always be in scope so we don't need this? - // addUnit seems to only be called with unit_table->getUnit(...) as the argument. - Unit const *unit = unit_table.getUnit(u->abbr); + + Glib::ustring label; + if (u->abbr != "") + label = g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); Gtk::TreeModel::Row row; row = *(_store->append()); - row[columns.col_data ] = const_cast(unit); - row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str()) : ""; + row[columns.col_data ] = const_cast(u); + row[columns.col_label ] = label; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; @@ -146,14 +139,14 @@ void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) { InkSelectOneActionColumns columns; - // Will u always be in scope so we don't need this? - // prependUnit seems to only be called with unit_table->getUnit(...) as the argument. - Unit const *unit = unit_table.getUnit(u->abbr); + Glib::ustring label; + if (u->abbr != "") + label = g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); Gtk::TreeModel::Row row; row = *(_store->prepend()); - row[columns.col_data ] = const_cast(u); // Is this correct? - row[columns.col_label ] = u ? g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()) : ""; + row[columns.col_data ] = const_cast(u); + row[columns.col_label ] = label; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; @@ -243,10 +236,8 @@ void UnitTracker::_adjustmentFinalized(GObject *where_the_object_was) } } -// TODO: Rewrite, currently we go Unit* -> abbr -> Unit* void UnitTracker::_setActive(gint active) { - std::cerr << "_setActive" << std::endl; if ( active != _active || !_activeUnitInitialized ) { gint oldActive = _active; @@ -294,7 +285,7 @@ void UnitTracker::_setActive(gint active) _active = active; for (auto act: _actionList) { - act->set_active (active); + act->set_active(active); } for (auto combo : _combo_list) { -- GitLab From 80853544b204d3e9ecd7dffb11a871543226554c Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 12:55:19 +0000 Subject: [PATCH 13/28] Update Quantity::string to be localized --- src/util/units.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/units.cpp b/src/util/units.cpp index 43088c6dbb..8e9a2fb148 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -519,11 +519,11 @@ double Quantity::value(char const *u) const return value(unit_table.getUnit(u)); } -// TODO: Should this be localized? +// \u202F is Narrow No-Break Space Glib::ustring Quantity::string(Unit const *u) const { - return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + " " + u->abbr; + return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + "\u202F" + + g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); } -// TODO: Should this be localized? Glib::ustring Quantity::string(Glib::ustring const &u) const { return string(unit_table.getUnit(u.c_str())); } -- GitLab From d9afcae8c4524bdaba7da44769f8f4d6e0e40bda Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 12:56:36 +0000 Subject: [PATCH 14/28] Update lpetool_XXX_measuring_items to use Quantity::string --- src/ui/tools/lpe-tool.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/ui/tools/lpe-tool.cpp b/src/ui/tools/lpe-tool.cpp index da63b01c97..51423873fa 100644 --- a/src/ui/tools/lpe-tool.cpp +++ b/src/ui/tools/lpe-tool.cpp @@ -392,8 +392,6 @@ lpetool_create_measuring_items(LpeTool *lc, Inkscape::Selection *selection) SPCurve *curve; SPCanvasText *canvas_text; SPCanvasGroup *tmpgrp = lc->desktop->getTempGroup(); - gchar *arc_length; - double lengthval; auto items= selection->items(); for(auto i=items.begin();i!=items.end();++i){ if (SP_IS_PATH(*i)) { @@ -411,12 +409,8 @@ lpetool_create_measuring_items(LpeTool *lc, Inkscape::Selection *selection) unit = unit_table.getUnit("px"); } - lengthval = Geom::length(pwd2); - lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); - // TODO: convert to a localised format, \u202F is Narrow No-Break Space - arc_length = g_strdup_printf("-1-%.2f\u202F%s-1-", lengthval, - g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str())); - sp_canvastext_set_text (canvas_text, arc_length); + auto q = Inkscape::Util::Quantity(Geom::length(pwd2), "px"); + sp_canvastext_set_text(canvas_text, q.string(unit).c_str()); set_pos_and_anchor(canvas_text, pwd2, 0.5, 10); // TODO: must we free arc_length? (*lc->measuring_items)[path] = SP_CANVAS_ITEM(canvas_text); @@ -451,12 +445,8 @@ lpetool_update_measuring_items(LpeTool *lc) } else { unit = unit_table.getUnit("px"); } - double lengthval = Geom::length(pwd2); - lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit); - // TODO: convert to a localised format, \u202F is Narrow No-Break Space - gchar *arc_length = g_strdup_printf("-2-%.2fu202F%s-2-", lengthval, - g_dpgettext2(nullptr, "unit-abbr", unit->abbr.c_str())); - sp_canvastext_set_text (SP_CANVASTEXT(i->second), arc_length); + auto q = Inkscape::Util::Quantity(Geom::length(pwd2), "px"); + sp_canvastext_set_text(SP_CANVASTEXT(i->second), q.string(unit).c_str()); set_pos_and_anchor(SP_CANVASTEXT(i->second), pwd2, 0.5, 10); // TODO: must we free arc_length? } -- GitLab From 9e13154c4f2385c5899cceb7748d53db8a841d4b Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 13:42:01 +0000 Subject: [PATCH 15/28] Localize units in StyleSwatch and SelectedStyle --- src/ui/widget/selected-style.cpp | 8 ++++---- src/ui/widget/style-swatch.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index a8b89b767e..7b789a38fb 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -1105,10 +1105,10 @@ SelectedStyle::update() g_free (str); } { - gchar *str = g_strdup_printf(_("Stroke width: %.5g%s%s"), - w, - g_dpgettext2(nullptr, "unit-abbr", - _sw_unit? _sw_unit->abbr.c_str() : "px"), + Inkscape::Util::Quantity q = Inkscape::Util::Quantity(w, + _sw_unit ? _sw_unit->abbr.c_str() : "px"); + gchar *str = g_strdup_printf(_("Stroke width: %s%s"), + q.string().c_str(), (result_sw == QUERY_STYLE_MULTIPLE_AVERAGED)? _(" (averaged)") : ""); _stroke_width_place.set_tooltip_text(str); diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp index 30f51cb56c..013bc8a487 100644 --- a/src/ui/widget/style-swatch.cpp +++ b/src/ui/widget/style-swatch.cpp @@ -337,16 +337,15 @@ void StyleSwatch::setStyle(SPStyle *query) w = query->stroke_width.computed; } + auto q_str = Inkscape::Util::Quantity(w, + _sw_unit ? _sw_unit->abbr.c_str() : "px").string(); { - gchar *str = g_strdup_printf(" %.3g", w); + gchar *str = g_strdup_printf(" %s", q_str.c_str()); _stroke_width.set_markup(str); g_free (str); } { - gchar *str = g_strdup_printf(_("Stroke width: %.5g%s"), - w, - g_dpgettext2(nullptr, "unit-abbr", - _sw_unit? _sw_unit->abbr.c_str() : "px")); + gchar *str = g_strdup_printf(_("Stroke width: %s"), q_str.c_str()); _stroke_width_place.set_tooltip_text(str); g_free (str); } @@ -358,14 +357,15 @@ void StyleSwatch::setStyle(SPStyle *query) gdouble op = SP_SCALE24_TO_FLOAT(query->opacity.value); if (op != 1) { + auto q_str = Inkscape::Util::Quantity(op*100.0, "%").string(); { gchar *str; - str = g_strdup_printf(_("O: %2.0f"), (op*100.0)); + str = g_strdup_printf(_("O: %s"), q_str.c_str()); _opacity_value.set_markup (str); g_free (str); } { - gchar *str = g_strdup_printf(_("Opacity: %2.1f %%"), (op*100.0)); + gchar *str = g_strdup_printf(_("Opacity: %s"), q_str.c_str()); _opacity_place.set_tooltip_text(str); g_free (str); } -- GitLab From d78eb406b2e6cca93397dc9c193f5900b54baa80 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 13:52:03 +0000 Subject: [PATCH 16/28] Localize stroke width popup menu in SelectedStyle --- src/ui/widget/selected-style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 7b789a38fb..7ea304e45d 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -333,10 +333,10 @@ SelectedStyle::SelectedStyle(bool /*layout*/) Inkscape::Util::UnitTable::UnitMap m = unit_table.units(Inkscape::Util::UNIT_TYPE_LINEAR); Inkscape::Util::UnitTable::UnitMap::iterator iter = m.begin(); while(iter != m.end()) { + Inkscape::Util::Unit const *u = unit_table.getUnit(iter->first); Gtk::RadioMenuItem *mi = Gtk::manage(new Gtk::RadioMenuItem(_sw_group)); - mi->add(*(new Gtk::Label(iter->first, Gtk::ALIGN_START))); + mi->add(*(new Gtk::Label(g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()), Gtk::ALIGN_START))); _unit_mis.push_back(mi); - Inkscape::Util::Unit const *u = unit_table.getUnit(iter->first); mi->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &SelectedStyle::on_popup_units), u)); _popup_sw.attach(*mi, 0,1, row, row+1); row++; -- GitLab From c67acd1634e10060b805da363d821c06135fa38d Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 14:19:54 +0000 Subject: [PATCH 17/28] Localize ScalarUnit suffix --- src/ui/widget/scalar-unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/widget/scalar-unit.cpp b/src/ui/widget/scalar-unit.cpp index d9acd375bd..a20f2e2979 100644 --- a/src/ui/widget/scalar-unit.cpp +++ b/src/ui/widget/scalar-unit.cpp @@ -223,7 +223,7 @@ void ScalarUnit::on_unit_changed() g_assert(_unit_menu != nullptr); Glib::ustring abbr = _unit_menu->getUnitAbbr(); - _suffix->set_label(abbr); + _suffix->set_label(g_dpgettext2(nullptr, "unit-abbr", abbr.c_str())); Inkscape::Util::Unit const *new_unit = unit_table.getUnit(abbr); Inkscape::Util::Unit const *old_unit = unit_table.getUnit(lastUnits); -- GitLab From 9616bd09b5ac4ee1f17e2311cd564eb372511df3 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 14:22:06 +0000 Subject: [PATCH 18/28] Add precision argument to Quantity::string --- src/util/units.cpp | 11 ++++++----- src/util/units.h | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/util/units.cpp b/src/util/units.cpp index 8e9a2fb148..1781a6f8a4 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -519,15 +519,16 @@ double Quantity::value(char const *u) const return value(unit_table.getUnit(u)); } +// TODO: Convert this to use a per-unit/localized format. // \u202F is Narrow No-Break Space -Glib::ustring Quantity::string(Unit const *u) const { - return Glib::ustring::format(std::fixed, std::setprecision(2), value(u)) + "\u202F" + - g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); +Glib::ustring Quantity::string(Unit const *u, int p) const { + return Glib::ustring::format(std::fixed, std::setprecision(p == -1 ? u->defaultDigits() : 2), + value(u)) + "\u202F" + g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); } -Glib::ustring Quantity::string(Glib::ustring const &u) const { +Glib::ustring Quantity::string(Glib::ustring const &u, int p) const { return string(unit_table.getUnit(u.c_str())); } -Glib::ustring Quantity::string() const { +Glib::ustring Quantity::string(int p) const { return string(unit); } diff --git a/src/util/units.h b/src/util/units.h index 2b7f8674cf..fdb19fb133 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -117,10 +117,10 @@ public: double value(Glib::ustring const &u) const; double value(char const *u) const; - /** Return a printable string of the value in the specified unit. */ - Glib::ustring string(Unit const *u) const; - Glib::ustring string(Glib::ustring const &u) const; - Glib::ustring string() const; + /** Return a localized printable string of the value in the specified unit. */ + Glib::ustring string(Unit const *u, int precision=2) const; + Glib::ustring string(Glib::ustring const &u, int precision=2) const; + Glib::ustring string(int precision=2) const; /** Convert distances. no NULL check is performed on the passed pointers to Unit objects! */ -- GitLab From fb577353d0b47299295d139c7d0b5cbd0c13521d Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 14:23:30 +0000 Subject: [PATCH 19/28] Modernize loop in SelectedStyle and cleanup UnitTracker constructor --- src/ui/widget/selected-style.cpp | 6 ++---- src/ui/widget/unit-tracker.cpp | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 7ea304e45d..327fae4410 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -331,16 +331,14 @@ SelectedStyle::SelectedStyle(bool /*layout*/) int row = 0; Inkscape::Util::UnitTable::UnitMap m = unit_table.units(Inkscape::Util::UNIT_TYPE_LINEAR); - Inkscape::Util::UnitTable::UnitMap::iterator iter = m.begin(); - while(iter != m.end()) { - Inkscape::Util::Unit const *u = unit_table.getUnit(iter->first); + for (auto & iter : m) { + Inkscape::Util::Unit const *u = unit_table.getUnit(iter.first); Gtk::RadioMenuItem *mi = Gtk::manage(new Gtk::RadioMenuItem(_sw_group)); mi->add(*(new Gtk::Label(g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()), Gtk::ALIGN_START))); _unit_mis.push_back(mi); mi->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &SelectedStyle::on_popup_units), u)); _popup_sw.attach(*mi, 0,1, row, row+1); row++; - ++iter; } _popup_sw.attach(*(new Gtk::SeparatorMenuItem()), 0,1, row, row+1); diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 7cb871f3e4..96ed83d1cf 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -39,14 +39,11 @@ UnitTracker::UnitTracker(UnitType unit_type) : _store(nullptr), _priorValues() { - UnitTable::UnitMap m = unit_table.units(unit_type); - InkSelectOneActionColumns columns; _store = Gtk::ListStore::create(columns); - Gtk::TreeModel::Row row; + UnitTable::UnitMap m = unit_table.units(unit_type); for (auto & m_iter : m) { - addUnit(unit_table.getUnit(m_iter.first)); } -- GitLab From 5f8778e2a58a8154d68384e9f76d27b991394ccd Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 17:39:33 +0000 Subject: [PATCH 20/28] Add Unit::operator!= and use pointers for == comparison --- src/util/units.cpp | 7 ++++++- src/util/units.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/units.cpp b/src/util/units.cpp index 1781a6f8a4..4f2ca3336d 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -215,7 +215,12 @@ bool Unit::compatibleWith(Glib::ustring const &u) const bool Unit::operator==(Unit const &other) const { - return (type == other.type && name.compare(other.name) == 0); + return (this != &other && type == other.type && name.compare(other.name) == 0); +} + +bool Unit::operator!=(Unit const &other) const +{ + return !(*this == other) } int Unit::svgUnit() const diff --git a/src/util/units.h b/src/util/units.h index fdb19fb133..4ee2c0113e 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -83,8 +83,9 @@ public: Glib::ustring abbr; Glib::ustring description; - /** Check if units are equal. */ + /** Comparison operators. */ bool operator==(Unit const &other) const; + bool operator!=(Unit const &other) const; /** Get SVG unit code. */ int svgUnit() const; -- GitLab From cc8937c170c42059e559988318a50cacaf8263ab Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 18:27:10 +0000 Subject: [PATCH 21/28] Remove Unit::operator!= it is implement by boost --- src/util/units.cpp | 5 ----- src/util/units.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/util/units.cpp b/src/util/units.cpp index 4f2ca3336d..475c8e634b 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -218,11 +218,6 @@ bool Unit::operator==(Unit const &other) const return (this != &other && type == other.type && name.compare(other.name) == 0); } -bool Unit::operator!=(Unit const &other) const -{ - return !(*this == other) -} - int Unit::svgUnit() const { char const *astr = abbr.c_str(); diff --git a/src/util/units.h b/src/util/units.h index 4ee2c0113e..388f6078d3 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -85,7 +85,6 @@ public: /** Comparison operators. */ bool operator==(Unit const &other) const; - bool operator!=(Unit const &other) const; /** Get SVG unit code. */ int svgUnit() const; -- GitLab From f95d617090c238c739c8044e54e12f86b9ed444c Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 19:08:16 +0000 Subject: [PATCH 22/28] Make MeasureTool::setMeasureCanvasText use Quantity::string --- src/ui/tools/measure-tool.cpp | 35 ++++++++++++----------------------- src/ui/tools/measure-tool.h | 2 +- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index 2d06eb7ccd..54c56e28c1 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -1035,29 +1035,21 @@ void MeasureTool::reset() measure_tmp_items.clear(); } -void MeasureTool::setMeasureCanvasText(bool is_angle, double precision, double amount, double fontsize, Glib::ustring unit_name, Geom::Point position, guint32 background, CanvasTextAnchorPositionEnum text_anchor, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr) +void MeasureTool::setMeasureCanvasText(double precision, double amount, double fontsize, Glib::ustring unit_name, Geom::Point position, guint32 background, CanvasTextAnchorPositionEnum text_anchor, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; - std::stringstream precision_str; - precision_str.imbue(std::locale::classic()); - // TODO: Properly localize this? Degree symbol and value-unit spacing - if(is_angle){ - precision_str << "%." << precision << "f°"; - } else { - precision_str << "%." << precision << "f\u202F%s"; // \u202F is Narrow No-Break Space - } - gchar *measure_str = g_strdup_printf(precision_str.str().c_str(), amount, unit_name.c_str()); + auto measure_str = Inkscape::Util::Quantity(amount, unit_name).string(precision); SPCanvasText *canvas_tooltip = sp_canvastext_new(desktop->getTempGroup(), desktop, position, - measure_str); + measure_str.c_str()); sp_canvastext_set_fontsize(canvas_tooltip, fontsize); canvas_tooltip->rgba = 0xffffffff; canvas_tooltip->rgba_background = background; canvas_tooltip->outline = false; canvas_tooltip->background = true; canvas_tooltip->anchor_position = text_anchor; - if(to_phantom){ + if (to_phantom) { canvas_tooltip->rgba_background = 0x4444447f; measure_phantom_items.push_back(SP_CANVAS_ITEM(canvas_tooltip)); sp_canvas_item_show(SP_CANVAS_ITEM(canvas_tooltip)); @@ -1066,10 +1058,9 @@ void MeasureTool::setMeasureCanvasText(bool is_angle, double precision, double a sp_canvas_item_show(SP_CANVAS_ITEM(canvas_tooltip)); } - if(to_item) { - setLabelText(measure_str, position, fontsize, 0, background, measure_repr); + if (to_item) { + setLabelText(measure_str.c_str(), position, fontsize, 0, background, measure_repr); } - g_free(measure_str); } void MeasureTool::setMeasureCanvasItem(Geom::Point position, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr){ @@ -1365,31 +1356,29 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom, // Adjust positions repositionOverlappingLabels(placements, desktop, windowNormal, fontsize, precision); for (auto & place : placements) { - setMeasureCanvasText(false, precision, place.lengthVal * scale, fontsize, - g_dpgettext2(nullptr, "unit-abbr", unit_name.c_str()), place.end, 0x0000007f, - TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); + setMeasureCanvasText(precision, place.lengthVal * scale, fontsize, unit_name.c_str(), + place.end, 0x0000007f, TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); } Geom::Point angleDisplayPt = calcAngleDisplayAnchor(desktop, angle, baseAngle, start_p, end_p, fontsize); { - setMeasureCanvasText(true, precision, Geom::deg_from_rad(angle), fontsize, unit_name, angleDisplayPt, 0x337f337f, TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); + setMeasureCanvasText(precision, Geom::deg_from_rad(angle), fontsize, "deg", angleDisplayPt, 0x337f337f, TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); } { double totallengthval = (end_p - start_p).length(); totallengthval = Inkscape::Util::Quantity::convert(totallengthval, "px", unit_name); Geom::Point origin = end_p + desktop->w2d(Geom::Point(3*fontsize, -fontsize)); - setMeasureCanvasText(false, precision, totallengthval * scale, fontsize, - g_dpgettext2(nullptr, "unit-abbr", unit_name.c_str()), origin, 0x3333337f, - TEXT_ANCHOR_LEFT, to_item, to_phantom, measure_repr); + setMeasureCanvasText(precision, totallengthval * scale, fontsize, unit_name.c_str(), + origin, 0x3333337f, TEXT_ANCHOR_LEFT, to_item, to_phantom, measure_repr); } if (intersections.size() > 2) { double totallengthval = (intersections[intersections.size()-1] - intersections[0]).length(); totallengthval = Inkscape::Util::Quantity::convert(totallengthval, "px", unit_name); Geom::Point origin = desktop->doc2dt((intersections[0] + intersections[intersections.size()-1])/2) + normal * dimension_offset; - setMeasureCanvasText(false, precision, totallengthval * scale, fontsize, unit_name, origin, 0x33337f7f, TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); + setMeasureCanvasText(precision, totallengthval * scale, fontsize, unit_name, origin, 0x33337f7f, TEXT_ANCHOR_CENTER, to_item, to_phantom, measure_repr); } // Initial point diff --git a/src/ui/tools/measure-tool.h b/src/ui/tools/measure-tool.h index a6ca39ec7a..a55322df48 100644 --- a/src/ui/tools/measure-tool.h +++ b/src/ui/tools/measure-tool.h @@ -57,7 +57,7 @@ public: void setGuide(Geom::Point origin, double angle, const char *label); void setPoint(Geom::Point origin, Inkscape::XML::Node *measure_repr); void setLine(Geom::Point start_point,Geom::Point end_point, bool markers, guint32 color, Inkscape::XML::Node *measure_repr = nullptr); - void setMeasureCanvasText(bool is_angle, double precision, double amount, double fontsize, Glib::ustring unit_name, Geom::Point position, guint32 background, CanvasTextAnchorPositionEnum text_anchor, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr); + void setMeasureCanvasText(double precision, double amount, double fontsize, Glib::ustring unit_name, Geom::Point position, guint32 background, CanvasTextAnchorPositionEnum text_anchor, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr); void setMeasureCanvasItem(Geom::Point position, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr); void setMeasureCanvasControlLine(Geom::Point start, Geom::Point end, bool to_item, bool to_phantom, Inkscape::CtrlLineType ctrl_line_type, Inkscape::XML::Node *measure_repr); void setLabelText(const char *value, Geom::Point pos, double fontsize, Geom::Coord angle, guint32 background , Inkscape::XML::Node *measure_repr = nullptr, CanvasTextAnchorPositionEnum text_anchor = TEXT_ANCHOR_CENTER ); -- GitLab From 208bdca2904c7bd55fcc8d9f2269cc72a44e2c8b Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 19:12:47 +0000 Subject: [PATCH 23/28] Add per-unit format string --- share/ui/units.xml | 208 ++++++++++++++++++--------------------------- src/util/units.cpp | 19 +++-- src/util/units.h | 2 + 3 files changed, 97 insertions(+), 132 deletions(-) diff --git a/share/ui/units.xml b/share/ui/units.xml index f556046b34..c4f5dad48d 100644 --- a/share/ui/units.xml +++ b/share/ui/units.xml @@ -1,184 +1,144 @@ - - + - <_name msgctxt="unit-name" >Unit - <_description msgctxt="unit-description" >Unnamed dimensionless unit (1) - <_text msgctxt="unit-text" >unit - <_text_plural msgctxt="unit-text-plural" >units - <_abbr msgctxt="unit-abbr" > - <_symbol msgctxt="unit-symbol" > - - <_symbol_format msgctxt="unit-symbol_format">%f + Unit + Unnamed dimensionless unit + unit + <_name_plural msgctxt="unit-text-plural" >units + <_abbr msgctxt="unit-abbr" >unit + %1 - - <_name msgctxt="unit-name" >Percent - <_description msgctxt="unit-description" >Percentage (unit/100) - <_text msgctxt="unit-text" >percent - <_text_plural msgctxt="unit-text-plural" >percent + + Percent + Percentage of a number + percent + <_name_plural msgctxt="unit-text-plural" >percent <_abbr msgctxt="unit-abbr" >% - <_symbol msgctxt="unit-symbol" >% - - <_symbol_format msgctxt="unit-symbol_format">%f%% + %1%% 1.00 - <_name msgctxt="unit-name" >Pixel - <_description msgctxt="unit-description" >CSS pixels (96/inch) - <_text msgctxt="unit-text" >pixel - <_text_plural msgctxt="unit-text-plural" >pixels + Pixel + CSS pixels (96/inch) + pixel + <_name_plural msgctxt="unit-text-plural" >pixels <_abbr msgctxt="unit-abbr" >px - <_symbol msgctxt="unit-symbol" >px - - <_symbol_format msgctxt="unit-symbol_format">%f px + %1 px 1.00 - <_name msgctxt="unit-name" >Point - <_description msgctxt="unit-description" >PostScript points (72/inch) - <_text msgctxt="unit-text" >point - <_text_plural msgctxt="unit-text-plural" >points + Point + PostScript points (72/inch) + point + <_name_plural msgctxt="unit-text-plural" >points <_abbr msgctxt="unit-abbr" >pt - <_symbol msgctxt="unit-symbol" >pt - - <_symbol_format msgctxt="unit-symbol_format">%f pt + %1 pt 1.333333333333333 - <_name msgctxt="unit-name" >Pica - <_description msgctxt="unit-description" >12 points (6/inch) - <_text msgctxt="unit-text" >pica - <_text_plural msgctxt="unit-text-plural" >picas + Pica + Picas (6/inch) + pica + <_name_plural msgctxt="unit-text-plural" >picas <_abbr msgctxt="unit-abbr" >pc - <_symbol msgctxt="unit-symbol" >pc - - <_symbol_format msgctxt="unit-symbol_format">%f pc + %1 pc 16.0 - <_name msgctxt="unit-name" >Inch - <_description msgctxt="unit-description" >Inches (96 px/in) - <_text msgctxt="unit-text" >inch - <_text_plural msgctxt="unit-text-plural" >inches + Inch + Inches (96 px/in) + inch + <_name_plural msgctxt="unit-text-plural" >inches <_abbr msgctxt="unit-abbr" >in - <_symbol msgctxt="unit-symbol" >″ - - <_symbol_format msgctxt="unit-symbol_format">%f″ + %1″ 96.0 - <_name msgctxt="unit-name" >Millimeter - <_description msgctxt="unit-description" >Millimeters (25.4 mm/in) - <_text msgctxt="unit-text" >millimeter - <_text_plural msgctxt="unit-text-plural" >millimeters + Millimeter + Millimeters (25.4 mm/in) + millimeter + <_name_plural msgctxt="unit-text-plural" >millimeters <_abbr msgctxt="unit-abbr" >mm - <_symbol msgctxt="unit-symbol" >mm - - <_symbol_format msgctxt="unit-symbol_format">%f mm + %1 mm 3.779527559055119 - <_name msgctxt="unit-name" >Centimeter - <_description msgctxt="unit-description" >Centimeters (10 mm/cm) - <_text msgctxt="unit-text" >centimeter - <_text_plural msgctxt="unit-text-plural" >centimeters + Centimeter + Centimeters (10 mm/cm) + centimeter + <_name_plural msgctxt="unit-text-plural" >centimeters <_abbr msgctxt="unit-abbr" >cm - <_symbol msgctxt="unit-symbol" >cm - - <_symbol_format msgctxt="unit-symbol_format">%f cm + %1 cm 37.79527559055119 - <_name msgctxt="unit-name" >Degree - <_description msgctxt="unit-description" >Degrees (turn/360) - <_text msgctxt="unit-text" >degree - <_text_plural msgctxt="unit-text-plural" >degrees + Degree + Degrees (1° = (π/180) rad) + degree + <_name_plural msgctxt="unit-text-plural" >degrees <_abbr msgctxt="unit-abbr" >deg - <_symbol msgctxt="unit-symbol" >° - - <_symbol_format msgctxt="unit-symbol_format">%f° + %1° 1.00 - <_name msgctxt="unit-name" >Radian - <_description msgctxt="unit-description" >Radians (pi/180 rad/deg) - <_text msgctxt="unit-text" >radian - <_text_plural msgctxt="unit-text-plural" >radians + Radian + Radians (pi/180 rad/deg) + radian + <_name_plural msgctxt="unit-text-plural" >radians <_abbr msgctxt="unit-abbr" >rad - <_symbol msgctxt="unit-symbol" >rad - - <_symbol_format msgctxt="unit-symbol_format">%f rad + %1 rad 57.29577951308232 - <_name msgctxt="unit-name" >Gradian - <_description msgctxt="unit-description" >Gradians (400/360 grad/deg) - <_text msgctxt="unit-text" >gradian - <_text_plural msgctxt="unit-text-plural" >gradians + Gradian + Gradians (400/360 grad/deg) + gradian + <_name_plural msgctxt="unit-text-plural" >gradians <_abbr msgctxt="unit-abbr" >grad - <_symbol msgctxt="unit-symbol" >grad - - <_symbol_format msgctxt="unit-symbol_format">%f grad + %1 grad 0.9 - <_name msgctxt="unit-name" >Turn - <_description msgctxt="unit-description" >Turns (1/360 turn/deg) - <_text msgctxt="unit-text" >turn - <_text_plural msgctxt="unit-text-plural" >turns + Turn + Turns (1/360 turn/deg) + turn + <_name_plural msgctxt="unit-text-plural" >turns <_abbr msgctxt="unit-abbr" >turn - <_symbol msgctxt="unit-symbol" >turn - - <_symbol_format msgctxt="unit-symbol_format">%f turn + %1 turn 360 - - <_name msgctxt="unit-name" >Font Height - <_description msgctxt="unit-description" >The point size of the current font - <_text msgctxt="unit-text" >em - <_text_plural msgctxt="unit-text-plural" >ems + + Font-Height + Point size of the current font + em + <_name_plural msgctxt="unit-text-plural" >ems <_abbr msgctxt="unit-abbr" >em - <_symbol msgctxt="unit-symbol" >em - - <_symbol_format msgctxt="unit-symbol_format">%f em + %1 em 1.00 - - - <_name msgctxt="unit-name" >X-Height - <_description msgctxt="unit-description" >The height of the letter 'x' in the current font - <_text msgctxt="unit-text" >ex - <_text_plural msgctxt="unit-text-plural" >exes + + + X-Height + Height of the letter 'x' in the current font + ex + <_name_plural msgctxt="unit-text-plural" >exes <_abbr msgctxt="unit-abbr" >ex - <_symbol msgctxt="unit-symbol" >ex - - <_symbol_format msgctxt="unit-symbol_format">%f ex - <_name msgctxt="Unit, Font">ex + %1 ex + ex 0.50 - - <_name msgctxt="unit-name" >Half Font Height - <_description msgctxt="unit-description" >Half the size of the current font height - <_text msgctxt="unit-text" >en - <_text_plural msgctxt="unit-text-plural" >ens + + + Half Font-Height + Half the current font-height + en + <_name_plural msgctxt="unit-text-plural" >ens <_abbr msgctxt="unit-abbr" >en - <_symbol msgctxt="unit-symbol" >en - - <_symbol_format msgctxt="unit-symbol_format">%f en + %1 en 0.50 diff --git a/src/util/units.cpp b/src/util/units.cpp index 475c8e634b..313128af5f 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -108,7 +108,7 @@ TypeMap make_type_map() tmap["dimensionless"] = UNIT_TYPE_DIMENSIONLESS; tmap["linear"] = UNIT_TYPE_LINEAR; tmap["angular"] = UNIT_TYPE_RADIAL; - tmap["fontHeight"] = UNIT_TYPE_FONT_HEIGHT; + tmap["fontSize"] = UNIT_TYPE_FONT_HEIGHT; // Note that code was not yet handling LINEAR_SCALED, TIME, QTY and NONE return tmap; @@ -157,6 +157,7 @@ Unit::Unit() : name(), name_plural(), abbr(), + format(), description() { } @@ -166,12 +167,14 @@ Unit::Unit(UnitType type, Glib::ustring name, Glib::ustring name_plural, Glib::ustring abbr, + Glib::ustring format, Glib::ustring description) : type(type) , factor(factor) , name(std::move(name)) , name_plural(std::move(name_plural)) , abbr(std::move(abbr)) + , format(std::move(format)) , description(std::move(description)) { g_return_if_fail(factor <= 0); @@ -458,10 +461,12 @@ void UnitParser::on_text(Ctx &ctx, Glib::ustring const &text) } if (element == "name") { unit.name = text; - } else if (element == "text_plural") { + } else if (element == "name_plural") { unit.name_plural = text; } else if (element == "abbr") { unit.abbr = text; + } else if (element == "format") { + unit.format = text; } else if (element == "factor") { // TODO make sure we use the right conversion unit.factor = g_ascii_strtod(text.c_str(), nullptr); @@ -519,17 +524,15 @@ double Quantity::value(char const *u) const return value(unit_table.getUnit(u)); } -// TODO: Convert this to use a per-unit/localized format. -// \u202F is Narrow No-Break Space Glib::ustring Quantity::string(Unit const *u, int p) const { - return Glib::ustring::format(std::fixed, std::setprecision(p == -1 ? u->defaultDigits() : 2), - value(u)) + "\u202F" + g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); + return Glib::ustring::compose(u->format, Glib::ustring::format( + std::fixed, std::setprecision(p == -1 ? u->defaultDigits() : p), value(u))); } Glib::ustring Quantity::string(Glib::ustring const &u, int p) const { - return string(unit_table.getUnit(u.c_str())); + return string(unit_table.getUnit(u.c_str()), p); } Glib::ustring Quantity::string(int p) const { - return string(unit); + return string(unit, p); } double Quantity::convert(double from_dist, Unit const *from, Unit const *to) diff --git a/src/util/units.h b/src/util/units.h index 388f6078d3..2f4e1676a7 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -59,6 +59,7 @@ public: Glib::ustring name, Glib::ustring name_plural, Glib::ustring abbr, + Glib::ustring format, Glib::ustring description); void clear(); @@ -81,6 +82,7 @@ public: Glib::ustring name; Glib::ustring name_plural; Glib::ustring abbr; + Glib::ustring format; Glib::ustring description; /** Comparison operators. */ -- GitLab From e4e6f4c2f2a4b378f3e116c328728f6ee92428c3 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 19:13:37 +0000 Subject: [PATCH 24/28] Clean up UnitTracker --- src/ui/widget/unit-tracker.cpp | 135 +++++++++++++++------------------ 1 file changed, 63 insertions(+), 72 deletions(-) diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 96ed83d1cf..43d300c164 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include "unit-tracker.h" @@ -86,13 +87,11 @@ void UnitTracker::setActiveUnit(Inkscape::Util::Unit const *unit) int index = 0; for (auto& row: _store->children() ) { void* pointer = row[columns.col_data]; - if (pointer) - { - Unit const *storedUnit = static_cast(pointer); - if (!unit->abbr.compare(storedUnit->abbr)) { - _setActive(index); - break; - } + assert(pointer); + auto storedUnit = static_cast(pointer); + if (*unit != *storedUnit) { + _setActive(index); + break; } index++; } @@ -115,42 +114,35 @@ void UnitTracker::addAdjustment(GtkAdjustment *adj) } } -void UnitTracker::addUnit(Inkscape::Util::Unit const *u) +void initialize_row(Gtk::TreeModel::Row &row, Inkscape::Util::Unit const *u) { - InkSelectOneActionColumns columns; + assert(u); - Glib::ustring label; - if (u->abbr != "") + Glib::ustring label = u->abbr; + if (label != "") label = g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); - Gtk::TreeModel::Row row; - row = *(_store->append()); - row[columns.col_data ] = const_cast(u); + InkSelectOneActionColumns columns; + row[columns.col_data ] = const_cast(u); row[columns.col_label ] = label; row[columns.col_tooltip ] = (""); row[columns.col_icon ] = "NotUsed"; row[columns.col_sensitive] = true; } -void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) +void UnitTracker::addUnit(Inkscape::Util::Unit const *u) { - InkSelectOneActionColumns columns; - - Glib::ustring label; - if (u->abbr != "") - label = g_dpgettext2(nullptr, "unit-abbr", u->abbr.c_str()); + Gtk::TreeModel::Row r = *(_store->append()); + initialize_row(r, u); +} - Gtk::TreeModel::Row row; - row = *(_store->prepend()); - row[columns.col_data ] = const_cast(u); - row[columns.col_label ] = label; - row[columns.col_tooltip ] = (""); - row[columns.col_icon ] = "NotUsed"; - row[columns.col_sensitive] = true; +void UnitTracker::prependUnit(Inkscape::Util::Unit const *u) +{ + Gtk::TreeModel::Row r = *(_store->prepend()); + initialize_row(r, u); /* Re-shuffle our default selection here (_active gets out of sync) */ setActiveUnit(_activeUnit); - } void UnitTracker::setFullVal(GtkAdjustment *adj, gdouble val) @@ -235,62 +227,61 @@ void UnitTracker::_adjustmentFinalized(GObject *where_the_object_was) void UnitTracker::_setActive(gint active) { - if ( active != _active || !_activeUnitInitialized ) { - gint oldActive = _active; - - if (_store) { - - // Find old and new units - InkSelectOneActionColumns columns; - int index = 0; - Glib::ustring oldAbbr( "NotFound" ); - Glib::ustring newAbbr( "NotFound" ); - for (auto& row: _store->children() ) { - if (index == _active) { - void* pointer = row[columns.col_data]; - if (pointer) - oldAbbr = static_cast(pointer)->abbr;; - } - if (index == active) { - void* pointer = row[columns.col_data]; - if (pointer) - newAbbr = static_cast(pointer)->abbr; - } - if (newAbbr != "NotFound" && oldAbbr != "NotFound") break; - ++index; + if (active == _active && _activeUnitInitialized) { + return; + } + + if (_store) { + + // Find old and new units + InkSelectOneActionColumns columns; + int index = 0; + Inkscape::Util::Unit const *oldUnit; + Inkscape::Util::Unit const *newUnit; + for (auto& row: _store->children() ) { + if (index == _active) { + void* pointer = row[columns.col_data]; + assert(pointer); + oldUnit = static_cast(pointer); } + if (index == active) { + void* pointer = row[columns.col_data]; + assert(pointer); + newUnit = static_cast(pointer); + } + if (oldUnit && newUnit) break; + ++index; + } - if (oldAbbr != "NotFound") { + if (oldUnit) { - if (newAbbr != "NotFound") { - Inkscape::Util::Unit const *oldUnit = unit_table.getUnit(oldAbbr); - Inkscape::Util::Unit const *newUnit = unit_table.getUnit(newAbbr); - _activeUnit = newUnit; + if (newUnit) { + _activeUnit = newUnit; - if (!_adjList.empty()) { - _fixupAdjustments(oldUnit, newUnit); - } - } else { - std::cerr << "UnitTracker::_setActive: Did not find new unit: " << active << std::endl; + if (!_adjList.empty()) { + _fixupAdjustments(oldUnit, newUnit); } - } else { - std::cerr << "UnitTracker::_setActive: Did not find old unit: " << oldActive - << " new: " << active << std::endl; + std::cerr << "UnitTracker::_setActive: Did not find new unit: " << active << std::endl; } - } - _active = active; - for (auto act: _actionList) { - act->set_active(active); + } else { + std::cerr << "UnitTracker::_setActive: Did not find old unit: " << _active + << " new: " << active << std::endl; } + } - for (auto combo : _combo_list) { - if(combo) combo->set_active(active); - } + _active = active; + + for (auto act: _actionList) { + act->set_active(active); + } - _activeUnitInitialized = true; + for (auto combo : _combo_list) { + if(combo) combo->set_active(active); } + + _activeUnitInitialized = true; } void UnitTracker::_fixupAdjustments(Inkscape::Util::Unit const *oldUnit, Inkscape::Util::Unit const *newUnit) -- GitLab From 5021acd4bea23f5b1bd29803b2693401274300f3 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 20:26:19 +0000 Subject: [PATCH 25/28] Add units to cursor coordinate display --- src/widgets/desktop-widget.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 2528e57f5e..4028ee5a88 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -646,8 +646,8 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->_coord_status_y = Gtk::manage(new Gtk::Label()); dtw->_coord_status_x->set_name("CoordinateStatusX"); dtw->_coord_status_y->set_name("CoordinateStatusY"); - dtw->_coord_status_x->set_markup(" 0.00 "); - dtw->_coord_status_y->set_markup(" 0.00 "); + dtw->_coord_status_x->set_text(" 0.00 "); + dtw->_coord_status_y->set_text(" 0.00 "); auto label_z = Gtk::manage(new Gtk::Label(_("Z:"))); label_z->set_name("ZLabel"); @@ -655,6 +655,10 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) label_r->set_name("RLabel"); dtw->_coord_status_x->set_halign(Gtk::ALIGN_END); dtw->_coord_status_y->set_halign(Gtk::ALIGN_END); + dtw->_coord_status_x->set_xalign(1); + dtw->_coord_status_y->set_xalign(1); + dtw->_coord_status_x->set_width_chars(10); + dtw->_coord_status_y->set_width_chars(10); dtw->_coord_status->attach(*dtw->_coord_status_x, 2, 0, 1, 1); dtw->_coord_status->attach(*dtw->_coord_status_y, 2, 1, 1, 1); dtw->_coord_status->attach(*label_z, 3, 0, 1, 2); @@ -1266,14 +1270,10 @@ SPDesktopWidget::disableInteraction() void SPDesktopWidget::setCoordinateStatus(Geom::Point p) { - gchar *cstr; - cstr = g_strdup_printf("%7.2f", _dt2r * p[Geom::X]); - _coord_status_x->set_markup(cstr); - g_free(cstr); - - cstr = g_strdup_printf("%7.2f", _dt2r * p[Geom::Y]); - _coord_status_y->set_markup(cstr); - g_free(cstr); + SPNamedView *nv = desktop->namedview; + auto unit = nv->display_units; + _coord_status_x->set_text(Inkscape::Util::Quantity(_dt2r * p[Geom::X], unit).string()); + _coord_status_y->set_text(Inkscape::Util::Quantity(_dt2r * p[Geom::Y], unit).string()); } void -- GitLab From 4055a0b71e801ee1406200776e21b65bf0f7fb5a Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 20:27:56 +0000 Subject: [PATCH 26/28] Revert "Add escaping to allow spaces in ${CMAKE_CURRENT_BINARY_DIR}" This reverts commit 672753784f398a80f8604089f63a1f9f7effc360. --- share/templates/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/templates/CMakeLists.txt b/share/templates/CMakeLists.txt index fbcf63d404..aecdca6bb9 100644 --- a/share/templates/CMakeLists.txt +++ b/share/templates/CMakeLists.txt @@ -18,7 +18,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${INKSCAPE_SHARE_INSTA add_custom_target(inkscape_default_svg ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/create_defaults.pl ${CMAKE_CURRENT_SOURCE_DIR}/default.svg #BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/default-* - COMMAND sh -c \"\\\"${CMAKE_CURRENT_SOURCE_DIR}/create_defaults.pl\\\"\" - COMMAND sh -c \"mv default-* \\\"${CMAKE_CURRENT_BINARY_DIR}\\\"\" + COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/create_defaults.pl" + COMMAND sh -c "mv default-* ${CMAKE_CURRENT_BINARY_DIR}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -- GitLab From 86c5db1a6a03117052f66f9282c838c49bad7ecb Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 21:28:29 +0000 Subject: [PATCH 27/28] Localize the format string in units.xml --- share/ui/units.xml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/share/ui/units.xml b/share/ui/units.xml index c4f5dad48d..861f6cb51b 100644 --- a/share/ui/units.xml +++ b/share/ui/units.xml @@ -7,7 +7,7 @@ unit <_name_plural msgctxt="unit-text-plural" >units <_abbr msgctxt="unit-abbr" >unit - %1 + <_format msgctxt="unit-format" >%1 Percent @@ -15,7 +15,7 @@ percent <_name_plural msgctxt="unit-text-plural" >percent <_abbr msgctxt="unit-abbr" >% - %1%% + <_format msgctxt="unit-format" >%1%% 1.00 @@ -25,7 +25,7 @@ pixel <_name_plural msgctxt="unit-text-plural" >pixels <_abbr msgctxt="unit-abbr" >px - %1 px + <_format msgctxt="unit-format" >%1 px 1.00 @@ -34,7 +34,7 @@ point <_name_plural msgctxt="unit-text-plural" >points <_abbr msgctxt="unit-abbr" >pt - %1 pt + <_format msgctxt="unit-format" >%1 pt 1.333333333333333 @@ -43,7 +43,7 @@ pica <_name_plural msgctxt="unit-text-plural" >picas <_abbr msgctxt="unit-abbr" >pc - %1 pc + <_format msgctxt="unit-format" >%1 pc 16.0 @@ -52,7 +52,7 @@ inch <_name_plural msgctxt="unit-text-plural" >inches <_abbr msgctxt="unit-abbr" >in - %1″ + <_format msgctxt="unit-format" >%1″ 96.0 @@ -61,7 +61,7 @@ millimeter <_name_plural msgctxt="unit-text-plural" >millimeters <_abbr msgctxt="unit-abbr" >mm - %1 mm + <_format msgctxt="unit-format" >%1 mm 3.779527559055119 @@ -70,7 +70,7 @@ centimeter <_name_plural msgctxt="unit-text-plural" >centimeters <_abbr msgctxt="unit-abbr" >cm - %1 cm + <_format msgctxt="unit-format" >%1 cm 37.79527559055119 @@ -80,7 +80,7 @@ degree <_name_plural msgctxt="unit-text-plural" >degrees <_abbr msgctxt="unit-abbr" >deg - %1° + <_format msgctxt="unit-format" >%1° 1.00 @@ -89,7 +89,7 @@ radian <_name_plural msgctxt="unit-text-plural" >radians <_abbr msgctxt="unit-abbr" >rad - %1 rad + <_format msgctxt="unit-format" >%1 rad 57.29577951308232 @@ -98,7 +98,7 @@ gradian <_name_plural msgctxt="unit-text-plural" >gradians <_abbr msgctxt="unit-abbr" >grad - %1 grad + <_format msgctxt="unit-format" >%1 grad 0.9 @@ -107,7 +107,7 @@ turn <_name_plural msgctxt="unit-text-plural" >turns <_abbr msgctxt="unit-abbr" >turn - %1 turn + <_format msgctxt="unit-format" >%1 turn 360 @@ -117,7 +117,7 @@ em <_name_plural msgctxt="unit-text-plural" >ems <_abbr msgctxt="unit-abbr" >em - %1 em + <_format msgctxt="unit-format" >%1 em 1.00 @@ -127,8 +127,7 @@ ex <_name_plural msgctxt="unit-text-plural" >exes <_abbr msgctxt="unit-abbr" >ex - %1 ex - ex + <_format msgctxt="unit-format" >%1 ex 0.50 @@ -138,7 +137,7 @@ en <_name_plural msgctxt="unit-text-plural" >ens <_abbr msgctxt="unit-abbr" >en - %1 en + <_format msgctxt="unit-format" >%1 en 0.50 -- GitLab From d9920a183a1093c995400c04f6544a74082f7270 Mon Sep 17 00:00:00 2001 From: tim_rawlinson Date: Thu, 21 Feb 2019 22:36:12 +0000 Subject: [PATCH 28/28] Fix use of DEG --- src/svg/svg-angle.cpp | 6 +++--- src/ui/dialog/polar-arrange-tab.cpp | 4 ++-- src/util/units.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/svg/svg-angle.cpp b/src/svg/svg-angle.cpp index e82d0de457..1ca952a029 100644 --- a/src/svg/svg-angle.cpp +++ b/src/svg/svg-angle.cpp @@ -103,15 +103,15 @@ static bool sp_svg_angle_read_lff(gchar const *str, SVGAngle::Unit &unit, float } else if (strncmp(e, "grad", 4) == 0) { unit = SVGAngle::GRAD; val = v; - computed = Inkscape::Util::Quantity::convert(v, "grad", "°"); + computed = Inkscape::Util::Quantity::convert(v, "grad", Inkscape::Util::DEG); } else if (strncmp(e, "rad", 3) == 0) { unit = SVGAngle::RAD; val = v; - computed = Inkscape::Util::Quantity::convert(v, "rad", "°"); + computed = Inkscape::Util::Quantity::convert(v, "rad", Inkscape::Util::DEG); } else if (strncmp(e, "turn", 4) == 0) { unit = SVGAngle::TURN; val = v; - computed = Inkscape::Util::Quantity::convert(v, "turn", "°"); + computed = Inkscape::Util::Quantity::convert(v, "turn", Inkscape::Util::DEG); } else { return false; } diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index de026b8d59..cfcfd57d13 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -107,11 +107,11 @@ PolarArrangeTab::PolarArrangeTab(ArrangeDialog *parent_) angleX.setDigits(2); angleX.setIncrements(0.2, 0); angleX.setRange(-10000, 10000); - angleX.setValue(0, "°"); + angleX.setValue(0, Inkscape::Util::DEG); angleY.setDigits(2); angleY.setIncrements(0.2, 0); angleY.setRange(-10000, 10000); - angleY.setValue(180, "°"); + angleY.setValue(180, Inkscape::Util::DEG); parametersTable.attach(angleX, 1, 2, 1, 1); parametersTable.attach(angleY, 2, 2, 1, 1); pack_start(parametersTable, false, false); diff --git a/src/util/units.h b/src/util/units.h index 2f4e1676a7..0a6d94a419 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -47,7 +47,7 @@ enum UnitType { UNIT_TYPE_NONE = -1 }; -const char DEG[] = "°"; +const char DEG[] = "deg"; class Unit : boost::equality_comparable @@ -85,7 +85,7 @@ public: Glib::ustring format; Glib::ustring description; - /** Comparison operators. */ + /** Check if units are equal. */ bool operator==(Unit const &other) const; /** Get SVG unit code. */ -- GitLab