#!/usr/bin/python3
# KWipe.py
#
# Copyright (C) 2012 - 2019 Fabian Di Milia, All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): Fabian Di Milia <fabian.dimilia@gmail.com>

from PyQt5 import QtCore, QtWidgets
from main import KWipe
import sys

def loadLang():
     _kwipe_trans = QtCore.QTranslator()
     #_qt_trans = QtCore.QTranslator()
     #_kwipe_trans.load(QtCore.QLocale.system().name() + '.qm', '../share/lang')
     _kwipe_trans.load(QtCore.QLocale.system().name() + '.qm', '../lang')
     print("KWiper LANG="+QtCore.QLocale.system().name()+ '.qm')
     #_qt_trans.load('qt_' + QtCore.QLocale.system().name(), QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath))
     #return _kwipe_trans, _qt_trans
     return _kwipe_trans

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    #kwipe_trans, qt_trans = loadLang()
    kwipe_trans = loadLang()
    app.installTranslator(kwipe_trans)
    #app.installTranslator(qt_trans)
    main = KWipe()
    main.show()
    sys.exit(app.exec_())
