We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently to update translations a full release has to be made, this means that it takes a relatively long time to get new translation changes.
An option to have homebox automatically check for updates to the translations and download them.
Wait for releases.
No response
The text was updated successfully, but these errors were encountered:
Dynamically fetch translation files in messages
messages
export default defineNuxtPlugin(async ({ vueApp }) => { async function checkDefaultLanguage() { let matched = null; const languages = Object.getOwnPropertyNames(await messages()); const matching = navigator.languages.filter(lang => languages.some(l => l.toLowerCase() === lang.toLowerCase())); if (matching.length > 0) { matched = matching[0]; } if (!matched) { languages.forEach(lang => { const languagePartials = navigator.language.split("-")[0]; if (lang.toLowerCase() === languagePartials) { matched = lang; } }); } return matched; } const preferences = useViewPreferences(); const i18n = createI18n({ fallbackLocale: "en", globalInjection: true, legacy: false, locale: preferences.value.language || await checkDefaultLanguage() || "en", messageCompiler, messages: await messages(), }); vueApp.use(i18n); }); export const messages = async () => { const messages: Record<string, any> = {}; // const modules = import.meta.glob("~//locales/**.json", { eager: true }); // for (const path in modules) { // const key = path.slice(9, -5); // messages[key] = modules[path]; // } console.log('Fetching translations...'); const en = await (await fetch('http://localhost:3001/en.json')).json(); console.log('Fetched translations.'); messages['en'] = en; return messages; };
Sorry, something went wrong.
tonyaellie
No branches or pull requests
What is the problem you are trying to solve with this feature?
Currently to update translations a full release has to be made, this means that it takes a relatively long time to get new translation changes.
What is the solution you are proposing?
An option to have homebox automatically check for updates to the translations and download them.
What alternatives have you considered?
Wait for releases.
Additional context
No response
Contributions
The text was updated successfully, but these errors were encountered: