Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede authored Mar 21, 2024
1 parent 51cd3b0 commit b87db0f
Show file tree
Hide file tree
Showing 24 changed files with 52 additions and 292 deletions.
6 changes: 6 additions & 0 deletions specs/basic_usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,10 @@ describe('basic usage', async () => {

await restore()
})

test('(#2094) vue-i18n messages are loaded from config exported as variable', async () => {
const { page } = await renderPage('/')

expect(await getText(page, '#issue-2094')).toEqual('Exporting using variable identifier works!')
})
})
4 changes: 4 additions & 0 deletions specs/fixtures/basic/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,9 @@ useHead(() => ({
<NuxtLink id="link-define-i18n-route-false" exact :to="localePath('/define-i18n-route-false')">
go to defineI18nRoute(false)
</NuxtLink>
<section>
<span id="issue-2020-existing">{{ localePath('/test-route?foo=bar') }}</span>
<span id="issue-2020-nonexistent">{{ localePath('/i-dont-exist?foo=bar') }}</span>
</section>
</div>
</template>
3 changes: 3 additions & 0 deletions specs/fixtures/basic_usage/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ useHead({
<div id="module-layer-base-key">{{ $t('moduleLayerBaseKey') }}</div>
<div id="module-layer-base-key-named">{{ $t('moduleLayerBaseKeyNamed', { name: 'bar' }) }}</div>
</section>
<section>
<div id="issue-2094">{{ $t('variableExportedI18nConfig') }}</div>
</section>
<section>
<code id="global-scope-properties">{{ localeProperties }}</code>
<LocalScope />
Expand Down
5 changes: 0 additions & 5 deletions specs/fixtures/issues/2020/app.vue

This file was deleted.

12 changes: 0 additions & 12 deletions specs/fixtures/issues/2020/i18n.config.ts

This file was deleted.

22 changes: 0 additions & 22 deletions specs/fixtures/issues/2020/nuxt.config.ts

This file was deleted.

14 changes: 0 additions & 14 deletions specs/fixtures/issues/2020/package.json

This file was deleted.

41 changes: 0 additions & 41 deletions specs/fixtures/issues/2020/pages/index.vue

This file was deleted.

5 changes: 0 additions & 5 deletions specs/fixtures/issues/2020/pages/some-route.vue

This file was deleted.

5 changes: 0 additions & 5 deletions specs/fixtures/issues/2094/app.vue

This file was deleted.

13 changes: 0 additions & 13 deletions specs/fixtures/issues/2094/i18n.config.ts

This file was deleted.

15 changes: 0 additions & 15 deletions specs/fixtures/issues/2094/nuxt.config.ts

This file was deleted.

15 changes: 0 additions & 15 deletions specs/fixtures/issues/2094/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions specs/fixtures/issues/2094/pages/index.vue

This file was deleted.

7 changes: 0 additions & 7 deletions specs/fixtures/issues/2132/app.vue

This file was deleted.

12 changes: 0 additions & 12 deletions specs/fixtures/issues/2132/i18n.config.ts

This file was deleted.

30 changes: 0 additions & 30 deletions specs/fixtures/issues/2132/nuxt.config.ts

This file was deleted.

15 changes: 0 additions & 15 deletions specs/fixtures/issues/2132/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions specs/fixtures/issues/2132/pages/index.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export default {
import type { I18nOptions } from 'vue-i18n'

// (#2094) export using variable and typescript
const config: I18nOptions = {
fallbackLocale: 'en',
messages: {
fr: {
Expand All @@ -12,7 +15,8 @@ export default {
en: {
aboutSite: 'About this site',
snakeCaseText: "@.snakeCase:{'aboutSite'}",
pascalCaseText: "@.pascalCase:{'aboutSite'}"
pascalCaseText: "@.pascalCase:{'aboutSite'}",
variableExportedI18nConfig: 'Exporting using variable identifier works!'
}
},
modifiers: {
Expand All @@ -24,3 +28,5 @@ export default {
.join('')
}
}

export default config
23 changes: 0 additions & 23 deletions specs/issues/2020.spec.ts

This file was deleted.

17 changes: 0 additions & 17 deletions specs/issues/2094.spec.ts

This file was deleted.

20 changes: 0 additions & 20 deletions specs/issues/2132.spec.ts

This file was deleted.

Loading

0 comments on commit b87db0f

Please sign in to comment.