msolefonte / celes

Celes is an open source file scraper that obtains and stores game achievements, whatever the origin
https://www.npmjs.com/package/@achievement-watcher/celes
GNU General Public License v2.0
4 stars 0 forks source link

Default Steam schema language to English #12

Closed msolefonte closed 4 years ago

msolefonte commented 4 years ago

In the version v1, Steam schema data was obtained by invoking a function similar to the one following:

async getGameData(appId: string, lang: string, key?: string | undefined): Promise<IGameData> {
    if (!this.steamLanguages.includes(lang)) {
        throw 'Language selected not supported by Steam API';
    }

    ...
}

As can be seen, right now an error is thrown if the language selected is not available at Steam. I think it would be more practical to default that language to English, being the more universal one. Any thoughts @xan105?

xan105 commented 4 years ago

Yes, we can fallback to English as default. That's what the Steam Web API does.

msolefonte commented 4 years ago

Fixed.