Skip to content

Commit

Permalink
[feature] i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh committed Sep 4, 2019
1 parent 52078c1 commit 1c419de
Show file tree
Hide file tree
Showing 16 changed files with 2,082 additions and 38 deletions.
22 changes: 22 additions & 0 deletions fu.pro
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ TRANSLATIONS = \
i18n/fu.zh_cn.ts \
i18n/fu.en_us.ts

TRANSLATIONS_FILES =
LANGS =
qtPrepareTool(LRELEASE, lrelease)
for(tsfile, TRANSLATIONS) {
qmfile = $$shadowed($$tsfile)
qmfile ~= s,.ts$,.qm,
qmdir = $$dirname(qmfile)
LANGS = $$LANGS,$$basename(qmfile)
!exists($$qmdir) {
mkpath($$qmdir)|error("Aborting.")
}
command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile
system($$command)|error("Failed to run: $$command")
TRANSLATIONS_FILES += $$qmfile
}

DEFINES += LANGS=\\\"$${LANGS}\\\"
message($$LANGS)
CONFIG(release, debug|release) {
BUILD = release
}
Expand All @@ -133,6 +151,10 @@ win32 {
dlls.path = $$DESTDIR
dlls.files = $$DEPSDIR/bin/*.dll
INSTALLS += dlls

langs.path = $$DESTDIR/i18n
langs.files = $$qmdir/*.qm
INSTALLS += langs
}

unix {
Expand Down
Loading

0 comments on commit 1c419de

Please sign in to comment.