Skip to content

Commit

Permalink
fix link to actor in wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusEh authored Jan 10, 2024
1 parent bdb9364 commit af40f42
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pages/pageelems.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ std::string toString(const std::vector<cActor> &vec) {
}
return result;
}
bool getLanguage(std::string &language, const char *env_name) {
const char *env_language = std::getenv(env_name);
bool found = env_language && strlen(env_language) >= 2;
if (found) language.append(env_language, 2);
return found;
}

</%pre>
<%session scope="global">
Expand Down Expand Up @@ -999,8 +1005,15 @@ if (scraperMovieOrTv.found) {
<%cpp>
const int num_cols = 4;
int num = 1;
std::string loc_name = std::locale("").name().substr(0,2);
if (loc_name.length() != 2 || loc_name[0] == 'C' || loc_name[0] == '*') loc_name = "en"; // use en as default
std::string loc_name;
getLanguage(loc_name, "LANGUAGE") ||
getLanguage(loc_name, "LC_ALL") ||
getLanguage(loc_name, "LC_MESSAGES") ||
getLanguage(loc_name, "LANG");
if (loc_name.empty() ) {
loc_name = std::locale("").name().substr(0,2);
if (loc_name.length() != 2 || loc_name[0] == 'C' || loc_name[0] == '*' || loc_name[0] == 'L') loc_name = "en"; // use en as default
}
std::string actor_names = "";

for (const auto &character:scraperCharacters) {
Expand Down

0 comments on commit af40f42

Please sign in to comment.