Skip to content

fix: typo #2221

New issue

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

Merged
merged 2 commits into from
Jul 2, 2025
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
2 changes: 1 addition & 1 deletion packages/core-base/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export interface CoreInternalContext {
*/
export const VERSION = __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 @@ -25,7 +25,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
17 changes: 9 additions & 8 deletions packages/core-base/test/number.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ vi.mock('../src/intl', async () => {
}
})

import { createCoreContext as context, NOT_REOSLVED } from '../src/context'
import { number } from '../src/number'
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 { CoreErrorCodes, errorMessages } from '../src/errors'
import { fallbackWithLocaleChain } from '../src/fallbacker'
import { number } from '../src/number'
import { NumberFormats } from '../src/types/index'

type MyNumberSchema = {
Expand Down Expand Up @@ -238,7 +239,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 @@ -257,7 +258,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/vue-i18n-core/src/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
DEFAULT_LOCALE,
MISSING_RESOLVE_VALUE,
MessageFunction,
NOT_REOSLVED,
NOT_RESOLVED,
clearDateTimeFormat,
clearNumberFormat,
createCoreContext,
Expand Down Expand Up @@ -2234,7 +2234,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