Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Update audio categories (#1168)
Krystle Salazar0a95be1f97b9
diff --git a/src/components/VAudioDetails/VAudioDetails.vue b/src/components/VAudioDetails/VAudioDetails.vueindex e326f7685..8b3b280cd 100644--- a/src/components/VAudioDetails/VAudioDetails.vue+++ b/src/components/VAudioDetails/VAudioDetails.vue@@ -30,7 +30,7 @@<div v-if="audio.category"><dt>{{ $t('audio-details.table.category') }}</dt><dd>- {{ audio.category }}+ {{ $t(`filters.audio-categories.${audio.category}`) }}</dd></div><div v-if="audio.sample_rate">diff --git a/src/components/VAudioTrack/layouts/VBoxLayout.vue b/src/components/VAudioTrack/layouts/VBoxLayout.vueindex 4e93505a0..3d4aa8bd3 100644--- a/src/components/VAudioTrack/layouts/VBoxLayout.vue+++ b/src/components/VAudioTrack/layouts/VBoxLayout.vue@@ -17,7 +17,7 @@hide-name:license="audio.license"/>- <div>{{ $t(`audio-categories.${audio.category}`) }}</div>+ <div>{{ $t(`filters.audio-categories.${audio.category}`) }}</div></div></div>diff --git a/src/components/VAudioTrack/layouts/VRowLayout.vue b/src/components/VAudioTrack/layouts/VRowLayout.vueindex f50eaa91a..cbf7b80aa 100644--- a/src/components/VAudioTrack/layouts/VRowLayout.vue+++ b/src/components/VAudioTrack/layouts/VRowLayout.vue@@ -55,7 +55,7 @@</span><span v-if="audio.category">- <span>{{ $t(`audio-categories.${audio.category}`) }}</span+ <span>{{ $t(`filters.audio-categories.${audio.category}`) }}</span><span class="mx-2">{{ $t('interpunct') }}</span></span>diff --git a/src/constants/filters.ts b/src/constants/filters.tsindex 09703567b..60f5ae209 100644--- a/src/constants/filters.ts+++ b/src/constants/filters.ts@@ -61,7 +61,14 @@ export const mediaUniqueFilterKeys = deepFreeze<const filterCodesPerCategory = deepFreeze<Record<FilterCategory, string[]>>({licenses: [...ACTIVE_LICENSES],licenseTypes: ['commercial', 'modification'],- audioCategories: ['music', 'sound', 'podcast'],+ audioCategories: [+ 'audiobook',+ 'music',+ 'news',+ 'podcast',+ 'pronunciation',+ 'sound_effect',+ ],imageCategories: ['photograph', 'illustration', 'digitized_artwork'],audioExtensions: ['mp3', 'ogg', 'flac'],imageExtensions: ['jpg', 'png', 'gif', 'svg'],diff --git a/src/locales/en.json b/src/locales/en.jsonindex 8d70debd3..ae3496109 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -288,9 +288,13 @@},"audio-categories": {"title": "Audio category",+ "audiobook": "Audiobook","music": "Music",- "sound": "Sound effects",- "podcast": "Podcast"+ "news": "News",+ "podcast": "Podcast",+ "pronunciation": "Pronunciation",+ "sound_effect": "Sound effects",+ "sound": "Sound effects"},"image-categories": {"title": "Image type",@@ -568,13 +572,6 @@"search": {"search": "Search"},- "audio-categories": {- "title": "Audio Category",- "music": "Music",- "sound": "Sound effects",- "podcast": "Podcast",- "pronunciation": "Pronunciation"- },"license-readable-names": {"cc0": "Zero","pdm": "Public Domain Mark",diff --git a/src/locales/po-files/openverse.pot b/src/locales/po-files/openverse.potindex 0eab71969..01a8c7de6 100644--- a/src/locales/po-files/openverse.pot+++ b/src/locales/po-files/openverse.pot@@ -4,7 +4,7 @@ msgid ""msgstr """Project-Id-Version: Openverse \n""Report-Msgid-Bugs-To: https://github.com/wordpress/openverse/issues \n"-"POT-Creation-Date: 2022-03-22T03:16:50+00:00\n"+"POT-Creation-Date: 2022-03-22T20:55:19+00:00\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"@@ -163,26 +163,6 @@ msgctxt "license-readable-names.nc-sampling+"msgid "NonCommercial Sampling Plus"msgstr ""-msgctxt "audio-categories.title"-msgid "Audio Category"-msgstr ""--msgctxt "audio-categories.music"-msgid "Music"-msgstr ""--msgctxt "audio-categories.sound"-msgid "Sound effects"-msgstr ""--msgctxt "audio-categories.podcast"-msgid "Podcast"-msgstr ""--msgctxt "audio-categories.pronunciation"-msgid "Pronunciation"-msgstr ""-#: src/components/VHeader/VSearchBar/VSearchButton.vue:4msgctxt "search.search"msgid "Search"@@ -1005,18 +985,34 @@ msgctxt "filters.audio-categories.title"msgid "Audio category"msgstr ""+msgctxt "filters.audio-categories.audiobook"+msgid "Audiobook"+msgstr ""+msgctxt "filters.audio-categories.music"msgid "Music"msgstr ""-msgctxt "filters.audio-categories.sound"-msgid "Sound effects"+msgctxt "filters.audio-categories.news"+msgid "News"msgstr ""msgctxt "filters.audio-categories.podcast"msgid "Podcast"msgstr ""+msgctxt "filters.audio-categories.pronunciation"+msgid "Pronunciation"+msgstr ""++msgctxt "filters.audio-categories.sound_effect"+msgid "Sound effects"+msgstr ""++msgctxt "filters.audio-categories.sound"+msgid "Sound effects"+msgstr ""+msgctxt "filters.audio-providers.title"msgid "Source"msgstr ""diff --git a/test/playwright/e2e/filters.spec.ts b/test/playwright/e2e/filters.spec.tsindex 181d6e346..1d839c106 100644--- a/test/playwright/e2e/filters.spec.ts+++ b/test/playwright/e2e/filters.spec.ts@@ -35,7 +35,7 @@ const assertCheckboxCount = async (const FILTER_COUNTS = {[ALL_MEDIA]: 11,- [AUDIO]: 23,+ [AUDIO]: 26,[IMAGE]: 70,}diff --git a/test/unit/specs/stores/search-store.spec.js b/test/unit/specs/stores/search-store.spec.jsindex c3d01466b..46eb40529 100644--- a/test/unit/specs/stores/search-store.spec.js+++ b/test/unit/specs/stores/search-store.spec.js@@ -382,9 +382,9 @@ describe('Search Store', () => {it.each`searchType | nextSearchType | expectedFilterCount${AUDIO} | ${IMAGE} | ${25}- ${IMAGE} | ${ALL_MEDIA} | ${34}+ ${IMAGE} | ${ALL_MEDIA} | ${37}${ALL_MEDIA} | ${VIDEO} | ${12}- ${VIDEO} | ${AUDIO} | ${21}+ ${VIDEO} | ${AUDIO} | ${24}${ALL_MEDIA} | ${IMAGE} | ${25}`('changing searchType clears all but $expectedFilterCount $nextSearchType filters ',@@ -415,10 +415,10 @@ describe('Search Store', () => {*/it.each`searchType | nextSearchType | expectedFilterCount- ${AUDIO} | ${ALL_MEDIA} | ${34}- ${IMAGE} | ${ALL_MEDIA} | ${34}- ${ALL_MEDIA} | ${ALL_MEDIA} | ${34}- ${VIDEO} | ${ALL_MEDIA} | ${34}+ ${AUDIO} | ${ALL_MEDIA} | ${37}+ ${IMAGE} | ${ALL_MEDIA} | ${37}+ ${ALL_MEDIA} | ${ALL_MEDIA} | ${37}+ ${VIDEO} | ${ALL_MEDIA} | ${37}`('changing searchType clears all but $expectedFilterCount ALL_MEDIA filters',async ({ searchType, nextSearchType, expectedFilterCount }) => {diff --git a/test/unit/specs/utils/search-query-transform.spec.js b/test/unit/specs/utils/search-query-transform.spec.jsindex 6d3486eb4..7dd3d78f8 100644--- a/test/unit/specs/utils/search-query-transform.spec.js+++ b/test/unit/specs/utils/search-query-transform.spec.js@@ -205,7 +205,7 @@ describe('searchQueryTransform', () => {{checked: false,code: 'soundEffects',- name: 'filters.audio-categories.sound-effects',+ name: 'filters.audio-categories.sound_effects',},{checked: false,