mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-01-11 20:10:20 +00:00
[AO] [ADN] Improve API locale handling
This commit is contained in:
parent
78630bb5f7
commit
ba08c7b4e7
4 changed files with 6 additions and 4 deletions
2
adn.ts
2
adn.ts
|
|
@ -78,7 +78,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
|
|||
public async cli() {
|
||||
console.info(`\n=== Multi Downloader NX ${packageJson.version} ===\n`);
|
||||
const argv = yargs.appArgv(this.cfg.cli);
|
||||
if (argv.locale !== 'en-US')
|
||||
if (['fr', 'de'].includes(argv.locale))
|
||||
this.locale = argv.locale;
|
||||
if (argv.debug)
|
||||
this.debug = true;
|
||||
|
|
|
|||
2
ao.ts
2
ao.ts
|
|
@ -84,7 +84,7 @@ export default class AnimeOnegai implements ServiceClass {
|
|||
public async cli() {
|
||||
console.info(`\n=== Multi Downloader NX ${packageJson.version} ===\n`);
|
||||
const argv = yargs.appArgv(this.cfg.cli);
|
||||
if (argv.locale !== 'en-US')
|
||||
if (['pt', 'es'].includes(argv.locale))
|
||||
this.locale = argv.locale;
|
||||
if (argv.debug)
|
||||
this.debug = true;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ class ADNHandler extends Base implements MessageHandler {
|
|||
|
||||
public getDefaults() {
|
||||
const _default = yargs.appArgv(this.adn.cfg.cli, true);
|
||||
this.adn.locale = _default.locale;
|
||||
if (['fr', 'de'].includes(_default.locale))
|
||||
this.adn.locale = _default.locale;
|
||||
}
|
||||
|
||||
public async auth(data: AuthData) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ class AnimeOnegaiHandler extends Base implements MessageHandler {
|
|||
|
||||
public getDefaults() {
|
||||
const _default = yargs.appArgv(this.ao.cfg.cli, true);
|
||||
this.ao.locale = _default.locale;
|
||||
if (['es', 'pt'].includes(_default.locale))
|
||||
this.ao.locale = _default.locale;
|
||||
}
|
||||
|
||||
public async auth(data: AuthData) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue