Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2782 from ace20022/subs_kai_toast

[GUI/Player] Proper subtitle lang-name string for kai toast
  • Loading branch information...
commit 629b5c491c89e9e6757a2c88d00e50c2c0650ba1 2 parents 2ccc82c + 9b57e2c
@elupus elupus authored
Showing with 15 additions and 6 deletions.
  1. +15 −6 xbmc/video/PlayerController.cpp
View
21 xbmc/video/PlayerController.cpp
@@ -35,6 +35,7 @@
#include "cores/VideoRenderers/RenderManager.h"
#endif
#include "Application.h"
+#include "utils/LangCodeExpander.h"
CPlayerController::CPlayerController()
{
@@ -64,9 +65,13 @@ bool CPlayerController::OnAction(const CAction &action)
{
SPlayerSubtitleStreamInfo info;
g_application.m_pPlayer->GetSubtitleStreamInfo(g_application.m_pPlayer->GetSubtitle(), info);
- sub = info.name;
- if (sub != info.language)
- sub.Format("%s [%s]", sub.c_str(), info.language.c_str());
+ if (!g_LangCodeExpander.Lookup(lang, info.language))
+ lang = g_localizeStrings.Get(13205); // Unknown
+
+ if (info.name.length() == 0)
+ sub = lang;
+ else
+ sub.Format("%s - %s", lang.c_str(), info.name.c_str());
}
else
sub = g_localizeStrings.Get(1223);
@@ -105,9 +110,13 @@ bool CPlayerController::OnAction(const CAction &action)
{
SPlayerSubtitleStreamInfo info;
g_application.m_pPlayer->GetSubtitleStreamInfo(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream, info);
- sub = info.name;
- if (sub != info.language)
- sub.Format("%s [%s]", sub.c_str(), info.language.c_str());
+ if (!g_LangCodeExpander.Lookup(lang, info.language))
+ lang = g_localizeStrings.Get(13205); // Unknown
+
+ if (info.name.length() == 0)
+ sub = lang;
+ else
+ sub.Format("%s - %s", lang.c_str(), info.name.c_str());
}
else
sub = g_localizeStrings.Get(1223);
Please sign in to comment.
Something went wrong with that request. Please try again.