Skip to content

Use one other thing than the system Language with nacpGetLanguageEntry#616

Closed
PoloNX wants to merge 2 commits into
switchbrew:masterfrom
PoloNX:master
Closed

Use one other thing than the system Language with nacpGetLanguageEntry#616
PoloNX wants to merge 2 commits into
switchbrew:masterfrom
PoloNX:master

Conversation

@PoloNX
Copy link
Copy Markdown

@PoloNX PoloNX commented Jun 19, 2023

Hi, I have to fetch all titles installed on my switch for my homebrew SimpleModDownloader

But If I do one request with one jap/chinese name it wont works so I want to get the name of one game directly with one specific languages (en-US here)

@yellows8
Copy link
Copy Markdown
Contributor

But If I do one request with one jap/chinese name it wont works <- Can you be more specific?

@PoloNX
Copy link
Copy Markdown
Author

PoloNX commented Jun 19, 2023

Yep no problem. I'm doing one request to get the id of the page of the mod

    nlohmann::json searchGames(std::string gameTitle) {
        gameTitle = replaceSpacesWithPlus(gameTitle);

        const std::string api_url = fmt::format("https://gamebanana.com/apiv11/Util/Game/NameMatch?_sName={}", gameTitle);
        brls::Logger::debug("API URL: {}", api_url);

        nlohmann::json games = net::downloadRequest(api_url);

        return games;
    }

The game on gamebanana is in english example : https://gamebanana.com/games/6507

So if I do this :

https://gamebanana.com/apiv11/Util/Game/NameMatch?_sName=Mario+Kart+8+Deluxe

it will works but if I do

https://gamebanana.com/apiv11/Util/Game/NameMatch?_sName=マリオカート8+Mariokāto+8

it wont works

@yellows8
Copy link
Copy Markdown
Contributor

Just use &nacp->lang[2] (en-us) directly from your app instead of this.

@yellows8 yellows8 closed this Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants