Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Fallback to enUS for enGB
Browse files Browse the repository at this point in the history
  • Loading branch information
stevschmid committed Dec 27, 2017
1 parent 3604aa8 commit 48f205d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/HearthstoneCardDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,24 @@ QString HearthstoneCardDB::Type( const QString& id ) const {
return mCards[ id ][ "type" ].toString();
}

QString LocaleForCardDB() {
QString locale = Hearthstone::Instance()->DetectLocale();
if( locale == "enGB" ) {
locale = "enUS";
}
return locale;
}

QString HearthstoneCardDB::CardsJsonLocalPath() {
int build = Hearthstone::Instance()->DetectBuild();
QString locale = Hearthstone::Instance()->DetectLocale();
QString locale = LocaleForCardDB();
QString appDataLocation = QStandardPaths::standardLocations( QStandardPaths::AppDataLocation ).first();
return QString( "%1/cards_%2_%3.json" ).arg( appDataLocation ).arg( build ).arg( locale );
}

QString HearthstoneCardDB::CardsJsonRemoteUrl() {
int build = Hearthstone::Instance()->DetectBuild();
QString locale = Hearthstone::Instance()->DetectLocale();
QString locale = LocaleForCardDB();
return QString( "%1/%2/%3/cards.json" ).arg( HEARTHSTONE_JSON_API_URL ).arg( build ).arg( locale );
}

Expand Down

0 comments on commit 48f205d

Please sign in to comment.