fix: tags
parent
1003190dc0
commit
08bb6bf858
@ -1,72 +1,87 @@
|
|||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
type Tag = {
|
||||||
|
name: string
|
||||||
|
label: string
|
||||||
|
}
|
||||||
|
|
||||||
export const useTags = () => {
|
export const useTags = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
return [
|
const tags = [
|
||||||
{
|
{
|
||||||
name: 'search',
|
name: 'search',
|
||||||
label: t('pluginTags.search'),
|
label: t('pluginTags.tags.search'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'image',
|
name: 'image',
|
||||||
label: t('pluginTags.image'),
|
label: t('pluginTags.tags.image'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'videos',
|
name: 'videos',
|
||||||
label: t('pluginTags.videos'),
|
label: t('pluginTags.tags.videos'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'weather',
|
name: 'weather',
|
||||||
label: t('pluginTags.weather'),
|
label: t('pluginTags.tags.weather'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finance',
|
name: 'finance',
|
||||||
label: t('pluginTags.finance'),
|
label: t('pluginTags.tags.finance'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'design',
|
name: 'design',
|
||||||
label: t('pluginTags.design'),
|
label: t('pluginTags.tags.design'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'travel',
|
name: 'travel',
|
||||||
label: t('pluginTags.travel'),
|
label: t('pluginTags.tags.travel'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'social',
|
name: 'social',
|
||||||
label: t('pluginTags.social'),
|
label: t('pluginTags.tags.social'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'news',
|
name: 'news',
|
||||||
label: t('pluginTags.news'),
|
label: t('pluginTags.tags.news'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'medical',
|
name: 'medical',
|
||||||
label: t('pluginTags.medical'),
|
label: t('pluginTags.tags.medical'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'productivity',
|
name: 'productivity',
|
||||||
label: t('pluginTags.productivity'),
|
label: t('pluginTags.tags.productivity'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'education',
|
name: 'education',
|
||||||
label: t('pluginTags.education'),
|
label: t('pluginTags.tags.education'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'business',
|
name: 'business',
|
||||||
label: t('pluginTags.business'),
|
label: t('pluginTags.tags.business'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'entertainment',
|
name: 'entertainment',
|
||||||
label: t('pluginTags.entertainment'),
|
label: t('pluginTags.tags.entertainment'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'utilities',
|
name: 'utilities',
|
||||||
label: t('pluginTags.utilities'),
|
label: t('pluginTags.tags.utilities'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'other',
|
name: 'other',
|
||||||
label: t('pluginTags.other'),
|
label: t('pluginTags.tags.other'),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const tagsMap = tags.reduce((acc, tag) => {
|
||||||
|
acc[tag.name] = tag
|
||||||
|
return acc
|
||||||
|
}, {} as Record<string, Tag>)
|
||||||
|
|
||||||
|
return {
|
||||||
|
tags,
|
||||||
|
tagsMap,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,24 @@
|
|||||||
const translation = {
|
const translation = {
|
||||||
search: 'Search',
|
allTags: 'All Tags',
|
||||||
image: 'Image',
|
searchTags: 'Search Tags',
|
||||||
videos: 'Videos',
|
tags: {
|
||||||
weather: 'Weather',
|
search: 'Search',
|
||||||
finance: 'Finance',
|
image: 'Image',
|
||||||
design: 'Design',
|
videos: 'Videos',
|
||||||
travel: 'Travel',
|
weather: 'Weather',
|
||||||
social: 'Social',
|
finance: 'Finance',
|
||||||
news: 'News',
|
design: 'Design',
|
||||||
medical: 'Medical',
|
travel: 'Travel',
|
||||||
productivity: 'Productivity',
|
social: 'Social',
|
||||||
education: 'Education',
|
news: 'News',
|
||||||
business: 'Business',
|
medical: 'Medical',
|
||||||
entertainment: 'Entertainment',
|
productivity: 'Productivity',
|
||||||
utilities: 'Utilities',
|
education: 'Education',
|
||||||
other: 'Other',
|
business: 'Business',
|
||||||
|
entertainment: 'Entertainment',
|
||||||
|
utilities: 'Utilities',
|
||||||
|
other: 'Other',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translation
|
export default translation
|
||||||
|
|||||||
@ -1,20 +1,24 @@
|
|||||||
const translation = {
|
const translation = {
|
||||||
search: '搜索',
|
allTags: '所有标签',
|
||||||
image: '图片',
|
searchTags: '搜索标签',
|
||||||
videos: '视频',
|
tags: {
|
||||||
weather: '天气',
|
search: '搜索',
|
||||||
finance: '金融',
|
image: '图片',
|
||||||
design: '设计',
|
videos: '视频',
|
||||||
travel: '旅行',
|
weather: '天气',
|
||||||
social: '社交',
|
finance: '金融',
|
||||||
news: '新闻',
|
design: '设计',
|
||||||
medical: '医疗',
|
travel: '旅行',
|
||||||
productivity: '生产力',
|
social: '社交',
|
||||||
education: '教育',
|
news: '新闻',
|
||||||
business: '商业',
|
medical: '医疗',
|
||||||
entertainment: '娱乐',
|
productivity: '生产力',
|
||||||
utilities: '工具',
|
education: '教育',
|
||||||
other: '其他',
|
business: '商业',
|
||||||
|
entertainment: '娱乐',
|
||||||
|
utilities: '工具',
|
||||||
|
other: '其他',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translation
|
export default translation
|
||||||
|
|||||||
Loading…
Reference in New Issue