Browse Source

fixed settings generator

pull/2/head
Skycoder42 7 years ago
parent
commit
890234e2a7
  1. 3
      .gitignore
  2. 2
      bin/qsettingstranslator.py
  3. 5
      examples/mvvmcore/SampleCore/SampleCore.pro
  4. 5
      mkspecs/features/qsettingstranslator.prf
  5. 18
      src/mvvmcore/translations/qtmvvmcore_de.ts
  6. 18
      src/mvvmcore/translations/qtmvvmcore_template.ts
  7. 4
      src/mvvmwidgets/translations/qtmvvmwidgets_de.ts
  8. 4
      src/mvvmwidgets/translations/qtmvvmwidgets_template.ts

3
.gitignore

@ -74,3 +74,6 @@ Thumbs.db
# qpmx
vendor
qpmx.user.json
# ts dummy dirs
.ts-dummy

2
bin/qsettingstranslator.py

@ -34,5 +34,5 @@ with open(outfile, "w") as file:
for string in strings:
string = string.replace("\\", "\\\\")
string = string.replace("\"", "\\\"")
file.write("\tQCoreApplication::translate(\"{}\", \"{}\");\n".format(os.path.basename(infile), string))
file.write("\tQCoreApplication::translate(\"qtmvvm_settings_xml\", \"{}\");\n".format(string))
file.write("}\n")

5
examples/mvvmcore/SampleCore/SampleCore.pro

@ -26,6 +26,11 @@ RESOURCES += \
sample_core.qrc
QTMVVM_TS_SETTINGS += settings.xml
_never_true_condition: SOURCES += $$files($$PWD/.ts-dummy/*) #TODO document
PRE_TARGETDEPS += qtmvvm-tsgen
TRANSLATIONS += samplecore_de.ts
DISTFILES += $$TRANSLATIONS
target.path = $$[QT_INSTALL_EXAMPLES]/mvvmcore/$$TARGET
INSTALLS += target

5
mkspecs/features/qsettingstranslator.prf

@ -1,5 +1,5 @@
isEmpty(QMAKE_QSETTINGSTRANSLATOR): qtPrepareTool(QMAKE_QSETTINGSTRANSLATOR, qsettingstranslator.py)
isEmpty(QSETTINGSTRANSLATOR_DIR): QSETTINGSTRANSLATOR_DIR = ./.ts-dummy
isEmpty(QSETTINGSTRANSLATOR_DIR): QSETTINGSTRANSLATOR_DIR = $$_PRO_FILE_PWD_/.ts-dummy
!ReleaseBuild:!DebugBuild: {
qsettingstranslator_c.name = QSETTINGSTRANSLATOR of ${QMAKE_FILE_IN}
@ -14,10 +14,9 @@ isEmpty(QSETTINGSTRANSLATOR_DIR): QSETTINGSTRANSLATOR_DIR = ./.ts-dummy
qtmvvm_tsgen_target.target = qtmvvm-tsgen
qtmvvm_tsgen_target.depends += compiler_qsettingstranslator_c_make_all
qtmvvm_tsgen_target.commands += @echo $$shell_quote(>>> Remember to add the line \"_never_true_condition: SOURCES += $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}files($${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/.ts-dummy/*)\" to your pro file)
QMAKE_EXTRA_TARGETS += qtmvvm_tsgen_target
}
QMAKE_DIR_REPLACE += QSETTINGSTRANSLATOR_DIR
QMAKE_DIR_REPLACE_SANE += QSETTINGSTRANSLATOR_DIR
_never_true_condition: SOURCES += $$files($$TRANSLATIONS_DIR/*.tsdummy$${first(QMAKE_EXT_CPP)})

18
src/mvvmcore/translations/qtmvvmcore_de.ts

@ -39,6 +39,24 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QtMvvm::CoreApp</name>
<message>
<location filename="../coreapp.cpp" line="+107"/>
<source>Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Application Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Invalid Arguments</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QtMvvm::SettingsSetupLoader</name>
<message>

18
src/mvvmcore/translations/qtmvvmcore_template.ts

@ -39,6 +39,24 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QtMvvm::CoreApp</name>
<message>
<location filename="../coreapp.cpp" line="+107"/>
<source>Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Application Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Invalid Arguments</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QtMvvm::SettingsSetupLoader</name>
<message>

4
src/mvvmwidgets/translations/qtmvvmwidgets_de.ts

@ -4,7 +4,7 @@
<context>
<name>QtMvvm::SettingsDialogPrivate</name>
<message>
<location filename="../settingsdialog.cpp" line="+221"/>
<location filename="../settingsdialog.cpp" line="+208"/>
<source>:</source>
<translation type="unfinished"></translation>
</message>
@ -12,7 +12,7 @@
<context>
<name>QtMvvm::WidgetsPresenter</name>
<message>
<location filename="../widgetspresenter.cpp" line="+214"/>
<location filename="../widgetspresenter.cpp" line="+234"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>

4
src/mvvmwidgets/translations/qtmvvmwidgets_template.ts

@ -4,7 +4,7 @@
<context>
<name>QtMvvm::SettingsDialogPrivate</name>
<message>
<location filename="../settingsdialog.cpp" line="+221"/>
<location filename="../settingsdialog.cpp" line="+208"/>
<source>:</source>
<translation type="unfinished"></translation>
</message>
@ -12,7 +12,7 @@
<context>
<name>QtMvvm::WidgetsPresenter</name>
<message>
<location filename="../widgetspresenter.cpp" line="+214"/>
<location filename="../widgetspresenter.cpp" line="+234"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>

Loading…
Cancel
Save