Skip to content

Commit 10c43d7

Browse files
author
David Monteagudo
committed
Fixed lang files path
Updated hardcoded labels for component in project creation Display component list in project creation sorted by nane Signed-off-by: David Monteagudo <[email protected]>
1 parent 1802139 commit 10c43d7

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ for this scenario, simply change the value of API_BASE_URL in static/config.json
8383

8484
This project supports internationalization. Currently, only English language is supported. Pull requests to support additional languages are encouraged.
8585

86-
Note to developers: Textual labels are defined in `src/i18n/messages.json`. Ensure that all labels are defined here and that components use i18n, not textual labels directly.
86+
Note to developers: Textual labels are defined in `src/i18n/locales/{lang}.json`. Ensure that all labels are defined here and that components use i18n, not textual labels directly.
8787

8888
Copyright & License
8989
-------------------

src/i18n/locales/en.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,15 @@
274274
"service_updated": "Service updated",
275275
"object_identifier": "Object Identifier",
276276
"object_identifier_desc": "A unique identifier (UUID) that Dependency-Track automatically assigns to every object",
277-
"dependency_graph": "Dependency Graph"
277+
"dependency_graph": "Dependency Graph",
278+
"component_application": "Application",
279+
"component_framework": "Framework",
280+
"component_library": "Library",
281+
"component_container": "Container",
282+
"component_os": "Operation system",
283+
"component_device": "Device",
284+
"component_firmware": "Firmware",
285+
"component_file": "File"
278286
},
279287
"admin": {
280288
"configuration": "Configuration",

src/views/portfolio/projects/ProjectCreateProjectModal.vue

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
lazy="true" required="false" feedback="false" autofocus="false"
1313
:label="$t('message.version')" :tooltip="this.$t('message.component_version_desc')"/>
1414
<b-input-group-form-select id="v-classifier-input" required="true"
15-
v-model="project.classifier" :options="availableClassifiers"
15+
v-model="project.classifier" :options="sortAvailableClassifiers"
1616
:label="$t('message.classifier')" :tooltip="$t('message.component_classifier_desc')" />
1717
<b-form-group
1818
id="project-description-form-group"
@@ -100,14 +100,14 @@
100100
readOnlyProjectName: '',
101101
readOnlyProjectVersion: '',
102102
availableClassifiers: [
103-
{ value: 'APPLICATION', text: 'Application' },
104-
{ value: 'FRAMEWORK', text: 'Framework' },
105-
{ value: 'LIBRARY', text: 'Library' },
106-
{ value: 'CONTAINER', text: 'Container' },
107-
{ value: 'OPERATING_SYSTEM', text: 'Operating System' },
108-
{ value: 'DEVICE', text: 'Device' },
109-
{ value: 'FIRMWARE', text: 'Firmware' },
110-
{ value: 'FILE', text: 'File' }
103+
{ value: 'APPLICATION', text: this.$i18n.t('message.component_application') },
104+
{ value: 'FRAMEWORK', text: this.$i18n.t('message.component_framework') },
105+
{ value: 'LIBRARY', text: this.$i18n.t('message.component_library') },
106+
{ value: 'CONTAINER', text: this.$i18n.t('message.component_container') },
107+
{ value: 'OPERATING_SYSTEM', text: this.$i18n.t('message.component_os') },
108+
{ value: 'DEVICE', text: this.$i18n.t('message.component_device') },
109+
{ value: 'FIRMWARE', text: this.$i18n.t('message.component_firmware') },
110+
{ value: 'FILE', text: this.$i18n.t('message.component_file') }
111111
],
112112
selectableLicenses: [],
113113
selectedLicense: '',
@@ -131,6 +131,13 @@
131131
beforeMount() {
132132
this.retrieveLicenses();
133133
},
134+
computed: {
135+
sortAvailableClassifiers: function() {
136+
return this.availableClassifiers.sort(function(a, b) {
137+
return a.text.localeCompare(b.text);
138+
});
139+
}
140+
},
134141
methods: {
135142
syncReadOnlyNameField: function(value) {
136143
this.readOnlyProjectName = value;

0 commit comments

Comments
 (0)