Python-i18n: add a gettext_path for python job modules

This commit is contained in:
Adriaan de Groot 2017-08-10 10:43:49 -04:00
parent 9f5ff55ba2
commit b922d88b0f
6 changed files with 80 additions and 13 deletions

View file

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -177,10 +178,19 @@ debug( const std::string& s )
PythonJobInterface::PythonJobInterface( Calamares::PythonJob* parent )
: m_parent( parent )
{
moduleName = QDir( m_parent->m_workingPath ).dirName().toStdString();
auto moduleDir = QDir( m_parent->m_workingPath );
moduleName = moduleDir.dirName().toStdString();
prettyName = m_parent->prettyName().toStdString();
workingPath = m_parent->m_workingPath.toStdString();
configuration = CalamaresPython::variantMapToPyDict( m_parent->m_configurationMap );
if (moduleDir.cd("../_lang/python"))
gettextPath = moduleDir.absolutePath().toStdString();
else
{
debug( "No _lang/ directory for translations." );
gettextPath = std::string();
}
}