Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/storybook/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions packages/core-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/core-base.js",
"unpkg": "dist/core-base.global.js",
"jsdelivr": "dist/core-base.global.js",
Expand Down Expand Up @@ -69,5 +68,6 @@
"publishConfig": {
"access": "public"
},
"sideEffects": false
"sideEffects": false,
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/core-base/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export interface CoreInternalContext {
*/
export const VERSION: string = __VERSION__

export const NOT_REOSLVED = -1
export const NOT_RESOLVED = -1

export const DEFAULT_LOCALE = 'en-US'

Expand Down
4 changes: 2 additions & 2 deletions packages/core-base/src/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
handleMissing,
isTranslateFallbackWarn,
MISSING_RESOLVE_VALUE,
NOT_REOSLVED
NOT_RESOLVED
} from './context'
import { CoreErrorCodes, createCoreError } from './errors'
import { getLocale } from './fallbacker'
Expand Down Expand Up @@ -275,7 +275,7 @@ export function datetime<

// checking format and target locale
if (!isPlainObject(format) || !isString(targetLocale)) {
return unresolving ? NOT_REOSLVED : key
return unresolving ? NOT_RESOLVED : key
}

let id = `${targetLocale}__${key}`
Expand Down
4 changes: 2 additions & 2 deletions packages/core-base/src/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
handleMissing,
isTranslateFallbackWarn,
MISSING_RESOLVE_VALUE,
NOT_REOSLVED
NOT_RESOLVED
} from './context'
import { CoreErrorCodes, createCoreError } from './errors'
import { getLocale } from './fallbacker'
Expand Down Expand Up @@ -270,7 +270,7 @@ export function number<

// checking format and target locale
if (!isPlainObject(format) || !isString(targetLocale)) {
return unresolving ? NOT_REOSLVED : key
return unresolving ? NOT_RESOLVED : key
}

let id = `${targetLocale}__${key}`
Expand Down
4 changes: 2 additions & 2 deletions packages/core-base/src/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
isAlmostSameLocale,
isImplicitFallback,
isTranslateFallbackWarn,
NOT_REOSLVED
NOT_RESOLVED
} from './context'
import { translateDevTools } from './devtools'
import { CoreErrorCodes, createCoreError } from './errors'
Expand Down Expand Up @@ -713,7 +713,7 @@ export function translate<
) ||
!isString(targetLocale))
) {
return unresolving ? NOT_REOSLVED : (key as MessageFunctionReturn<Message>)
return unresolving ? NOT_RESOLVED : (key as MessageFunctionReturn<Message>)
}

// TODO: refactor
Expand Down
17 changes: 9 additions & 8 deletions packages/core-base/test/datetime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ vi.mock('../src/intl', async () => {
}
})

import { createCoreContext as context, NOT_REOSLVED } from '../src/context'
import { datetime } from '../src/datetime'
import { CoreErrorCodes, errorMessages } from '../src/errors'
import { compile } from '../src/compilation'
import {
registerMessageCompiler,
registerLocaleFallbacker
createCoreContext as context,
NOT_RESOLVED,
registerLocaleFallbacker,
registerMessageCompiler
} from '../src/context'
import { compile } from '../src/compilation'
import { datetime } from '../src/datetime'
import { CoreErrorCodes, errorMessages } from '../src/errors'
import { fallbackWithLocaleChain } from '../src/fallbacker'

import type { DateTimeFormats } from '../src/types'
Expand Down Expand Up @@ -265,7 +266,7 @@ describe('context unresolving option', () => {
datetimeFormats
})

expect(datetime(ctx, dt, 'long')).toEqual(NOT_REOSLVED)
expect(datetime(ctx, dt, 'long')).toEqual(NOT_RESOLVED)
expect(mockWarn).not.toHaveBeenCalled()
})

Expand All @@ -284,7 +285,7 @@ describe('context unresolving option', () => {
datetimeFormats
})

expect(datetime(ctx, dt, 'custom')).toEqual(NOT_REOSLVED)
expect(datetime(ctx, dt, 'custom')).toEqual(NOT_RESOLVED)
expect(mockWarn).not.toHaveBeenCalled()
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/core-base/test/number.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vi.mock('../src/intl', async () => {
import { compile } from '../src/compilation'
import {
createCoreContext as context,
NOT_REOSLVED,
NOT_RESOLVED,
registerLocaleFallbacker,
registerMessageCompiler
} from '../src/context'
Expand Down Expand Up @@ -240,7 +240,7 @@ describe('context unresolving option', () => {
numberFormats
})

expect(number(ctx, 0.99, 'percent')).toEqual(NOT_REOSLVED)
expect(number(ctx, 0.99, 'percent')).toEqual(NOT_RESOLVED)
expect(mockWarn).not.toHaveBeenCalled()
})

