Sayonara Player
LanguageUtils.h
1 /* LanguageUtils.h */
2 
3 /* Copyright (C) 2011-2019 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef LANGUAGEUTILS_H
24 #define LANGUAGEUTILS_H
25 
26 class QString;
27 template<typename A, typename B>
28 class QMap;
29 
30 namespace Util
31 {
36  namespace Language
37  {
44  QString get_share_path(const QString& four_letter);
45 
52  QString get_ftp_path(const QString& four_letter);
53 
60  QString get_http_path(const QString& four_letter);
61 
67  QString get_checksum_ftp_path();
68 
74  QString get_checksum_http_path();
75 
82  QString get_home_target_path(const QString& four_letter);
83 
91  QString get_used_language_file(const QString& four_letter);
92 
99  QString get_icon_path(const QString& four_letter);
100 
107  QString extract_four_letter(const QString& language_file);
108 
116  QString get_checksum(const QString& four_letter);
117 
125  QString get_language_version(const QString& four_letter);
126 
133  void update_language_version(const QString& four_letter);
134 
142  bool is_outdated(const QString& four_letter);
143 
151  QString get_similar_language_4(const QString& four_letter);
152 
153  #ifdef DEBUG
154  void set_test_mode();
155  void set_language_version(const QString& four_letter, const QString& version);
156  #endif
157  }
158 }
159 
160 #endif // LANGUAGEUTILS_H
Util::Language::get_checksum_ftp_path
QString get_checksum_ftp_path()
Returns the path where checksums can be fetched from.
Util::Language::update_language_version
void update_language_version(const QString &four_letter)
Update language version in translations/versions file to current Sayonara Version.
Util::Language::get_language_version
QString get_language_version(const QString &four_letter)
Get the language version out of translations/versions file in home dir.
Util::Language::get_checksum_http_path
QString get_checksum_http_path()
Returns the path where checksums can be fetched from.
Util::Language::extract_four_letter
QString extract_four_letter(const QString &language_file)
Extracts the language Code out of a sayonara_lang string.
Util::Language::get_icon_path
QString get_icon_path(const QString &four_letter)
Returns the icon path in share directory.
QMap
Definition: org_mpris_media_player2_adaptor.h:21
Util::Language::get_used_language_file
QString get_used_language_file(const QString &four_letter)
Returns the correct language file either from share dir or home dir.
Util
Helper functions.
Definition: GenreView.h:35
Util::Language::get_similar_language_4
QString get_similar_language_4(const QString &four_letter)
get_similar_language_4
Util::Language::is_outdated
bool is_outdated(const QString &four_letter)
Returns if the language version in translations/versions file is smaller than the current sayonara ve...
Util::Language::get_checksum
QString get_checksum(const QString &four_letter)
calculates the checksum for the currently used language file (either home or share directory)
Util::Language::get_ftp_path
QString get_ftp_path(const QString &four_letter)
get the complete path to a language file out of the ftp directory
Util::Language::get_share_path
QString get_share_path(const QString &four_letter)
get the complete path to a language file out of the share directory
Util::Language::get_home_target_path
QString get_home_target_path(const QString &four_letter)
get_home_target_path
Util::Language::get_http_path
QString get_http_path(const QString &four_letter)
get the complete http url to a language file