mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
Feature/improve localization (#1147)
* use locale to set language header * rewrite i18n provider and drop dependency * rename file * rename CrudMixin to HttpRepo * refactor: code-cleanup * add crowdin source * remove unused translations * grab translations from dev branch * add translation support for foods, units, and labels * remove rich import
This commit is contained in:
parent
db095656e1
commit
7866f0f46e
71 changed files with 4736 additions and 3642 deletions
|
@ -53,13 +53,18 @@ function getRequests(axiosInstance: NuxtAxiosInstance): ApiRequestInstance {
|
|||
}
|
||||
|
||||
export const useAdminApi = function (): AdminAPI {
|
||||
const { $axios } = useContext();
|
||||
const { $axios, i18n } = useContext();
|
||||
|
||||
$axios.setHeader("Accept-Language", i18n.locale);
|
||||
|
||||
const requests = getRequests($axios);
|
||||
return new AdminAPI(requests);
|
||||
};
|
||||
|
||||
export const useUserApi = function (): Api {
|
||||
const { $axios } = useContext();
|
||||
const { $axios, i18n } = useContext();
|
||||
$axios.setHeader("Accept-Language", i18n.locale);
|
||||
|
||||
const requests = getRequests($axios);
|
||||
|
||||
return new Api(requests);
|
||||
|
|
|
@ -5,7 +5,8 @@ import { AppInfo } from "~/types/api-types/admin";
|
|||
export function useAppInfo(): Ref<AppInfo | null> {
|
||||
const appInfo = ref<null | AppInfo>(null);
|
||||
|
||||
const { $axios } = useContext();
|
||||
const { $axios, i18n } = useContext();
|
||||
$axios.setHeader("Accept-Language", i18n.locale);
|
||||
|
||||
useAsync(async () => {
|
||||
const data = await $axios.get<AppInfo>("/api/app/about");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue