Merge pull request #9497 from wwmayer/generate_qm_files

Generate qm files
This commit is contained in:
Chris Hennes
2023-05-10 18:18:25 -05:00
committed by GitHub
766 changed files with 146 additions and 749 deletions

View File

@@ -15,7 +15,7 @@ if(BUILD_GUI)
list (APPEND FREECAD_QT_COMPONENTS WinExtras)
endif()
endif()
list (APPEND FREECAD_QT_COMPONENTS OpenGL PrintSupport Svg UiTools Widgets)
list (APPEND FREECAD_QT_COMPONENTS OpenGL PrintSupport Svg UiTools Widgets LinguistTools)
if (BUILD_WEB)
list (APPEND FREECAD_QT_COMPONENTS WebEngineWidgets)
endif()
@@ -62,4 +62,36 @@ if (Qt${FREECAD_QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 5.15.0)
qt5_wrap_cpp("${outfiles}" ${ARGN})
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
function(qt_add_translation _qm_files)
qt5_add_translation("${_qm_files}" ${ARGN})
set("${_qm_files}" "${${_qm_files}}" PARENT_SCOPE)
endfunction()
endif()
function(qt_find_and_add_translation _qm_files _tr_dir _qm_dir)
file(GLOB _ts_files ${_tr_dir})
set_source_files_properties(${_ts_files} PROPERTIES OUTPUT_LOCATION ${_qm_dir})
qt_add_translation("${_qm_files}" ${_ts_files})
set("${_qm_files}" "${${_qm_files}}" PARENT_SCOPE)
endfunction()
function(qt_create_resource_file outfile)
set(QRC "<RCC>\n <qresource>\n")
foreach (it ${ARGN})
get_filename_component(qmfile "${it}" NAME)
string(APPEND QRC " <file>translations/${qmfile}</file>")
endforeach()
string(APPEND QRC " </qresource>\n</RCC>\n")
file(WRITE ${outfile} ${QRC})
endfunction()
function(qt_create_resource_file_prefix outfile)
set(QRC "<RCC>\n <qresource prefix=\"/translations\">\n")
foreach (it ${ARGN})
get_filename_component(qmfile "${it}" NAME)
string(APPEND QRC " <file>${qmfile}</file>")
endforeach()
string(APPEND QRC " </qresource>\n</RCC>\n")
file(WRITE ${outfile} ${QRC})
endfunction()

View File

@@ -1819,6 +1819,7 @@ static void init_resources()
// init resources
Q_INIT_RESOURCE(resource);
Q_INIT_RESOURCE(translation);
Q_INIT_RESOURCE(FreeCAD_translation);
}
void Application::initApplication()

View File

