@sap-ux/flp-config-sub-generator 0.0.25 → 0.1.0

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.
@@ -45,6 +45,8 @@ export default class extends Generator {
45
45
  * @param titles - the titles to be added to the i18n file
46
46
  * @param titles.title - the title to be added to the i18n file
47
47
  * @param titles.subTitle - the subtitle to be added to the i18n file
48
+ * @param titles.semanticObject - the semantic object to be used as a prefix to the title and subtitle
49
+ * @param titles.action - action to be used as a prefix to the title and subtitle
48
50
  * @returns true if the i18n file was updated with the key/values
49
51
  */
50
52
  private _updateI18n;
@@ -151,6 +151,8 @@ class default_1 extends yeoman_generator_1.default {
151
151
  let keysAdded = false;
152
152
  if (title) {
153
153
  keysAdded = await this._updateI18n(this.manifestPath, this.manifest, {
154
+ semanticObject,
155
+ action,
154
156
  title,
155
157
  subTitle
156
158
  });
@@ -158,8 +160,8 @@ class default_1 extends yeoman_generator_1.default {
158
160
  await (0, app_config_writer_1.generateInboundNavigationConfig)(this.appRootPath, {
159
161
  semanticObject,
160
162
  action,
161
- title: keysAdded ? `{{${constants_1.i18nKeyTitle}}}` : title,
162
- subTitle: keysAdded && subTitle ? `{{${constants_1.i18nKeySubTitle}}}` : subTitle
163
+ title: keysAdded ? `{{${semanticObject}-${action}.${constants_1.i18nKeyTitle}}}` : title,
164
+ subTitle: keysAdded && subTitle ? `{{${semanticObject}-${action}.${constants_1.i18nKeySubTitle}}}` : subTitle
163
165
  }, true, this.fs);
164
166
  }
165
167
  /**
@@ -170,15 +172,20 @@ class default_1 extends yeoman_generator_1.default {
170
172
  * @param titles - the titles to be added to the i18n file
171
173
  * @param titles.title - the title to be added to the i18n file
172
174
  * @param titles.subTitle - the subtitle to be added to the i18n file
175
+ * @param titles.semanticObject - the semantic object to be used as a prefix to the title and subtitle
176
+ * @param titles.action - action to be used as a prefix to the title and subtitle
173
177
  * @returns true if the i18n file was updated with the key/values
174
178
  */
175
- async _updateI18n(manifestPath, manifest, { title, subTitle }) {
179
+ async _updateI18n(manifestPath, manifest, { semanticObject, action, title, subTitle }) {
176
180
  let createProps = false;
177
181
  const { 'sap.app': i18nPath } = await (0, project_access_1.getI18nPropertiesPaths)(manifestPath, manifest);
178
182
  try {
179
- const i18nEntries = [{ key: constants_1.i18nKeyTitle, value: title }];
183
+ const i18nEntries = [{ key: `${semanticObject}-${action}.${constants_1.i18nKeyTitle}`, value: title }];
180
184
  if (subTitle) {
181
- i18nEntries.push({ key: constants_1.i18nKeySubTitle, value: subTitle });
185
+ i18nEntries.push({
186
+ key: `${semanticObject}-${action}.${constants_1.i18nKeySubTitle}`,
187
+ value: subTitle
188
+ });
182
189
  }
183
190
  createProps = await (0, i18n_1.createPropertiesI18nEntries)(i18nPath, i18nEntries, this.appRootPath, this.fs);
184
191
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/flp-config-sub-generator",
3
3
  "description": "Generator for creating Fiori Launcpad configuration",
4
- "version": "0.0.25",
4
+ "version": "0.1.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -23,14 +23,14 @@
23
23
  "i18next": "23.5.1",
24
24
  "inquirer": "8.2.6",
25
25
  "yeoman-generator": "5.10.0",
26
- "@sap-ux/app-config-writer": "0.5.20",
27
- "@sap-ux/deploy-config-generator-shared": "0.0.14",
26
+ "@sap-ux/app-config-writer": "0.5.21",
27
+ "@sap-ux/deploy-config-generator-shared": "0.0.15",
28
28
  "@sap-ux/feature-toggle": "0.2.3",
29
- "@sap-ux/fiori-generator-shared": "0.7.22",
30
- "@sap-ux/flp-config-inquirer": "0.2.24",
29
+ "@sap-ux/fiori-generator-shared": "0.7.23",
30
+ "@sap-ux/flp-config-inquirer": "0.2.25",
31
31
  "@sap-ux/i18n": "0.2.0",
32
- "@sap-ux/inquirer-common": "0.6.9",
33
- "@sap-ux/project-access": "1.29.2"
32
+ "@sap-ux/inquirer-common": "0.6.10",
33
+ "@sap-ux/project-access": "1.29.3"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@jest/types": "29.6.3",