translations.pro 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #############################################################################
  2. # translations.pro - QStarDict, a StarDict clone written with using Qt #
  3. # Copyright (C) 2008-2019 Alexander Rodin #
  4. # #
  5. # This program is free software; you can redistribute it and/or modify #
  6. # it under the terms of the GNU General Public License as published by #
  7. # the Free Software Foundation; either version 2 of the License, or #
  8. # (at your option) any later version. #
  9. # #
  10. # This program is distributed in the hope that it will be useful, #
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  13. # GNU General Public License for more details. #
  14. # #
  15. # You should have received a copy of the GNU General Public License along #
  16. # with this program; if not, write to the Free Software Foundation, Inc., #
  17. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
  18. #############################################################################
  19. TEMPLATE = aux
  20. include(../qstardict.pri)
  21. include(translations.pri)
  22. # from https://github.com/Arora/arora/blob/e310d632e9f6c135c376576d2d466af03fd219ee/src/locale/locale.pri
  23. isEmpty(QMAKE_LRELEASE) {
  24. win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
  25. else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
  26. unix {
  27. !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
  28. } else {
  29. !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
  30. }
  31. }
  32. # from https://github.com/Arora/arora/blob/e310d632e9f6c135c376576d2d466af03fd219ee/src/locale/locale.pri
  33. updateqm.input = TRANSLATIONS
  34. updateqm.output = $$TRANSLATIONS_SRC_DIR/${QMAKE_FILE_BASE}.qm
  35. updateqm.commands = $$QMAKE_LRELEASE -silent ${QMAKE_FILE_IN} -qm $$TRANSLATIONS_SRC_DIR/${QMAKE_FILE_BASE}.qm
  36. updateqm.CONFIG += no_link target_predeps
  37. QMAKE_EXTRA_COMPILERS += updateqm
  38. isEmpty(NO_TRANSLATIONS) {
  39. translations.CONFIG += no_check_exist
  40. for(t, TRANSLATIONS) {
  41. t ~= "s/^(.+).ts$/\\1.qm"
  42. translations.files += $$t
  43. DISTFILES += $$t # For what?
  44. }
  45. translations.path = $$TRANSLATIONS_DIR
  46. INSTALLS += translations
  47. }