Parcourir la source

Small changes, translate

Kandrashin Denis il y a 13 ans
Parent
commit
1c6df50c0b
7 fichiers modifiés avec 82 ajouts et 16 suppressions
  1. 5 5
      source/fb2head.cpp
  2. 1 1
      source/fb2head.hpp
  3. 5 2
      source/fb2main.cpp
  4. 2 1
      source/fb2main.hpp
  5. 1 0
      source/fb2tree.cpp
  6. BIN
      source/ts/ru.qm
  7. 68 7
      source/ts/ru.ts

+ 5 - 5
source/fb2head.cpp

@@ -283,8 +283,8 @@ QString Fb2HeadItem::value() const
             return m_element.attribute("src");
         } break;
         case Seqn : {
-            QString text = m_element.attribute("fb2.name");
-            QString numb = m_element.attribute("fb2.number");
+            QString text = m_element.attribute("fb2_name");
+            QString numb = m_element.attribute("fb2_number");
             if (numb.isEmpty() || numb == "0") return text;
             return text + ", " + tr("#") + numb;
         } break;
@@ -308,9 +308,9 @@ Fb2Scheme Fb2HeadItem::scheme() const
     return parent.element(m_name);
 }
 
-bool Fb2HeadItem::remove(int row)
+void Fb2HeadItem::remove(int row)
 {
-    if (row < 0 || row >= count()) return false;
+    if (row < 0 || row >= count()) return;
     m_list[row]->m_element.removeFromDocument();
     m_list.removeAt(row);
 }
@@ -486,7 +486,7 @@ Fb2HeadView::Fb2HeadView(Fb2WebView &view, QWidget *parent)
 
     //setItemDelegate(new QItemDelegate(this));
     setRootIsDecorated(false);
-    setSelectionBehavior(QAbstractItemView::SelectItems);
+    setSelectionBehavior(QAbstractItemView::SelectRows);
     setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
     connect(&m_view, SIGNAL(loadFinished(bool)), SLOT(updateTree()));
     connect(this, SIGNAL(activated(QModelIndex)), SLOT(activated(QModelIndex)));

+ 1 - 1
source/fb2head.hpp

@@ -67,7 +67,7 @@ public:
 
     Fb2HeadItem * append(const QString name);
 
-    bool remove(int row);
+    void remove(int row);
 
     Fb2HeadItem * item(const QModelIndex &index) const;
 

+ 5 - 2
source/fb2main.cpp

@@ -311,7 +311,10 @@ void Fb2MainWindow::createActions()
     actionSection = act = new QAction(FB2::icon("insert-object"), tr("&Section"), this);
     menu->addAction(act);
 
-    actionTtile = act = new QAction(tr("&Title"), this);
+    actionTitle = act = new QAction(tr("&Title"), this);
+    menu->addAction(act);
+
+    actionSubtitle = act = new QAction(tr("&Subtitle"), this);
     menu->addAction(act);
 
     actionAuthor = act = new QAction(tr("&Author"), this);
@@ -661,7 +664,7 @@ void Fb2MainWindow::viewText()
     connect(actionImage, SIGNAL(triggered()), textEdit, SLOT(insertImage()));
     connect(actionNote, SIGNAL(triggered()), textEdit, SLOT(insertNote()));
     connect(actionLink, SIGNAL(triggered()), textEdit, SLOT(insertLink()));
-    connect(actionTtile, SIGNAL(triggered()), textEdit, SLOT(insertTitle()));
+    connect(actionTitle, SIGNAL(triggered()), textEdit, SLOT(insertTitle()));
 
     connect(actionZoomIn, SIGNAL(triggered()), textEdit, SLOT(zoomIn()));
     connect(actionZoomOut, SIGNAL(triggered()), textEdit, SLOT(zoomOut()));

+ 2 - 1
source/fb2main.hpp

@@ -107,7 +107,8 @@ private:
         *actionNote,
         *actionLink,
         *actionBody,
