Skip to content

Commit

Permalink
refactor(l10n): allow translation of price ordering options (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Mar 6, 2024
1 parent 591a062 commit 6ef5de6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default {
{ key: '-price_count', value: 'Number of prices', icon: 'mdi-tag-multiple-outline' },
],
PRICE_ORDER_BY_LIST: [
{ key: 'price', value: 'Price', icon: 'mdi-order-numeric-ascending' },
{ key: '-date', value: 'Price Date', icon: 'mdi-calendar' },
{ key: '-created', value: 'Addition date', icon: 'mdi-clock-outline' },
{ key: 'price', value: 'OrderPriceASC', icon: 'mdi-order-numeric-ascending' },
{ key: '-date', value: 'OrderPriceDateDESC', icon: 'mdi-calendar' },
{ key: '-created', value: 'OrderPriceCreatedDESC', icon: 'mdi-clock-outline' },
],
// https://wiki.openstreetmap.org/wiki/Key:place
// https://wiki.openstreetmap.org/wiki/Key:highway
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
"AddToOFF": "Add to {name}",
"Filter": "Filter",
"Order": "Order",
"OrderPriceASC": "Price",
"OrderPriceCreatedDESC": "Addition date",
"OrderPriceDateDESC": "Price date",
"SignInOFFAccount": "Sign in with your {url} account",
"Yes": "Yes",
"No": "No"
Expand Down
2 changes: 1 addition & 1 deletion src/views/LocationDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</template>
<v-list>
<v-list-item :slim="true" v-for="order in priceOrderList" :key="order.key" :prepend-icon="order.icon" :active="priceOrder === order.key" @click="selectPriceOrder(order.key)">
{{ order.value }}
{{ $t('Common.' + order.value) }}
</v-list-item>
</v-list>
</v-menu>
Expand Down
2 changes: 1 addition & 1 deletion src/views/ProductDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</template>
<v-list>
<v-list-item :slim="true" v-for="order in priceOrderList" :key="order.key" :prepend-icon="order.icon" :active="priceOrder === order.key" @click="selectPriceOrder(order.key)">
{{ order.value }}
{{ $t('Common.' + order.value) }}
</v-list-item>
</v-list>
</v-menu>
Expand Down
2 changes: 1 addition & 1 deletion src/views/UserDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</template>
<v-list>
<v-list-item :slim="true" v-for="order in priceOrderList" :key="order.key" :prepend-icon="order.icon" :active="priceOrder === order.key" @click="selectPriceOrder(order.key)">
{{ order.value }}
{{ $t('Common.' + order.value) }}
</v-list-item>
</v-list>
</v-menu>
Expand Down

0 comments on commit 6ef5de6

Please sign in to comment.