2 * Copyright (C) 2014-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "addons/Resource.h"
12 #include "utils/Locale.h"
18 class CLanguageResource
: public CResource
21 explicit CLanguageResource(const AddonInfoPtr
& addonInfo
);
23 bool IsInUse() const override
;
25 void OnPostInstall(bool update
, bool modal
) override
;
27 bool IsAllowed(const std::string
&file
) const override
;
29 const CLocale
& GetLocale() const { return m_locale
; }
31 const std::string
& GetGuiCharset() const { return m_charsetGui
; }
32 bool ForceUnicodeFont() const { return m_forceUnicodeFont
; }
33 const std::string
& GetSubtitleCharset() const { return m_charsetSubtitle
; }
35 const std::string
& GetDvdMenuLanguage() const { return m_dvdLanguageMenu
; }
36 const std::string
& GetDvdAudioLanguage() const { return m_dvdLanguageAudio
; }
37 const std::string
& GetDvdSubtitleLanguage() const { return m_dvdLanguageSubtitle
; }
39 const std::set
<std::string
>& GetSortTokens() const { return m_sortTokens
; }
41 static std::string
GetAddonId(const std::string
& locale
);
43 static bool FindLegacyLanguage(const std::string
&locale
, std::string
&legacyLanguage
);
48 std::string m_charsetGui
;
49 bool m_forceUnicodeFont
;
50 std::string m_charsetSubtitle
;
52 std::string m_dvdLanguageMenu
;
53 std::string m_dvdLanguageAudio
;
54 std::string m_dvdLanguageSubtitle
;
56 std::set
<std::string
> m_sortTokens
;