فهرست منبع

Translations was added

Denis V. Dedkov 2 سال پیش
والد
کامیت
4d02662034
3فایلهای تغییر یافته به همراه36 افزوده شده و 24 حذف شده
  1. 7 5
      CMakeLists.txt
  2. 29 17
      beerlog_ru_RU.ts
  3. 0 2
      qml/qml.qrc

+ 7 - 5
CMakeLists.txt

@@ -37,19 +37,16 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
         MANUAL_FINALIZATION
         ${PROJECT_SOURCES}
     )
-# Define target properties for Android with Qt 6 as:
     set_property(TARGET beerlog APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
                  ${CMAKE_CURRENT_SOURCE_DIR}/android)
-# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
 
-    qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
+    qt6_add_translations(beerlog TS_FILES ${TS_FILES})
 else()
     if(ANDROID)
         add_library(beerlog SHARED
             ${PROJECT_SOURCES}
         )
-# Define properties for Android with Qt 5 after find_package() calls as:
-#    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
+    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
     else()
         add_executable(beerlog
           ${PROJECT_SOURCES}
@@ -59,6 +56,7 @@ else()
     qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
 endif()
 
+
 target_link_libraries(beerlog
   PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::WebSockets)
 
@@ -70,6 +68,10 @@ set_target_properties(beerlog PROPERTIES
     WIN32_EXECUTABLE TRUE
 )
 
+install(TARGETS beerlog
+    BUNDLE DESTINATION .
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
 if(QT_VERSION_MAJOR EQUAL 6)
     qt_import_qml_plugins(beerlog)
     qt_finalize_executable(beerlog)

+ 29 - 17
beerlog_ru_RU.ts

@@ -17,41 +17,54 @@
 <context>
     <name>OrdersView</name>
     <message>
-        <location filename="qml/Views/OrdersView.qml" line="56"/>
+        <location filename="qml/Views/OrdersView.qml" line="9"/>
+        <source>Orders</source>
+        <translation>Заказы</translation>
+    </message>
+    <message>
+        <location filename="qml/Views/OrdersView.qml" line="58"/>
         <source>Summary: %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Итого: %1</translation>
     </message>
 </context>
 <context>
     <name>ProductsView</name>
     <message>
-        <location filename="qml/Views/ProductsView.qml" line="88"/>
+        <location filename="qml/Views/ProductsView.qml" line="87"/>
         <source>Summary: %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Итого: %1</translation>
     </message>
     <message>
-        <location filename="qml/Views/ProductsView.qml" line="95"/>
+        <location filename="qml/Views/ProductsView.qml" line="94"/>
         <source>Order</source>
-        <translation type="unfinished"></translation>
+        <translation>Заказать</translation>
     </message>
 </context>
 <context>
     <name>SettingsView</name>
     <message>
-        <location filename="qml/Views/SettingsView.qml" line="8"/>
+        <location filename="qml/Views/SettingsView.qml" line="9"/>
         <source>Settings</source>
         <translation>Настройки</translation>
     </message>
+</context>
+<context>
+    <name>SettingsViewModel</name>
     <message>
-        <location filename="qml/Views/SettingsView.qml" line="14"/>
+        <location filename="viewmodels/settingsviewmodel.cpp" line="11"/>
         <source>BeerLog service address</source>
         <translation>Адрес сервиса BeerLog</translation>
     </message>
     <message>
-        <location filename="qml/Views/SettingsView.qml" line="19"/>
+        <location filename="viewmodels/settingsviewmodel.cpp" line="12"/>
         <source>Selected user id</source>
         <translation>Выбранный пользователь</translation>
     </message>
+    <message>
+        <location filename="viewmodels/settingsviewmodel.cpp" line="13"/>
+        <source>Selected store</source>
+        <translation>Выбранный магазин</translation>
+    </message>
 </context>
 <context>
     <name>main</name>
@@ -61,29 +74,28 @@
         <translation></translation>
     </message>
     <message>
-        <location filename="qml/main.qml" line="73"/>
+        <location filename="qml/main.qml" line="91"/>
         <source>BeerLog v0.1</source>
-        <oldsource>BeerLog v1.0.0</oldsource>
         <translation></translation>
     </message>
     <message>
-        <location filename="qml/main.qml" line="78"/>
+        <location filename="qml/main.qml" line="96"/>
         <source>Orders</source>
-        <translation type="unfinished"></translation>
+        <translation>Заказы</translation>
     </message>
     <message>
-        <location filename="qml/main.qml" line="82"/>
+        <location filename="qml/main.qml" line="100"/>
         <source>Settings</source>
         <translation>Настройки</translation>
     </message>
     <message>
-        <location filename="qml/main.qml" line="86"/>
-        <location filename="qml/main.qml" line="122"/>
+        <location filename="qml/main.qml" line="104"/>
+        <location filename="qml/main.qml" line="140"/>
         <source>Quit</source>
         <translation>Выход</translation>
     </message>
     <message>
-        <location filename="qml/main.qml" line="126"/>
+        <location filename="qml/main.qml" line="144"/>
         <source>Realy quit the application?</source>
         <translation>Действительно выйти из приложения?</translation>
     </message>

+ 0 - 2
qml/qml.qrc

@@ -4,13 +4,11 @@
         <file>Components/MenuBackButton.qml</file>
         <file>qtquickcontrols2.conf</file>
         <file>logo.png</file>
-        <file>beerlog_ru_RU.qm</file>
         <file>Components/MainMenu.qml</file>
         <file>Views/OrdersView.qml</file>
         <file>Views/SettingsView.qml</file>
         <file>Components/SubtitledItemDelegate.qml</file>
         <file>Components/qmldir</file>
-        <file>qt_ru.qm</file>
         <file>Views/ProductsView.qml</file>
     </qresource>
 </RCC>