Skip to content

Commit

Permalink
F t31115 remove translator from dp select (#357)
Browse files Browse the repository at this point in the history
* chore (refs T31115): add Trans-Key to translations.js

* chore (refs T31115): remove Translator.trans from DpSelect.

- call a Translator.trans in Core.

* Update src/components/DpSelect/DpSelect.vue

Co-authored-by: spiess-demos <40452344+spiess-demos@users.noreply.github.com>

* chore (refs T31115): remove unused props & computed.

* chore (refs T31115): revert computed.

* chore (refs T31115): add Changelog.

* Update CHANGELOG.md

Co-authored-by: spiess-demos <40452344+spiess-demos@users.noreply.github.com>

---------

Co-authored-by: spiess-demos <40452344+spiess-demos@users.noreply.github.com>
  • Loading branch information
ahmad-demos and spiess-demos authored Jul 11, 2023
1 parent 178928d commit 0935602
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Since v0.0.10, this Changelog is formatted according to the [Common Changelog][c

## UNRELEASED

### Removed

- ([#357](https://github.com/demos-europe/demosplan-ui/pull/357)) Remove Translator from DpSelect ([@ahmad-demos](https://github.com/ahmad-demos))

### Added

- ([#344](https://github.com/demos-europe/demosplan-ui/pull/344)) Add documentation for DpTabs ([@ahmad-demos](https://github.com/@ahmad-demos))
- ([#333](https://github.com/demos-europe/demosplan-ui/pull/333)) Add "rounded" prop to DpButton, add "arrow-up" and "arrow-down" icons to DpIcon ([@spiess-demos](https://github.com/spiess-demos))

Expand Down
15 changes: 7 additions & 8 deletions src/components/DpSelect/DpSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@
disabled
value=""
:selected="selected === ''">
{{ Translator.trans(placeholder) }}
{{ selectPlaceholder }}
</option>
<option
v-for="(option, idx) in options"
:selected="option.value === selected"
:value="option.value"
:key="idx">
{{ Translator.trans(option.label) }}
{{ option.label }}
</option>
</select>
</div>
</template>

<script>
import DpLabel from '../DpLabel/DpLabel'
import { de } from '../shared/translations'
import { prefixClassMixin } from '../../mixins'
export default {
Expand Down Expand Up @@ -96,12 +97,6 @@ export default {
type: Array
},
placeholder: {
type: String,
required: false,
default: 'warning.select.entry'
},
required: {
type: Boolean,
required: false,
Expand All @@ -122,6 +117,10 @@ export default {
},
computed: {
selectPlaceholder () {
return de.selectPlaceholder
},
nameOrId () {
/*
* As long as there is no necessity of having the id to differ from name,
Expand Down
3 changes: 2 additions & 1 deletion src/components/shared/translations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const de = {
contextualHelp: 'Kontexthilfe',
loadingData: 'Daten werden geladen...'
loadingData: 'Daten werden geladen...',
selectPlaceholder: 'Bitte wählen Sie einen Eintrag aus.'
}

export { de }

0 comments on commit 0935602

Please sign in to comment.