Skip to content

Commit

Permalink
Inserts setting for current language.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikskuh committed Mar 17, 2021
1 parent 33f6279 commit da83396
Show file tree
Hide file tree
Showing 5 changed files with 314 additions and 25 deletions.
2 changes: 2 additions & 0 deletions src/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,7 @@
<file>icons/dark/actions/go-up-search.svg</file>
<file>icons/light/actions/go-down-search.svg</file>
<file>icons/light/actions/go-up-search.svg</file>
<file>icons/languages/en.svg</file>
<file>icons/languages/ru.svg</file>
</qresource>
</RCC>
228 changes: 228 additions & 0 deletions src/icons/languages/en.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/icons/languages/ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion src/kristall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <QSettings>
#include <QClipboard>
#include <QSslCertificate>
#include <QTranslator>
#include <QLocale>

#include "identitycollection.hpp"
#include "ssltrust.hpp"
Expand Down Expand Up @@ -164,9 +166,15 @@ namespace kristall
QDir styles;
};

struct Globals
struct Localization
{
QLocale locale;
QTranslator qt;
QTranslator kristall;
};

struct Globals
{
ProtocolSetup protocols;

QSettings * settings;
Expand All @@ -182,6 +190,8 @@ namespace kristall
Trust trust;

Dirs dirs;

Localization localization;
};

//! returns the instance of the globals structure
Expand Down Expand Up @@ -222,6 +232,12 @@ namespace kristall

//! Saves the current session including all windows, tabs and positions.
void saveSession();

//! Changes the currently used locale
void setLocale(QLocale const & locale);

//! Saves the currently used locale
void saveLocale();
}

#endif // KRISTALL_HPP
Loading

0 comments on commit da83396

Please sign in to comment.