vona-core 5.0.53 → 5.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,5 @@ import type { VonaApplication } from '../core/application.ts';
3
3
  export declare class BeanSimple {
4
4
  protected app: VonaApplication;
5
5
  protected get ctx(): VonaContext;
6
- protected get bean(): import("vona").BeanContainer;
6
+ protected get bean(): import("./beanContainer.ts").BeanContainer;
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import type { ILocaleInfos } from './type.ts';
2
2
  import { BeanSimple } from '../../beanSimple.ts';
3
3
  export declare class AppLocale extends BeanSimple {
4
- get locale(): keyof ILocaleInfos;
5
- set locale(value: keyof ILocaleInfos);
4
+ get current(): keyof ILocaleInfos;
5
+ set current(value: keyof ILocaleInfos);
6
6
  getText<T extends keyof ILocaleInfos>(supportCustomMessage: boolean, moduleScope: string | undefined, locale: T | undefined, key: string, ...args: any[]): string;
7
7
  }
@@ -2,10 +2,10 @@ import * as localeutil from '@cabloy/localeutil';
2
2
  import { BeanSimple } from "../../beanSimple.js";
3
3
  import { LocaleModuleNameSeparator } from "./type.js";
4
4
  export class AppLocale extends BeanSimple {
5
- get locale() {
5
+ get current() {
6
6
  return this.ctx.locale;
7
7
  }
8
- set locale(value) {
8
+ set current(value) {
9
9
  this.ctx.locale = value;
10
10
  }
11
11
  /** @internal */
@@ -40,6 +40,6 @@ export class AppLocale extends BeanSimple {
40
40
  moduleScope = key.substring(0, pos);
41
41
  key = key.substring(pos + LocaleModuleNameSeparator.length);
42
42
  }
43
- return localeutil.getLocaleText(supportCustomMessage, moduleScope ? this.app.meta.localeModules[moduleScope] : undefined, this.app.meta.locales, locale || this.locale, key, ...args);
43
+ return localeutil.getLocaleText(supportCustomMessage, moduleScope ? this.app.meta.localeModules[moduleScope] : undefined, this.app.meta.locales, locale || this.current, key, ...args);
44
44
  }
45
45
  }
@@ -1,5 +1,5 @@
1
- import type { ILocaleInfos } from 'vona';
2
1
  import type z from 'zod';
2
+ import type { ILocaleInfos } from '../bean/resource/locale/type.ts';
3
3
  import type { VonaApplication } from '../core/application.ts';
4
4
  export type ZodLocaleError = () => {
5
5
  localeError: z.core.$ZodErrorMap;
@@ -9,6 +9,6 @@ export function zodEnhance(app) {
9
9
  }
10
10
  export function zodSetLocaleErrors(app, localeErrors, localeDefault) {
11
11
  setLocaleErrors(() => {
12
- return app.meta.locale.locale;
12
+ return app.meta.locale.current;
13
13
  }, localeErrors, localeDefault);
14
14
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-core",
3
3
  "type": "module",
4
- "version": "5.0.53",
4
+ "version": "5.0.55",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -32,7 +32,7 @@
32
32
  "@cabloy/module-info": "^1.3.26",
33
33
  "@cabloy/module-info-pro": "^1.0.34",
34
34
  "@cabloy/set": "^1.0.17",
35
- "@cabloy/utils": "^1.0.39",
35
+ "@cabloy/utils": "^1.0.40",
36
36
  "@cabloy/word-utils": "^2.0.1",
37
37
  "@cabloy/zod-errors-custom": "^2.0.2",
38
38
  "@cabloy/zod-openapi": "^1.0.2",