mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04:00 
			
		
		
		
	* 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
		
			
				
	
	
		
			18 lines
		
	
	
		
			522 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			522 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { ref, Ref, useAsync, useContext } from "@nuxtjs/composition-api";
 | |
| import { useAsyncKey } from "../use-utils";
 | |
| import { AppInfo } from "~/types/api-types/admin";
 | |
| 
 | |
| export function useAppInfo(): Ref<AppInfo | null> {
 | |
|   const appInfo = ref<null | AppInfo>(null);
 | |
| 
 | |
|   const { $axios, i18n } = useContext();
 | |
|   $axios.setHeader("Accept-Language", i18n.locale);
 | |
| 
 | |
|   useAsync(async () => {
 | |
|     const data = await $axios.get<AppInfo>("/api/app/about");
 | |
|     appInfo.value = data.data;
 | |
|   }, useAsyncKey());
 | |
| 
 | |
|   return appInfo;
 | |
| }
 |