release: v4.1.0

This commit is contained in:
Amruth Pillai
2024-05-05 14:55:06 +02:00
parent 68252c35fc
commit e87b05a93a
282 changed files with 11461 additions and 10713 deletions

View File

@ -1,21 +1,13 @@
import { Controller, Get } from "@nestjs/common";
import { UtilsService } from "../utils/utils.service";
import { TranslationService } from "./translation.service";
@Controller("translation")
export class TranslationController {
constructor(
private readonly translationService: TranslationService,
private readonly utils: UtilsService,
) {}
constructor(private readonly translationService: TranslationService) {}
@Get("/languages")
async languages() {
return this.utils.getCachedOrSet(
`translation:languages`,
async () => this.translationService.fetchLanguages(),
1000 * 60 * 60 * 24, // 24 hours
);
return this.translationService.fetchLanguages();
}
}

View File

@ -56,7 +56,7 @@ export class TranslationService {
locale: data.language.locale,
} satisfies Language;
});
} catch (error) {
} catch {
return languages;
}
}