Expand All @@ -259,7 +259,7 @@ describe('context unresolving option', () => {
numberFormats
})

expect(number(ctx, 123456789, 'custom')).toEqual(NOT_REOSLVED)
expect(number(ctx, 123456789, 'custom')).toEqual(NOT_RESOLVED)
expect(mockWarn).not.toHaveBeenCalled()
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/core-base/test/translate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ vi.mock('@intlify/shared', async () => {
import { compile } from '../src/compilation'
import {
createCoreContext as context,
NOT_REOSLVED,
NOT_RESOLVED,
registerLocaleFallbacker,
registerMessageCompiler,
registerMessageResolver
Expand Down Expand Up @@ -553,7 +553,7 @@ describe('context unresolving option', () => {
ja: {}
}
})
expect(translate(ctx, 'hello.world')).toEqual(NOT_REOSLVED)
expect(translate(ctx, 'hello.world')).toEqual(NOT_RESOLVED)
})

test('fallbackWarn is false', () => {
Expand All @@ -568,7 +568,7 @@ describe('context unresolving option', () => {
ja: {}
}
})
expect(translate(ctx, 'hello.world')).toEqual(NOT_REOSLVED)
expect(translate(ctx, 'hello.world')).toEqual(NOT_RESOLVED)
})

test('fallbackFormat is true', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/core.js",
"unpkg": "dist/core.global.js",
"jsdelivr": "dist/core.global.js",
Expand Down Expand Up @@ -71,5 +70,6 @@
"publishConfig": {
"access": "public"
},
"sideEffects": false
"sideEffects": false,
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/devtools-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/devtools-types.js",
"types": "dist/devtools-types.d.ts",
"dependencies": {
Expand Down Expand Up @@ -60,5 +59,6 @@
"publishConfig": {
"access": "public"
},
"sideEffects": false
"sideEffects": false,
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/message-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/message-compiler.js",
"unpkg": "dist/message-compiler.global.js",
"jsdelivr": "dist/message-compiler.global.js",
Expand Down Expand Up @@ -68,5 +67,6 @@
"publishConfig": {
"access": "public"
},
"sideEffects": false
"sideEffects": false,
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/petite-vue-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/petite-vue-i18n.js",
"unpkg": "dist/petite-vue-i18n.global.js",
"jsdelivr": "dist/petite-vue-i18n.global.js",
Expand Down Expand Up @@ -78,5 +77,6 @@
"./package.json": "./package.json"
},
"funding": "https://github.com/sponsors/kazupon",
"sideEffects": false
"sideEffects": false,
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/shared.js",
"types": "dist/shared.d.ts",
"engines": {
Expand Down Expand Up @@ -57,5 +56,6 @@
"publishConfig": {
"access": "public"
},
"sideEffects": false
"sideEffects": false,
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/vue-i18n-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"files": [
"dist"
],
"type": "module",
"module": "dist/vue-i18n-core.mjs",
"unpkg": "dist/vue-i18n-core.global.js",
"jsdelivr": "dist/vue-i18n-core.global.js",
Expand Down Expand Up @@ -84,5 +83,6 @@
"publishConfig": {
"access": "public"
},
"sideEffects": false
"sideEffects": false,
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/vue-i18n-core/src/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {
DEFAULT_LOCALE,
MISSING_RESOLVE_VALUE,
NOT_REOSLVED,
NOT_RESOLVED,
clearDateTimeFormat,
clearNumberFormat,
createCoreContext,
Expand Down Expand Up @@ -2237,7 +2237,7 @@ export function createComposer(options: any = {}): any {
if (
(warnType !== 'translate exists' && // for not `te` (e.g `t`)
isNumber(ret) &&
ret === NOT_REOSLVED) ||
ret === NOT_RESOLVED) ||
(warnType === 'translate exists' && !ret) // for `te`
) {
const [key, arg2] = argumentParser()
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"dist",
"vetur"
],
"type": "module",
"module": "dist/vue-i18n.js",
"unpkg": "dist/vue-i18n.global.js",
"jsdelivr": "dist/vue-i18n.global.js",
Expand Down Expand Up @@ -79,6 +78,7 @@
},
"funding": "https://github.com/sponsors/kazupon",
"sideEffects": false,
"type": "module",
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
Expand Down