1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 21:45:25 +02:00

Feature/auto generate crowdin data (#1071)

* add translated key

* update code generation for crowdin generation

* use composition api and minor styling changes
This commit is contained in:
Hayden 2022-03-19 16:33:55 -08:00 committed by GitHub
parent 022cbd1616
commit 50a67f9301
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 391 additions and 175 deletions

View file

@ -0,0 +1,23 @@
import { computed, useContext } from "@nuxtjs/composition-api";
import { LOCALES } from "./available-locales";
export const useLocales = () => {
const { i18n } = useContext();
const locale = computed<string>({
get() {
return i18n.locale;
},
set(value) {
i18n.setLocale(value);
// Reload the page to update the language - not all strings are reactive
window.location.reload();
},
});
return {
locale,
locales: LOCALES,
i18n,
};
};