Skip to content

Commit

Permalink
fix(i18n): unused translations keys
Browse files Browse the repository at this point in the history
  • Loading branch information
LamaEats authored and awinogradov committed May 16, 2023
1 parent 728fef8 commit cdbf82d
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"Teams": "Teams",
"Goals": "Goals",
"Projects": "Projects",
"Explore": "Explore",
"See what the Taskany community is most excited about today": "See what the Taskany community is most excited about today",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"Teams": "Команды",
"Goals": "Цели",
"Projects": "Проекты",
"Explore": "Обзор",
"See what the Taskany community is most excited about today": "Смотри, чем пользователи Taskany интересуются сегодня",
Expand Down
1 change: 0 additions & 1 deletion src/components/ExplorePageLayout/ExplorePageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const ExplorePageLayout: React.FC<ExplorePageLayoutProps> = ({ children }
const tabsMenuOptions: Array<[string, string]> = [
[tr('Top'), routes.exploreTopProjects()],
[tr('Projects'), routes.exploreProjects()],
// [tr('Goals'), routes.exploreGoals()],
];

return (
Expand Down
3 changes: 0 additions & 3 deletions src/components/GoalEditForm/GoalEditForm.i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"Something went wrong 😿": "Something went wrong 😿",
"We are saving your goal": "We are saving your goal...",
"Voila! Saved successfully 🎉": "Voila! Saved successfully 🎉",
"Edit the goal": "Edit the goal",
"Submit": "Save goal"
}
3 changes: 0 additions & 3 deletions src/components/GoalEditForm/GoalEditForm.i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"Something went wrong 😿": "Упс! Что-то пошло не так 😿",
"We are saving your goal": "Погоди немного, сохраняем цель...",
"Voila! Saved successfully 🎉": "Ура! Сохранили цель 🎉",
"Submit": "Сохранить",
"Edit the goal": "Редактирование цели"
}
8 changes: 0 additions & 8 deletions src/components/GoalForm/GoalForm.i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"Goal's title": "Goal's title",
"And its description": "And its description",
"Goal's title is required": "Goal's title is required",
"Goal's title must be a string": "Goal's title must be a string",
"Goal's title must be longer than 10 symbols": "Goal's title must be longer than 10 symbols",
"Goal's description must be longer than 10 symbols": "Goal's description must be longer than 10 symbols",
"Goal's description is required": "Goal's description is required",
"Goal's description must be a string": "Goal's description must be a string",
"Goal's project or team are required": "Goal's project or team are required",
"Assign": "Assign",
"Enter name or email": "Name/Email",
"Enter project or team title": "Team/Project",
"Schedule": "Schedule",
"Date input mask placeholder": "mm/dd/yyyy",
"Date input mask": "99/99/9999",
"State": "State",
Expand Down
8 changes: 0 additions & 8 deletions src/components/GoalForm/GoalForm.i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"Goal's title is required": "Название цели обязательно",
"Goal's title must be a string": "Название цели должно быть строкой",
"Goal's title must be longer than 10 symbols": "Название цели должно быть длинее 10х символов",
"Goal's description must be longer than 10 symbols": "Описание цели должно быть длинее 10х символов",
"Goal's description is required": "Описание цели обязательно",
"Goal's description must be a string": "Описание цели должно быть строкой",
"Goal's project or team are required": "Проект или команда обязательны",
"Assign": "Ответственный",
"Enter name or email": "Имя/Почта",
"Enter project or team title": "Команда/Проект",
"Schedule": "Срок",
"Date input mask placeholder": "dd.mm.yyyy",
"Date input mask": "99.99.9999",
"State": "Статус",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"dependsOn": "Depends on",
"blocks": "Blocks",
"relatedTo": "Related",
"Does issue have dependencies": "Does issue have dependencies",
"Add one": "Add one",
"Add dependency": "Add dependency",
"Kind": "Kind",
"Add": "Add"
"Add dependency": "Add dependency"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"dependsOn": "Зависит от",
"blocks": "Заблокировано",
"relatedTo": "Связано",
"Does issue have dependencies": "Ни от чего не зависит",
"Add one": "Добавить",
"Add dependency": "Добавить зависимость",
"Kind": "Тип зависимости",
"Add": "Добавить"
"Add dependency": "Добавить зависимость"
}
15 changes: 12 additions & 3 deletions src/components/IssueDependenciesForm/IssueDependenciesForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, useCallback, useState } from 'react';
import React, { ChangeEvent, useCallback, useMemo, useState } from 'react';
import styled from 'styled-components';
import { gapL, gapM } from '@taskany/colors';
import {
Expand Down Expand Up @@ -56,6 +56,15 @@ const IssueDependenciesForm: React.FC<IssueDependenciesFormProps> = ({ issue, on

const { data: goalsData } = trpc.goal.suggestions.useQuery(query);

const dependKeys = useMemo(
() => ({
[dependencyKind.blocks]: tr('blocks'),
[dependencyKind.dependsOn]: tr('dependsOn'),
[dependencyKind.relatedTo]: tr('relatedTo'),
}),
[],
);

const onDependencyDelete = useCallback(
(id: string, kind: dependencyKind) => {
issue &&
Expand Down Expand Up @@ -163,7 +172,7 @@ const IssueDependenciesForm: React.FC<IssueDependenciesFormProps> = ({ issue, on
<ArrowDownSmallIcon size="s" noWrap />
)
}
text={kind ? tr(kind) : undefined}
text={kind ? dependKeys[kind] : undefined}
ref={props.ref}
onClick={props.onClick}
/>
Expand All @@ -176,7 +185,7 @@ const IssueDependenciesForm: React.FC<IssueDependenciesFormProps> = ({ issue, on
onClick={props.onClick}
view="primary"
>
{tr(props.item)}
{dependKeys[props.item as dependencyKind]}
</StyledMenuItem>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,19 @@ export const IssueDependenciesListItem: React.FC<IssueDependenciesListItemProps>
};

export const IssueDependenciesList: React.FC<IssueDependenciesListProps> = ({ issue, onDelete, onEdit }) => {
const dependKeys = {
[dependencyKind.blocks]: tr('blocks'),
[dependencyKind.dependsOn]: tr('dependsOn'),
[dependencyKind.relatedTo]: tr('relatedTo'),
};

return (
<>
{Object.values(dependencyKind).map((kind) => (
<IssueDependenciesListItem
key={kind}
kind={kind}
title={tr(dependencyKind[kind])}
title={dependKeys[kind]}
dependencies={issue?.[kind] as GoalByIdReturnType[]}
onEdit={onEdit}
onDelete={onDelete}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"Participants": "Participants",
"Edit participants": "Edit participants",
"Already participating": "Already participating",
"Save": "Save",
"Add participants": "Add participants"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"Participants": "В главных ролях",
"Edit participants": "Состав участников",
"Already participating": "Уже участвуют",
"Save": "Сохранить",
"Add participants": "Добавить участников"
}
6 changes: 1 addition & 5 deletions src/components/PageHeader/PageHeader.i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"Goals": "Goals",
"Explore": "Explore",
"Create": "Create",
"Goal": "Goal",
"Project": "Project",
"Team": "Team"
"Explore": "Explore"
}
6 changes: 1 addition & 5 deletions src/components/PageHeader/PageHeader.i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"Goals": "Цели",
"Explore": "Обзор",
"Create": "Создать",
"Goal": "Цель",
"Project": "Проект",
"Team": "Команду"
"Explore": "Обзор"
}
8 changes: 0 additions & 8 deletions src/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ export const PageHeader: FC = () => {
href: routes.goals(),
title: tr('Goals'),
},
// {
// href: '',
// title: t('Issues'),
// },
// {
// href: '',
// title: t('Boards'),
// },
{
href: routes.exploreTopProjects(),
title: tr('Explore'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
{
"Ключ уже существует. Попробуй другой.": "Key {key} already exists. Please, try to use another key.",
"Ключ не может быть короче 3 символов": "Key must be 3 or longer characters",
"New project": "New project",
"New team": "New team",
"Create project": "Create project",
"Create team": "Create team",
"Title": "Title",
"Short description": "Short description",
"Pro tip!": "Pro tip!",
"Press key to create project": "Press {key} to create project.",
"Press key to create team": "Press {key} to create team.",
"Key already exists": "Key {key} already exists. Please, try to use another key.",
"Perfect! Issues and goals will look like": "{perfect} Issues and goals will look like: {issueKeyOne}, {issueKeyTwo}",
"Key must be 3 or longer characters": "Key must be 3 or longer characters",
"Assign": "Assign",
"Enter name or email": "Enter name or email",
"Flow": "Flow",
"Flow or state title": "Flow or state title",
"issue key one": "#{key}-42",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"New project": "Новый проект",
"New team": "Новая команда",
"Create project": "Создать проект",
"Create team": "Создать команду",
"Title": "Название",
"Short description": "Короткое описание",
"Pro tip!": "Держи совет!",
"Press key to create project": "Нажми {key} чтобы создать проект.",
"Press key to create team": "Нажми {key} чтобы создать команду.",
"Key already exists": "Ключ {key} уже существует. Попробуй другой.",
"Perfect! Issues and goals will look like": "{perfect} Задачи и цели будут выглядеть примерно так: {issueKeyOne}, {issueKeyTwo}.",
"Key must be 3 or longer characters": "Ключ не может быть короче 3 символов",
"Assign": "Ответственный",
"Enter name or email": "Имя или почта",
"Flow": "Флоу",
"Flow or state title": "Модель или статус",
"issue key one": "#{key}-42",
Expand Down
15 changes: 8 additions & 7 deletions src/components/RelativeTime/RelativeTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ interface RelativeTimeProps {
date: Date;
kind?: RelativeTimeKind;
}
const map: Record<RelativeTimeKind, I18nKey> = {
created: 'created',
updated: 'updated',
Created: 'Created',
Updated: 'Updated',
};

const RelativeTime: React.FC<RelativeTimeProps> = ({ kind, date }) => {
const { locale, ssrTime } = usePageContext();
Expand All @@ -32,6 +26,13 @@ const RelativeTime: React.FC<RelativeTimeProps> = ({ kind, date }) => {
setTime(Date.now());
}, [mounted]);

const map: Record<RelativeTimeKind, string> = {
created: tr('created'),
updated: tr('updated'),
Created: tr('Created'),
Updated: tr('Updated'),
};

useEffect(() => {
const interval = setInterval(() => {
setTime(Date.now());
Expand All @@ -42,7 +43,7 @@ const RelativeTime: React.FC<RelativeTimeProps> = ({ kind, date }) => {

return (
<>
{kind ? `${tr(map[kind])} ` : ''}
{kind ? map[kind] : ''}
<Light title={createLocaleDate(localeDate, { locale })}>{dateAgo(localeDate, time, { locale })}</Light>
</>
);
Expand Down
3 changes: 0 additions & 3 deletions src/components/UserSettingsPage/UserSettingsPage.i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"User name is required": "User name is required",
"User name must be a string": "User name must be a string",
"User name must be longer than 3 symbols": "User name must be longer than 3 symbol",
"Something went wrong 😿": "Something went wrong 😿",
"We are updating user settings": "We are updating user settings",
"Voila! Successfully updated 🎉": "Voila! Successfully updated 🎉",
Expand Down
3 changes: 0 additions & 3 deletions src/components/UserSettingsPage/UserSettingsPage.i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"User name is required": "Указание имени обязательно",
"User name must be a string": "Имя должно быть строкой",
"User name must be longer than 3 symbols": "Имя не может быть короче 3х символов",
"Something went wrong 😿": "Упс! Что-то пошло не так 😿",
"We are updating user settings": "Обновляем настройки",
"Voila! Successfully updated 🎉": "Ура! Успешно обновили 🎉",
Expand Down
7 changes: 0 additions & 7 deletions src/hooks/useCommentResource/useCommentResource.i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{
"Comments's description is required": "Comments's description is required",
"Comments's description must be a string": "Comments's description must be a string",
"Comments's description must be longer than 1 symbol": "Comments's description must be longer than 1 symbol",
"Something went wrong 😿": "Something went wrong 😿",
"We are publishing your comment": "We are publishing your comment",
"Voila! Comment is here 🎉": "Voila! Comment is here 🎉",
"We are updating your comment": "We are updating your comment",
"Comment updated": "Comment updated",
"Leave a comment": "Leave a comment...",
"Styling with markdown is supported": "Styling with markdown is supported",
"Comment": "Save",
"Cancel": "Cancel",
"We are deleting your comment": "We are deleting your comment",
"Comment removed": "Comment removed"
}
7 changes: 0 additions & 7 deletions src/hooks/useCommentResource/useCommentResource.i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{
"Comments's description is required": "Текст комментария обязателен",
"Comments's description must be a string": "Комментарий должен быть сторок",
"Comments's description must be longer than 1 symbol": "В комментарии должен быть хотя бы 1 символ",
"Something went wrong 😿": "Упс! Что-то пошло не так 😿",
"We are publishing your comment": "Погоди немного, сохраняем комментарий...",
"Voila! Comment is here 🎉": "Ура! комментарий сохранен 🎉",
"We are updating your comment": "Погоди немного, сохраняем комментарий...",
"Comment updated": "Ура! комментарий сохранен 🎉",
"Leave a comment": "Оставить комментарий...",
"Styling with markdown is supported": "Текст можно стилизовать с помощью Markdown разметки",
"Comment": "Сохранить",
"Cancel": "Отменить",
"We are deleting your comment": "Погоди немного, удаляем комментарий...",
"Comment removed": "Комментарий удалён"
}
4 changes: 0 additions & 4 deletions src/hooks/useProjectResource/useProjectResource.i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"Title is required": "Title is required",
"Title must be a string": "Title must be a string",
"Title must be longer than 2 symbols": "Title must be longer than 2 symbols",
"Title can be 50 symbols maximum": "Title can be 50 symbols maximum",
"Something went wrong 😿": "Something went wrong 😿",
"We are creating something new": "We are creating something new",
"Voila! It's here 🎉": "Voila! It is here 🎉",
Expand Down
4 changes: 0 additions & 4 deletions src/hooks/useProjectResource/useProjectResource.i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"Title is required": "Название обязательно",
"Title must be a string": "Название должно быть строкой",
"Title must be longer than 2 symbols": "Название должно быть длинее 2х символов",
"Title can be 50 symbols maximum": "Название должно быть не длинее 50 символов",
"Something went wrong 😿": "Упс! Что-то пошло не так 😿",
"We are creating something new": "Погоди немного, создаем кое-что новое...",
"Voila! It's here 🎉": "Ура! Всё готово 🎉",
Expand Down

0 comments on commit cdbf82d

Please sign in to comment.