@rxdrag/website-lib-core 0.0.130 → 0.0.131

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdrag/website-lib-core",
3
- "version": "0.0.130",
3
+ "version": "0.0.131",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts"
@@ -34,7 +34,7 @@
34
34
  "hls.js": "^1.6.13",
35
35
  "lodash-es": "^4.17.21",
36
36
  "@rxdrag/entify-lib": "0.0.24",
37
- "@rxdrag/rxcms-models": "0.3.110"
37
+ "@rxdrag/rxcms-models": "0.3.111"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "astro": "^5.16.6",
@@ -103,6 +103,15 @@ export class Entify implements IEntify {
103
103
  return this.ensureLangAbbr();
104
104
  }
105
105
 
106
+ /**
107
+ * 获取当前语言对象(包含 dir 等完整信息)
108
+ */
109
+ public async getCurrentLang() {
110
+ const langAbbr = this.ensureLangAbbr();
111
+ const langs = await this.getLangs();
112
+ return langs?.find((l) => l.abbr === langAbbr);
113
+ }
114
+
106
115
  /**
107
116
  * 获取当前语言,如果未设置则抛出异常
108
117
  */
@@ -71,6 +71,11 @@ export interface IEntify {
71
71
  */
72
72
  getLang(): string;
73
73
 
74
+ /**
75
+ * 获取当前语言对象(包含 dir 等完整信息)
76
+ */
77
+ getCurrentLang(): Promise<Lang | undefined>;
78
+
74
79
  getBaseLang(): Promise<Lang | undefined>;
75
80
 
76
81
  getMedia(ref: string | undefined | null, fileField?: FileFieldType, resize?: ImageResize): Promise<Media | undefined>;
@@ -9,6 +9,7 @@ export const langFields = [
9
9
  LangFields.localName,
10
10
  LangFields.icon,
11
11
  LangFields.htmlLang,
12
+ LangFields.dir,
12
13
  //TODO 用枚举有时会出空值
13
14
  "urlFragment" as LangFields.urlFragment,
14
15
  ];