question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

locale setting partly working in sveltekit

See original GitHub issue

I have the following code in index.svelte of a new sveltekit project. The const common= line is added to prevent the isHiddenDay error. The day view has the translated month and weekday in the title (16 mei 2021, zondag) but the text today, month, week, day, all-day are not translated.

<script>
	import { onMount } from 'svelte'
	import FullCalendar from 'svelte-fullcalendar'
	
	const options = {
		initialView: "timeGridDay",
		plugins: [],
		locale: 'nl',
		headerToolbar: {
			left: 'prev,next today',
			center: 'title',
			right: 'dayGridMonth,timeGridWeek,timeGridDay',
		},
	};

	onMount(async () => {
		const common = (await import('@fullcalendar/common')).default
		const locale = (await import('@fullcalendar/core/locales/nl')).default
		options.plugins = [
			(await import('@fullcalendar/daygrid')).default,
			(await import('@fullcalendar/timegrid')).default,
		]
	});
</script>

<FullCalendar {options} />

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
skwashacommented, Jul 21, 2021

I’m sorry - I should have updated my comment. You can add the following to your svelte.config.js as a workaround:

const config = {
  kit: {
    // hydrate the <div id="svelte"> element in src/app.html
    target: '#svelte',
    vite: {
      optimizeDeps: {
        include: ['svelet-fullcalendar'],
      },
    },
  },
}
0reactions
YogliBcommented, Sep 28, 2021

Can you try again with the latest version (1.1.1)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

i18n brainstorming · Issue #553 · sveltejs/kit - GitHub
I believe setting that as the canonical URL for all the locale variants will help search engines too, and thus users so that...
Read more >
Introduction • Docs • SvelteKit
SvelteKit is a framework for rapid development of robust, performant web applications. Building an app with all the modern best practices is fiendishly ......
Read more >
A Step-by-Step Guide to Svelte Localization | Phrase
Still quite new but powerful, the Svelte framework has found a solid niche for itself. Here's how to implement Svelte localization!
Read more >
Svelte i18n reset language on page change - Stack Overflow
The local is always reset to English even I had change it. Is it a default behavior and I need to reset the...
Read more >
Svelte i18n Internationalization: how to localize a Svelte app
This Svelte localization tutorial explains how to setup and utilize ... fallback to english if the current locale is not in the dictionary....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found