Skip to content

Commit

Permalink
Create translations at configure time
Browse files Browse the repository at this point in the history
  • Loading branch information
Gelmir committed Jan 15, 2013
1 parent 687d192 commit 92e24e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions qbittorrent.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TEMPLATE = subdirs
SUBDIRS += src

include(version.pri)
include(qm_gen.pri)

# Dist
dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/ &&
Expand Down
19 changes: 19 additions & 0 deletions qm_gen.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
TS_IN = $$fromfile(src/src.pro,TRANSLATIONS)
TS_IN_NOEXT = $$replace(TS_IN,".ts","")

isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}

message("Building translations")
for(L,TS_IN_NOEXT) {
message("Processing $${L}")
system("$$QMAKE_LRELEASE -silent src/$${L}.ts -qm src/$${L}.qm")
!exists("src/$${L}.qm"):error("Building translations failed, cannot continue")
}

0 comments on commit 92e24e3

Please sign in to comment.