diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-19 08:48:05 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-19 21:29:44 (GMT) |
commit | b1836ffb49bd7740dbd7c32bfad04d077e81ecb5 (patch) | |
tree | 9d0d9b3fad9c2bbd0192696d59e08477b8c22c10 /Swift/QtUI/SConscript | |
parent | 2f6c2299c28c9bb03ee1437058a4c7071ff2ac3f (diff) | |
download | swift-contrib-b1836ffb49bd7740dbd7c32bfad04d077e81ecb5.zip swift-contrib-b1836ffb49bd7740dbd7c32bfad04d077e81ecb5.tar.bz2 |
Make Swift translatable.
Diffstat (limited to 'Swift/QtUI/SConscript')
-rw-r--r-- | Swift/QtUI/SConscript | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 6238693..e52d76a 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -155,7 +155,24 @@ myenv.Uic4("QtJoinMUCWindow.ui") myenv.Qrc("DefaultTheme.qrc") myenv.Qrc("Swift.qrc") -commonResources = ["../resources/sounds"] +# Resources +commonResources = { + "": ["../resources/sounds"] +} + +# Translation +translation_sources = [env.File("../Translations/Swift.ts").abspath] +for file in os.listdir(Dir("../Translations").abspath) : + if file.startswith("Swift_") and file.endswith(".ts") : + lang = file[6:-3] + translation_resource = "../resources/translations/Swift_" + lang + ".qm" + translation_source = "../Translations/Swift_" + lang + ".ts" + translation_sources.append(env.File(translation_source).abspath) + myenv.Qm(translation_resource, translation_source) + commonResources["translations"] = commonResources.get("translations", []) + [translation_resource] +if ARGUMENTS.get("update_translations", False) : + t = myenv.Command(translation_sources, [], [myenv.Action("$QT4_LUPDATE -I " + env.Dir("#").abspath + " -silent -codecfortr utf-8 -recursive Swift -ts " + " ".join(translation_sources), cmdstr = "$QT4_LUPDATECOMSTR")]) + myenv.AlwaysBuild(t) if env["PLATFORM"] == "darwin" : frameworks = [] @@ -163,7 +180,8 @@ if env["PLATFORM"] == "darwin" : frameworks.append(env["SPARKLE_FRAMEWORK"]) if env["HAVE_GROWL"] : frameworks.append(env["GROWL_FRAMEWORK"]) - app = myenv.AppBundle("Swift", version = myenv["SWIFT_VERSION"], resources = ["../resources/MacOSX/Swift.icns"] + commonResources, frameworks = frameworks) + commonResources[""] = commonResources.get("", []) + ["../resources/MacOSX/Swift.icns"] + app = myenv.AppBundle("Swift", version = myenv["SWIFT_VERSION"], resources = commonResources, frameworks = frameworks) if env["DIST"] : myenv.Command(["Swift-${SWIFT_VERSION}.dmg"], [app], ["Swift/Packaging/MacOSX/package.sh " + app.path + " Swift/Packaging/MacOSX/Swift.dmg.gz $TARGET $QTDIR"]) @@ -171,15 +189,18 @@ if env.get("SWIFT_INSTALLDIR", "") : env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "bin"), swiftProgram) env.InstallAs(os.path.join(env["SWIFT_INSTALLDIR"], "share", "pixmaps", "swift.xpm"), "../resources/logo/logo-icon-32.xpm") env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "share", "applications"), "../resources/swift.desktop") - for resource in commonResources : - env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "share", "swift"), resource) + for dir, resource in commonResources.items() : + env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "share", "swift", dir), resource) if env["PLATFORM"] == "win32" : if env["DIST"] : - myenv.WindowsBundle("Swift", resources = [ + commonResources[""] = commonResources.get("", []) + [ os.path.join(env["OPENSSL_DIR"], "bin", "ssleay32.dll"), os.path.join(env["OPENSSL_DIR"], "bin", "libeay32.dll"), - ] + commonResources + ["../resources/images"], + "../resources/images", + ] + myenv.WindowsBundle("Swift", + resources = commonResources, qtimageformats = ["gif", "ico", "jpeg", "mng", "svg", "tiff"], qtlibs = ["QtCore4", "QtGui4", "QtNetwork4", "QtWebKit4", "QtXMLPatterns4", "phonon4"]) |