@@ -351,9 +351,14 @@ SET(Gui_UIC_SRCS
VectorListEditor.ui
)
SET(Gui_RES_SRCS
set (FreeCAD_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Language/FreeCAD_translation.qrc)
qt_find_and_add_translation(QM_SRCS "Language/FreeCAD_*.ts"
${CMAKE_CURRENT_BINARY_DIR}/Language)
qt_create_resource_file_prefix(${FreeCAD_TR_QRC} ${QM_SRCS})
set(Gui_RES_SRCS
Icons/resource.qrc
Language/translation.qrc
${FreeCAD_TR_QRC}
QSint/actionpanel/schemes.qrc
)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -23,48 +23,5 @@
<file>qtbase_sk.qm</file>
<file>qtbase_uk.qm</file>
<file>qtmultimedia_pl.qm</file>
<file>FreeCAD_af.qm</file>
<file>FreeCAD_de.qm</file>
<file>FreeCAD_fi.qm</file>
<file>FreeCAD_fr.qm</file>
<file>FreeCAD_hr.qm</file>
<file>FreeCAD_it.qm</file>
<file>FreeCAD_nl.qm</file>
<file>FreeCAD_no.qm</file>
<file>FreeCAD_pl.qm</file>
<file>FreeCAD_ru.qm</file>
<file>FreeCAD_uk.qm</file>
<file>FreeCAD_tr.qm</file>
<file>FreeCAD_sv-SE.qm</file>
<file>FreeCAD_zh-TW.qm</file>
<file>FreeCAD_pt-BR.qm</file>
<file>FreeCAD_cs.qm</file>
<file>FreeCAD_sk.qm</file>
<file>FreeCAD_es-ES.qm</file>
<file>FreeCAD_zh-CN.qm</file>
<file>FreeCAD_ja.qm</file>
<file>FreeCAD_ro.qm</file>
<file>FreeCAD_hu.qm</file>
<file>FreeCAD_pt-PT.qm</file>
<file>FreeCAD_sr.qm</file>
<file>FreeCAD_el.qm</file>
<file>FreeCAD_sl.qm</file>
<file>FreeCAD_eu.qm</file>
<file>FreeCAD_ca.qm</file>
<file>FreeCAD_gl.qm</file>
<file>FreeCAD_kab.qm</file>
<file>FreeCAD_ko.qm</file>
<file>FreeCAD_fil.qm</file>
<file>FreeCAD_id.qm</file>
<file>FreeCAD_lt.qm</file>
<file>FreeCAD_val-ES.qm</file>
<file>FreeCAD_ar.qm</file>
<file>FreeCAD_vi.qm</file>
<file>FreeCAD_es-AR.qm</file>
<file>FreeCAD_bg.qm</file>
<file>FreeCAD_ka.qm</file>
<file>FreeCAD_sr-CS.qm</file>
<file>FreeCAD_be.qm</file>
</qresource>
</RCC>

View File

@@ -39,6 +39,7 @@ void loadDrawingResource()
{
// add resources and reloads the translators
Q_INIT_RESOURCE(Drawing);
Q_INIT_RESOURCE(Drawing_translation);
Gui::Translator::instance()->refresh();
}

View File

@@ -26,10 +26,16 @@ set(DrawingGui_UIC_SRCS
TaskOrthoViews.ui
)
qt_add_resources(DrawingGui_SRCS Resources/Drawing.qrc)
set (Drawing_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Drawing_translation.qrc)
qt_find_and_add_translation(QM_SRCS "Resources/translations/*_*.ts"
${CMAKE_CURRENT_BINARY_DIR}/Resources/translations)
qt_create_resource_file(${Drawing_TR_QRC} ${QM_SRCS})
qt_add_resources(DrawingGui_SRCS Resources/Drawing.qrc ${Drawing_TR_QRC})
SET(DrawingGui_SRCS
${DrawingGui_SRCS}
${QM_SRCS}
${Drawing_TR_QRC}
AppDrawingGui.cpp
AppDrawingGuiPy.cpp
Command.cpp

View File

@@ -12,11 +12,11 @@
<file>icons/actions/drawing-landscape-A4.svg</file>
<file>icons/actions/drawing-landscape-new.svg</file>
<file>icons/actions/drawing-landscape.svg</file>
<file>icons/actions/drawing-portrait-A0.svg</file>
<file>icons/actions/drawing-portrait-A1.svg</file>
<file>icons/actions/drawing-portrait-A2.svg</file>
<file>icons/actions/drawing-portrait-A3.svg</file>
<file>icons/actions/drawing-portrait-A4.svg</file>
<file>icons/actions/drawing-portrait-A0.svg</file>
<file>icons/actions/drawing-portrait-A1.svg</file>
<file>icons/actions/drawing-portrait-A2.svg</file>
<file>icons/actions/drawing-portrait-A3.svg</file>
<file>icons/actions/drawing-portrait-A4.svg</file>
<file>icons/actions/drawing-view.svg</file>
<file>icons/actions/drawing-orthoviews.svg</file>
<file>icons/actions/drawing-openbrowser.svg</file>
@@ -25,47 +25,5 @@
<file>icons/actions/drawing-symbol.svg</file>
<file>icons/actions/drawing-draft-view.svg</file>
<file>icons/actions/drawing-spreadsheet.svg</file>
<file>translations/Drawing_af.qm</file>
<file>translations/Drawing_de.qm</file>
<file>translations/Drawing_fi.qm</file>
<file>translations/Drawing_fr.qm</file>
<file>translations/Drawing_hr.qm</file>
<file>translations/Drawing_it.qm</file>
<file>translations/Drawing_nl.qm</file>
<file>translations/Drawing_no.qm</file>
<file>translations/Drawing_pl.qm</file>
<file>translations/Drawing_ru.qm</file>
<file>translations/Drawing_uk.qm</file>
<file>translations/Drawing_tr.qm</file>
<file>translations/Drawing_sv-SE.qm</file>
<file>translations/Drawing_zh-TW.qm</file>
<file>translations/Drawing_pt-BR.qm</file>
<file>translations/Drawing_cs.qm</file>
<file>translations/Drawing_sk.qm</file>
<file>translations/Drawing_es-ES.qm</file>
<file>translations/Drawing_zh-CN.qm</file>
<file>translations/Drawing_ja.qm</file>
<file>translations/Drawing_ro.qm</file>
<file>translations/Drawing_hu.qm</file>
<file>translations/Drawing_pt-PT.qm</file>
<file>translations/Drawing_sr.qm</file>
<file>translations/Drawing_el.qm</file>
<file>translations/Drawing_sl.qm</file>
<file>translations/Drawing_eu.qm</file>
<file>translations/Drawing_ca.qm</file>
<file>translations/Drawing_gl.qm</file>
<file>translations/Drawing_kab.qm</file>
<file>translations/Drawing_ko.qm</file>
<file>translations/Drawing_fil.qm</file>
<file>translations/Drawing_id.qm</file>
<file>translations/Drawing_lt.qm</file>
<file>translations/Drawing_val-ES.qm</file>
<file>translations/Drawing_ar.qm</file>
<file>translations/Drawing_vi.qm</file>
<file>translations/Drawing_es-AR.qm</file>
<file>translations/Drawing_bg.qm</file>
<file>translations/Drawing_ka.qm</file>
<file>translations/Drawing_sr-CS.qm</file>
<file>translations/Drawing_be.qm</file>
</qresource>
</RCC>

View File

@@ -82,6 +82,7 @@ void loadFemResource()
{
// add resources and reloads the translators
Q_INIT_RESOURCE(Fem);
Q_INIT_RESOURCE(Fem_translation);
Gui::Translator::instance()->refresh();
}

View File

@@ -186,7 +186,11 @@ SET(FemGui_DLG_SRCS
)
SOURCE_GROUP("Constraint-Dialogs" FILES ${FemGui_DLG_SRCS})
qt_add_resources(FemResource_SRCS Resources/Fem.qrc)
set (Fem_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Fem_translation.qrc)
qt_find_and_add_translation(QM_SRCS "Resources/translations/*_*.ts"
${CMAKE_CURRENT_BINARY_DIR}/Resources/translations)
qt_create_resource_file(${Fem_TR_QRC} ${QM_SRCS})
qt_add_resources(FemResource_SRCS Resources/Fem.qrc ${Fem_TR_QRC})
SOURCE_GROUP("Resources" FILES ${FemResource_SRCS})

View File

@@ -115,50 +115,6 @@
<file>icons/fem-add-material.svg</file>
<file>icons/fem-add-part.svg</file>
<!-- translations -->
<file>translations/Fem_af.qm</file>
<file>translations/Fem_ar.qm</file>
<file>translations/Fem_bg.qm</file>
<file>translations/Fem_ca.qm</file>
<file>translations/Fem_cs.qm</file>
<file>translations/Fem_de.qm</file>
<file>translations/Fem_el.qm</file>
<file>translations/Fem_es-AR.qm</file>
<file>translations/Fem_es-ES.qm</file>
<file>translations/Fem_eu.qm</file>
<file>translations/Fem_fi.qm</file>
<file>translations/Fem_fil.qm</file>
<file>translations/Fem_fr.qm</file>
<file>translations/Fem_gl.qm</file>
<file>translations/Fem_hr.qm</file>
<file>translations/Fem_hu.qm</file>
<file>translations/Fem_id.qm</file>
<file>translations/Fem_it.qm</file>
<file>translations/Fem_ja.qm</file>
<file>translations/Fem_ka.qm</file>
<file>translations/Fem_kab.qm</file>
<file>translations/Fem_ko.qm</file>
<file>translations/Fem_lt.qm</file>
<file>translations/Fem_nl.qm</file>
<file>translations/Fem_no.qm</file>
<file>translations/Fem_pl.qm</file>
<file>translations/Fem_pt-BR.qm</file>
<file>translations/Fem_pt-PT.qm</file>
<file>translations/Fem_ro.qm</file>
<file>translations/Fem_ru.qm</file>
<file>translations/Fem_sk.qm</file>
<file>translations/Fem_sl.qm</file>
<file>translations/Fem_sr.qm</file>
<file>translations/Fem_sv-SE.qm</file>
<file>translations/Fem_tr.qm</file>
<file>translations/Fem_uk.qm</file>
<file>translations/Fem_val-ES.qm</file>
<file>translations/Fem_vi.qm</file>
<file>translations/Fem_zh-CN.qm</file>
<file>translations/Fem_zh-TW.qm</file>
<file>translations/Fem_sr-CS.qm</file>
<file>translations/Fem_be.qm</file>
<!-- task panels -->
<file>ui/BodyHeatSource.ui</file>
<file>ui/ConstraintCentrif.ui</file>

Some files were not shown because too many files have changed in this diff Show More