diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5d76993 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs"] + path = docs + url = git@github.com:kaisermann/svelte-i18n.wiki.git diff --git a/docs b/docs new file mode 160000 index 0000000..acadff6 --- /dev/null +++ b/docs @@ -0,0 +1 @@ +Subproject commit acadff6027a315e011a7157ae3b139d5e4cc3ae5 diff --git a/example/rollup.config.js b/example/rollup.config.js index 2ee80ca..29cd491 100644 --- a/example/rollup.config.js +++ b/example/rollup.config.js @@ -39,28 +39,19 @@ export default { dedupe, }), commonjs(), - json(), + json({ + namedExports: false, + compact: !dev, + }), legacy && babel({ extensions: ['.js', '.mjs', '.html', '.svelte'], runtimeHelpers: true, exclude: ['node_modules/@babel/**'], - presets: [ - [ - '@babel/preset-env', - { - targets: '> 0.25%, not dead', - }, - ], - ], + presets: [['@babel/preset-env', { targets: '> 0.25%, not dead' }]], plugins: [ '@babel/plugin-syntax-dynamic-import', - [ - '@babel/plugin-transform-runtime', - { - useESModules: true, - }, - ], + ['@babel/plugin-transform-runtime', { useESModules: true }], ], }), @@ -88,7 +79,10 @@ export default { dedupe, }), commonjs(), - json(), + json({ + namedExports: false, + compact: !dev, + }), ], external: Object.keys(pkg.dependencies).concat( require('module').builtinModules || diff --git a/example/src/i18n.js b/example/src/i18n.js index 87da174..76dd0a3 100644 --- a/example/src/i18n.js +++ b/example/src/i18n.js @@ -1,4 +1,4 @@ -import { register, getClientLocale, locale } from 'svelte-i18n' +import { register } from 'svelte-i18n' register('en', () => import('../messages/en.json')) register('pt-BR', () => import('../messages/pt-BR.json')) diff --git a/example/src/routes/_layout.svelte b/example/src/routes/_layout.svelte index 649fa7f..bc89961 100644 --- a/example/src/routes/_layout.svelte +++ b/example/src/routes/_layout.svelte @@ -1,10 +1,10 @@ @@ -15,9 +15,9 @@ - {$_('title.about', { default: 'About' })} + {$_('title.about')} -

{$_('about_this_site', { default: 'About this site' })}

+

{$_('about_this_site')}

-

{$_('about_content[0]', { default: "This is the 'about' page. There's not much here." })}

+

{$_('about_content[0]')}