-        *actionTtile,
+        *actionTitle,
+        *actionSubtitle,
         *actionDescr,
         *actionPoem,
         *actionStanza,

+ 1 - 0
source/fb2tree.cpp

@@ -36,6 +36,7 @@ Fb2TreeItem::Fb2TreeItem(QWebElement &element, Fb2TreeItem *parent, int number)
         }
         if (!style.isEmpty()) m_name = style;
     } else if (m_name == "img") {
+        m_name = "image";
         QUrl url = element.attribute("src");
         m_text = url.path();
     }

BIN
source/ts/ru.qm


+ 68 - 7
source/ts/ru.ts

@@ -141,6 +141,21 @@
         <translation>Значение</translation>
     </message>
 </context>
+<context>
+    <name>Fb2HeadView</name>
+    <message>
+        <source>&amp;Append</source>
+        <translation type="unfinished">&amp;Добавить</translation>
+    </message>
+    <message>
+        <source>&amp;Modify</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>&amp;Delete</source>
+        <translation type="unfinished">&amp;Удалить</translation>
+    </message>
+</context>
 <context>
     <name>Fb2MainWindow</name>
     <message>
@@ -309,11 +324,11 @@
     </message>
     <message>
         <source>&amp;Append</source>
-        <translation>&amp;Добавить</translation>
+        <translation type="obsolete">&amp;Добавить</translation>
     </message>
     <message>
         <source>&amp;Delete</source>
-        <translation>&amp;Удалить</translation>
+        <translation type="obsolete">&amp;Удалить</translation>
     </message>
     <message>
         <source>&amp;Insert</source>
@@ -414,26 +429,41 @@
     </message>
     <message>
         <source>&amp;Section</source>
-        <translation>Секция &lt;section&gt;</translation>
+        <translation>&amp;Секция &lt;section&gt;</translation>
     </message>
     <message>
         <source>&amp;Title</source>
-        <translation>Заголовок &lt;title&gt;</translation>
+        <translation>&amp;Заголовок &lt;title&gt;</translation>
     </message>
     <message>
         <source>&amp;Author</source>
-        <translation>Автор &lt;author&gt;</translation>
+        <translation>&amp;Автор &lt;author&gt;</translation>
     </message>
     <message>
         <source>&amp;Annotation</source>
-        <translation type="unfinished"></translation>
+        <translation>А&amp;ннотация &lt;annotation&gt;</translation>
     </message>
     <message>
         <source>&amp;Poem</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Поэма  &lt;poem&gt;</translation>
     </message>
     <message>
         <source>&amp;Stanza</source>
+        <translation>С&amp;трофа &lt;stanza&gt;</translation>
+    </message>
+    <message>
+        <source>&amp;Subtitle</source>
+        <translation>По&amp;дзаголовок &lt;subtitle&gt;</translation>
+    </message>
+</context>
+<context>
+    <name>Fb2NodeDlg</name>
+    <message>
+        <source>Insert tag</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tag name:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -482,6 +512,33 @@
         <translation type="unfinished"></translation>
     </message>
 </context>
+<context>
+    <name>Fb2TreeView</name>
+    <message>
+        <source>&amp;Insert</source>
+        <translation type="unfinished">&amp;Вставка</translation>
+    </message>
+    <message>
+        <source>&amp;Delete</source>
+        <translation type="unfinished">&amp;Удалить</translation>
+    </message>
+    <message>
+        <source>&amp;Up</source>
+        <translation type="unfinished">В&amp;верх</translation>
+    </message>
+    <message>
+        <source>&amp;Down</source>
+        <translation type="unfinished">В&amp;низ</translation>
+    </message>
+    <message>
+        <source>&amp;Left</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>&amp;Right</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
 <context>
     <name>Fb2WebView</name>
     <message>
@@ -579,5 +636,9 @@
         <source>Su&amp;bscript</source>
         <translation type="unfinished">&amp;Нижний индекс</translation>
     </message>
+    <message>
+        <source>Unknown image format: %1</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>