@steedos/service-i18n 2.6.1-beta.7 → 2.6.2-beta.10

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.
@@ -1,5 +1,5 @@
1
1
  CustomLabels:
2
- frontend_field_group_generalization: Generalization
2
+ frontend_field_group_generalization: General
3
3
  frontend_form_save: Save
4
4
  frontend_form_cancel: Cancel
5
5
  frontend_form_new: New
@@ -31,7 +31,7 @@ CustomLabels:
31
31
  objects_tab_title: Select objects that need to generate tabs
32
32
  action_field_updates:
33
33
  action_field_updates_form:
34
- field_group_generalization: Generalization
34
+ field_group_generalization: General
35
35
  api_name: API Name
36
36
  display_name: Display Name
37
37
  object_name: Object
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@steedos/service-i18n",
3
3
  "main": "package.service.js",
4
- "version": "2.6.1-beta.7",
4
+ "version": "2.6.2-beta.10",
5
5
  "private": false,
6
6
  "repository": "https://github.com/steedos/steedos-platform.git",
7
7
  "description": "",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "b12f271460ef3686face095e875aa38e8ddc4c7f"
17
+ "gitHead": "afbd1c34d1516e44494b5d5a192bbce80e48af93"
18
18
  }
@@ -2,14 +2,15 @@
2
2
  * @Author: yinlianghui@steedos.com
3
3
  * @Date: 2022-07-26 11:45:49
4
4
  * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-04-04 18:58:40
5
+ * @LastEditTime: 2023-07-19 14:58:21
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
9
9
  const project = require('./package.json');
10
10
  const packageName = project.name;
11
11
  const packageLoader = require('@steedos/service-package-loader');
12
-
12
+ const register = require('@steedos/metadata-registrar');
13
+ const steedosI18n = require("@steedos/i18n");
13
14
  /**
14
15
  * @typedef {import('moleculer').Context} Context Moleculer's Context
15
16
  * 软件包服务启动后也需要抛出事件。
@@ -38,6 +39,15 @@ module.exports = {
38
39
  * Actions
39
40
  */
40
41
  actions: {
42
+ generateObjectTranslationTemplate: async function(ctx){
43
+ const {objectName, lng = 'zh-CN'} = ctx.params;
44
+ console.log(`generateObjectTranslationTemplate===`, objectName, lng)
45
+ if(!objectName){
46
+ return {}
47
+ }
48
+ const objectConfig = await register.getObjectConfig(objectName);
49
+ return steedosI18n.getObjectMetadataTranslationTemplate(lng, objectConfig.name, objectConfig, true);
50
+ },
41
51
  },
42
52
 
43
53
  /**