Skip to content

Commit

Permalink
Translate order by
Browse files Browse the repository at this point in the history
- Cleanup the store.
- Fix tests.
  • Loading branch information
Tirokk committed Apr 12, 2021
1 parent 16d8a42 commit 245be52
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 121 deletions.
16 changes: 4 additions & 12 deletions webapp/components/FilterMenu/DateSortFilter.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
<template>
<filter-menu-section :divider="false" class="date-sort-filter">
<template #filter-list>
<!-- Wolle 👇🏼 translations & click
<labeled-button
icon="user-plus"
:label="$t('filter-menu.following')"
:filled="filteredByUsersFollowed"
:title="$t('contribution.filterFollow')"
@click="toggleFilteredByFollowed(currentUser.id)"
/> -->
<li class="item">
<labeled-button
icon="sort-amount-asc"
:label="'Newest first'"
:label="$t('filter-menu.order.newest.label')"
:filled="orderBy === 'createdAt_desc'"
:title="'Sort posts by the newest first'"
:title="$t('filter-menu.order.newest.hint')"
@click="toggleOrder('createdAt_desc')"
/>
</li>
<li class="item">
<labeled-button
icon="sort-amount-desc"
:label="'Oldest first'"
:label="$t('filter-menu.order.oldest.label')"
:filled="orderBy === 'createdAt_asc'"
:title="'Sort posts by the oldest first'"
:title="$t('filter-menu.order.oldest.hint')"
@click="toggleOrder('createdAt_asc')"
/>
</li>
Expand Down
2 changes: 1 addition & 1 deletion webapp/components/FilterMenu/FilterMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<following-filter />
</div>
<div class="filter-menu-options">
<h2 class="title">{{ 'Sorted by …' }}</h2> <!-- Wolle -->
<h2 class="title">{{ $t('filter-menu.order-by') }}</h2> <!-- Wolle -->
<date-sort-filter />
</div>
</template>
Expand Down
27 changes: 13 additions & 14 deletions webapp/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,20 @@
"all": "Alle",
"categories": "Themenkategorien",
"emotions": "Emotionen",
"filter-by": "Filtern nach...",
"filter-by": "Filtern nach ...",
"following": "Benutzern, denen ich folge",
"languages": "Sprachen"
"languages": "Sprachen",
"order": {
"newest": {
"hint": "Sortiere die Neuesten nach vorn",
"label": "Neueste zuerst"
},
"oldest": {
"hint": "Sortiere die Ältesten nach vorn",
"label": "Älteste zuerst"
}
},
"order-by": "Sortieren nach ..."
},
"followButton": {
"follow": "Folgen",
Expand Down Expand Up @@ -779,18 +790,6 @@
"thanks": "Danke!",
"tribunal": "Registergericht"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": "Neueste"
},
"oldest": {
"label": "Älteste"
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "Neue Nutzungsbedingungen",
"termsAndConditionsNewConfirm": "Ich habe die neuen Nutzungsbedingungen durchgelesen und stimme zu.",
Expand Down
27 changes: 13 additions & 14 deletions webapp/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,20 @@
"all": "All",
"categories": "Categories of Content",
"emotions": "Emotions",
"filter-by": "Filter by...",
"filter-by": "Filter by ...",
"following": "Users I follow",
"languages": "Languages"
"languages": "Languages",
"order": {
"newest": {
"hint": "Sort posts by the newest first",
"label": "Newest first"
},
"oldest": {
"hint": "Sort posts by the oldest first",
"label": "Oldest first"
}
},
"order-by": "Order by ..."
},
"followButton": {
"follow": "Follow",
Expand Down Expand Up @@ -779,18 +790,6 @@
"thanks": "Thanks!",
"tribunal": "Registry court"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": "Newest"
},
"oldest": {
"label": "Oldest"
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "New Terms and Conditions",
"termsAndConditionsNewConfirm": "I have read and agree to the new terms of conditions.",
Expand Down
26 changes: 12 additions & 14 deletions webapp/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,19 @@
"all": "Todas",
"categories": "Categorías de contenido",
"emotions": "Emociones",
"filter-by": "Filtrar por...",
"filter-by": "Filtrar por ...",
"following": "Usuarios que sigo",
"languages": "Idiomas"
"languages": "Idiomas",
"order": {
"newest": {
"hint": null,
"label": "Más reciente"
},
"oldest": {
"hint": null,
"label": "Más antiguo"
}
}
},
"followButton": {
"follow": "Seguir",
Expand Down Expand Up @@ -702,18 +712,6 @@
"thanks": "¡Gracias!",
"tribunal": "Tribunal de registro"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": "Más reciente"
},
"oldest": {
"label": "Más antiguo"
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "Nuevos términos de uso",
"termsAndConditionsNewConfirm": "He leído y acepto los nuevos términos de uso.",
Expand Down
26 changes: 12 additions & 14 deletions webapp/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,19 @@
"all": "Toutes",
"categories": "Catégories de contenu",
"emotions": "Émotions",
"filter-by": "Filtrer par...",
"filter-by": "Filtrer par ...",
"following": "Utilisateurs que je suis",
"languages": "Langues"
"languages": "Langues",
"order": {
"newest": {
"hint": null,
"label": "Plus récent"
},
"oldest": {
"hint": null,
"label": "Le plus ancien"
}
}
},
"followButton": {
"follow": "Suivre",
Expand Down Expand Up @@ -670,18 +680,6 @@
"thanks": "Merci!",
"tribunal": "Tribunal de registre"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": "Plus récent"
},
"oldest": {
"label": "Le plus ancien"
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "Nouvelles conditions générales",
"termsAndConditionsNewConfirm": "J'ai lu et accepté les nouvelles conditions générales.",
Expand Down
24 changes: 11 additions & 13 deletions webapp/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,17 @@
"emotions": null,
"filter-by": null,
"following": null,
"languages": null
"languages": null,
"order": {
"newest": {
"hint": null,
"label": null
},
"oldest": {
"hint": null,
"label": null
}
}
},
"followButton": {
"follow": null,
Expand Down Expand Up @@ -620,18 +630,6 @@
"thanks": null,
"tribunal": "registro tribunale"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": null
},
"oldest": {
"label": null
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "Nuovi Termini e Condizioni",
"termsAndConditionsNewConfirm": "Ho letto e accetto le nuove condizioni generali di contratto.",
Expand Down
26 changes: 12 additions & 14 deletions webapp/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,19 @@
"all": "Todos",
"categories": "Categorias de Conteúdo",
"emotions": "Emoções",
"filter-by": "Filtrar por...",
"filter-by": "Filtrar por ...",
"following": "Usuários que eu sigo",
"languages": "Idiomas"
"languages": "Idiomas",
"order": {
"newest": {
"hint": null,
"label": "Mais recentes"
},
"oldest": {
"hint": null,
"label": "Mais antigos"
}
}
},
"followButton": {
"follow": "Seguir",
Expand Down Expand Up @@ -655,18 +665,6 @@
"thanks": "Obrigado(a)!",
"tribunal": "tribunal de registo"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": "Mais recentes"
},
"oldest": {
"label": "Mais antigos"
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "Novos Termos e Condições",
"termsAndConditionsNewConfirm": "Eu li e concordo com os novos termos de condições.",
Expand Down
26 changes: 12 additions & 14 deletions webapp/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,19 @@
"all": "Все",
"categories": "Категории",
"emotions": "",
"filter-by": "Другие фильтры",
"filter-by": "Другие фильтры ...",
"following": "Мои подписки",
"languages": "Языки"
"languages": "Языки",
"order": {
"newest": {
"hint": null,
"label": "Сначала новые"
},
"oldest": {
"hint": null,
"label": "Сначала старые"
}
}
},
"followButton": {
"follow": "Подписаться",
Expand Down Expand Up @@ -702,18 +712,6 @@
"thanks": "Спасибо!",
"tribunal": "Суд регистрации"
},
"store": {
"posts": {
"orderBy": {
"newest": {
"label": "Сначала новые"
},
"oldest": {
"label": "Сначала старые"
}
}
}
},
"termsAndConditions": {
"newTermsAndConditions": "Новые условия и положения",
"termsAndConditionsNewConfirm": "Я прочитал(а) и согласен(на) с новыми условиями.",
Expand Down
4 changes: 2 additions & 2 deletions webapp/pages/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe('PostIndex', () => {
// value: 'createdAt_desc',
// },
// ],
'posts/selectedOrder': () => () => 'createdAt_desc',
'posts/orderIcon': () => 'sort-amount-desc',
// 'posts/selectedOrder': () => () => 'createdAt_desc',
// 'posts/orderIcon': () => 'sort-amount-desc',
'posts/orderBy': () => 'createdAt_desc',
'auth/user': () => {
return { id: 'u23' }
Expand Down
18 changes: 9 additions & 9 deletions webapp/store/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ export const getters = {
// label: $t(option.key),
// }
// }),
selectedOrder: (state) => ({ $t }) => {
return {
...state.order,
label: $t(state.order.key),
}
},
// Wolle selectedOrder: (state) => ({ $t }) => {
// return {
// ...state.order,
// label: $t(state.order.key),
// }
// },
orderBy(state) {
// return state.order.value
return state.order
},
orderIcon(state) {
return state.order.icon
},
// Wolle orderIcon(state) {
// return state.order.icon
// },
}

0 comments on commit 245be52

Please sign in to comment.