Merged PR 1048: 英語以外の言語選択時、一部が英語のままとなっている_実装・単体テスト

## 概要
商用環境にて、一部リテラルが別言語にした場合も英語表記ののままというご指摘がありました。
指摘対象の修正と他にも漏れがないか調査して合わせて修正しております。

### チケット
[OMDS_IS-492 英語以外の言語選択時、一部が英語のままとなっている](https://so-net.backlog.jp/board/OMDS_IS?selectedIssueKey=OMDS_IS-492&category=1074456203)

### 修正内容
修正内容はは以下の内容となっております
- ユーザー一覧画面
    - ユーザーのRoleについて:リテラル表 99,100,107行
    - ライセンス割り当てステータスについて : 540~543行目
- タスク一覧画面
    - タスクのステータスについて:160~164行目
    - タスクのPriorityとPriorityのステータスについて: 135行目、544、545行目

[単体テスト](https://ndstokyo.sharepoint.com//r/sites/SNC-OMDS/Shared%20Documents/%E4%BF%9D%E5%AE%88/10_%E3%83%86%E3%82%B9%E3%83%88%E9%96%A2%E9%80%A3/%E5%8D%98%E4%BD%93%E3%83%86%E3%82%B9%E3%83%88/OMDS_IS-492%20%E8%8B%B1%E8%AA%9E%E4%BB%A5%E5%A4%96%E3%81%AE%E8%A8%80%E8%AA%9E%E9%81%B8%E6%8A%9E%E6%99%82%E3%80%81%E4%B8%80%E9%83%A8%E3%81%8C%E8%8B%B1%E8%AA%9E%E3%81%AE%E3%81%BE%E3%81%BE%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%A6%E3%81%84%E3%82%8B/%E5%8D%98%E4%BD%93%E3%83%86%E3%82%B9%E3%83%88%E3%82%A8%E3%83%93%E3%83%87%E3%83%B3%E3%82%B9_OMDS_IS-492_%E8%8B%B1%E8%AA%9E%E4%BB%A5%E5%A4%96%E3%81%AE%E8%A8%80%E8%AA%9E%E9%81%B8%E6%8A%9E%E6%99%82%E3%80%81%E4%B8%80%E9%83%A8%E3%81%8C%E8%8B%B1%E8%AA%9E%E3%81%AE%E3%81%BE%E3%81%BE%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%A6%E3%81%84%E3%82%8B.xlsx?d=w3018e2715f4c402f83f23581ffbcf0c2&csf=1&web=1&e=DgoO0B)
[リテラル表](https://ndstokyo.sharepoint.com//r/sites/SNC-OMDS/Shared%20Documents/%E4%BF%9D%E5%AE%88/10_%E3%83%86%E3%82%B9%E3%83%88%E9%96%A2%E9%80%A3/%E5%8D%98%E4%BD%93%E3%83%86%E3%82%B9%E3%83%88/OMDS_IS-492%20%E8%8B%B1%E8%AA%9E%E4%BB%A5%E5%A4%96%E3%81%AE%E8%A8%80%E8%AA%9E%E9%81%B8%E6%8A%9E%E6%99%82%E3%80%81%E4%B8%80%E9%83%A8%E3%81%8C%E8%8B%B1%E8%AA%9E%E3%81%AE%E3%81%BE%E3%81%BE%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%A6%E3%81%84%E3%82%8B/%E3%83%A9%E3%83%99%E3%83%AB%E3%83%BB%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E7%AE%A1%E7%90%86_dictation_20250401_2.xlsx?d=w4f470fdc3aa948caae53c1c735295677&csf=1&web=1&e=AgX8ga)

画面のみの修正のためユニットテストは実施しておりません
This commit is contained in:
金村 勇祐 2025-04-23 02:05:10 +00:00
parent d9d6ccd60f
commit ef70deee14
8 changed files with 140 additions and 93 deletions

View File

@ -1,5 +1,3 @@
import type { RoleType } from "./types";
// LicenseStatusTypeの値を定数オブジェクトにする // LicenseStatusTypeの値を定数オブジェクトにする
export const LICENSE_STATUS = { export const LICENSE_STATUS = {
NORMAL: "Normal", NORMAL: "Normal",
@ -13,16 +11,3 @@ export const LICENSE_ALLOCATE_STATUS = {
ALLOCATED: "Allocated", ALLOCATED: "Allocated",
NOTALLOCATED: "Not Allocated", NOTALLOCATED: "Not Allocated",
} as const; } as const;
// NoLicenseの表示
export const NO_LICENSE = "No License" as const;
// ライセンスが割り当てられている場合の表示
export const LICENSE_NORMAL = "License Assigned" as const;
// Roleの表示名
export const ROLE_DISPLAY_NAME: Record<RoleType, string> = {
author: "Author",
typist: "Transcriptionist",
none: "None",
} as const;

View File

@ -9,11 +9,7 @@ import {
isLicenseStatusType, isLicenseStatusType,
isRoleType, isRoleType,
} from "./types"; } from "./types";
import { import { LICENSE_STATUS, LICENSE_ALLOCATE_STATUS } from "./constants";
LICENSE_STATUS,
LICENSE_ALLOCATE_STATUS,
ROLE_DISPLAY_NAME,
} from "./constants";
export const selectInputValidationErrors = (state: RootState) => { export const selectInputValidationErrors = (state: RootState) => {
const { name, email, role, authorId, encryption, encryptionPassword } = const { name, email, role, authorId, encryption, encryptionPassword } =
@ -180,8 +176,7 @@ export const selectUserViews = (state: RootState): UserView[] => {
prompt: convertedValues.prompt, prompt: convertedValues.prompt,
encryption: convertedValues.encryption, encryption: convertedValues.encryption,
authorId: convertedValues.authorId, authorId: convertedValues.authorId,
// roleに応じて表示名を変更する role,
role: ROLE_DISPLAY_NAME[role],
licenseStatus: convertedLicenseStatus, licenseStatus: convertedLicenseStatus,
expiration: convertedExpiration, expiration: convertedExpiration,
remaining: convertedRemaining, remaining: convertedRemaining,

View File

@ -439,7 +439,8 @@ const DictationPage: React.FC = (): JSX.Element => {
dispatch(listTypistsAsync()); dispatch(listTypistsAsync());
dispatch(listTypistGroupsAsync()); dispatch(listTypistGroupsAsync());
const url = `${import.meta.env.VITE_DESK_TOP_APP_SCHEME const url = `${
import.meta.env.VITE_DESK_TOP_APP_SCHEME
}:playback?audioId=${audioFileId}`; }:playback?audioId=${audioFileId}`;
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = url;
@ -922,6 +923,41 @@ const DictationPage: React.FC = (): JSX.Element => {
})(); })();
}, [dispatch]); }, [dispatch]);
const getTaskStatus = (taskStatus: string): string => {
switch (taskStatus) {
case STATUS.UPLOADED:
return t(getTranslationID("dictationPage.label.uploaded"));
case STATUS.PENDING:
return t(getTranslationID("dictationPage.label.pending"));
case STATUS.FINISHED:
return t(getTranslationID("dictationPage.label.finished"));
case STATUS.INPROGRESS:
return t(getTranslationID("dictationPage.label.inProgress"));
case STATUS.BACKUP:
return t(getTranslationID("dictationPage.label.backup"));
default:
return taskStatus;
}
};
const getTaskStatusIcon = (taskStatus: string): JSX.Element => {
switch (taskStatus) {
case STATUS.UPLOADED:
return <img src={uploaded} alt="Uploaded" />;
case STATUS.PENDING:
return <img src={pending} alt="Pending" />;
case STATUS.FINISHED:
return <img src={finished} alt="Finished" />;
case STATUS.INPROGRESS:
return <img src={inprogress} alt="InProgress" />;
case STATUS.BACKUP:
return <img src={backup} alt="Backup" />;
default:
// 予期せぬステータスの場合、アイコンを表示しない
return <span></span>;
}
};
return ( return (
<> <>
<BackupPopup isOpen={isBackupPopupOpen} onClose={onCloseBackupPopup} /> <BackupPopup isOpen={isBackupPopupOpen} onClose={onCloseBackupPopup} />
@ -1098,7 +1134,8 @@ const DictationPage: React.FC = (): JSX.Element => {
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
<button <button
type="submit" type="submit"
className={`${styles.menuLink} ${!isLoading ? styles.isActive : "" className={`${styles.menuLink} ${
!isLoading ? styles.isActive : ""
}`} }`}
> >
<img <img
@ -1158,7 +1195,9 @@ const DictationPage: React.FC = (): JSX.Element => {
</th> </th>
)} )}
{displayColumn.Priority && ( {displayColumn.Priority && (
<th className={styles.clm3}>Priority</th> <th className={styles.clm3}>
{t(getTranslationID("dictationPage.label.priority"))}
</th>
)} )}
{displayColumn.Encryption && ( {displayColumn.Encryption && (
<th className={styles.clm4}> <th className={styles.clm4}>
@ -1621,27 +1660,8 @@ const DictationPage: React.FC = (): JSX.Element => {
)} )}
{displayColumn.Status && ( {displayColumn.Status && (
<td className={styles.clm2}> <td className={styles.clm2}>
{(() => { {getTaskStatusIcon(x.status)}
switch (x.status) { {getTaskStatus(x.status)}
case STATUS.UPLOADED:
return (
<img src={uploaded} alt="Uploaded" />
);
case STATUS.PENDING:
return <img src={pending} alt="Pending" />;
case STATUS.FINISHED:
return (
<img src={finished} alt="Finished" />
);
case STATUS.INPROGRESS:
return (
<img src={inprogress} alt="InProgress" />
);
default:
return <img src={backup} alt="Backup" />;
}
})()}
{x.status}
</td> </td>
)} )}
{displayColumn.Priority && ( {displayColumn.Priority && (
@ -1652,8 +1672,14 @@ const DictationPage: React.FC = (): JSX.Element => {
}} }}
> >
{x.priority === "01" {x.priority === "01"
? PRIORITY.HIGH ? t(
: PRIORITY.NORMAL} getTranslationID("dictationPage.label.high")
)
: t(
getTranslationID(
"dictationPage.label.normal"
)
)}
</td> </td>
)} )}
{displayColumn.Encryption && ( {displayColumn.Encryption && (
@ -1797,7 +1823,8 @@ const DictationPage: React.FC = (): JSX.Element => {
)}`}</span> )}`}</span>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a <a
className={`${!isLoading && currentPage !== 1 ? styles.isActive : "" className={`${
!isLoading && currentPage !== 1 ? styles.isActive : ""
}`} }`}
onClick={getFirstPage} onClick={getFirstPage}
> >
@ -1805,7 +1832,8 @@ const DictationPage: React.FC = (): JSX.Element => {
</a> </a>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a <a
className={`${!isLoading && currentPage !== 1 ? styles.isActive : "" className={`${
!isLoading && currentPage !== 1 ? styles.isActive : ""
}`} }`}
onClick={getPrevPage} onClick={getPrevPage}
> >
@ -1814,7 +1842,8 @@ const DictationPage: React.FC = (): JSX.Element => {
{`${currentPage} of ${totalPage}`} {`${currentPage} of ${totalPage}`}
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a <a
className={`${!isLoading && currentPage < totalPage className={`${
!isLoading && currentPage < totalPage
? styles.isActive ? styles.isActive
: "" : ""
}`} }`}
@ -1824,7 +1853,8 @@ const DictationPage: React.FC = (): JSX.Element => {
</a> </a>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a <a
className={`${!isLoading && currentPage < totalPage className={`${
!isLoading && currentPage < totalPage
? styles.isActive ? styles.isActive
: "" : ""
}`} }`}
@ -1855,7 +1885,8 @@ const DictationPage: React.FC = (): JSX.Element => {
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a <a
onClick={onClickBackup} onClick={onClickBackup}
className={`${styles.menuLink} ${isAdmin ? styles.isActive : "" className={`${styles.menuLink} ${
isAdmin ? styles.isActive : ""
}`} }`}
> >
<img src={download} alt="" className={styles.menuIcon} /> <img src={download} alt="" className={styles.menuIcon} />

View File

@ -14,14 +14,10 @@ import {
} from "features/user"; } from "features/user";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { getTranslationID } from "translation"; import { getTranslationID } from "translation";
import { LicenseStatusType, UserView } from "features/user/types"; import { UserView } from "features/user/types";
import { import { LICENSE_STATUS } from "features/user/constants";
LICENSE_NORMAL,
LICENSE_STATUS,
NO_LICENSE,
} from "features/user/constants";
import { isApproveTier } from "features/auth"; import { isApproveTier } from "features/auth";
import { TIERS } from "components/auth/constants"; import { TIERS, USER_ROLES } from "components/auth/constants";
import { import {
changeUpdateUser, changeUpdateUser,
changeLicenseAllocateUser, changeLicenseAllocateUser,
@ -165,6 +161,33 @@ const UserListPage: React.FC = (): JSX.Element => {
const isTier5 = const isTier5 =
isApproveTier([TIERS.TIER5]) || delegationAccessToken !== null; isApproveTier([TIERS.TIER5]) || delegationAccessToken !== null;
const getUserRole = (userRole: string): string => {
switch (userRole) {
case USER_ROLES.AUTHOR:
return t(getTranslationID("userListPage.label.author"));
case USER_ROLES.TYPIST:
return t(getTranslationID("userListPage.label.transcriptionist"));
default:
return t(getTranslationID("userListPage.label.none"));
}
};
// ライセンスステータスに応じて、ライセンスステータスの文字列を返す
const getLicenseStatus = (licenseStatus: string): string => {
switch (licenseStatus) {
case LICENSE_STATUS.NOLICENSE:
return t(getTranslationID("userListPage.label.notAllocated"));
case LICENSE_STATUS.ALERT:
return t(getTranslationID("userListPage.label.alert"));
case LICENSE_STATUS.RENEW:
return t(getTranslationID("userListPage.label.renew"));
case LICENSE_STATUS.NORMAL:
return t(getTranslationID("userListPage.label.allocated"));
default:
return licenseStatus;
}
};
return ( return (
<> <>
<UserUpdatePopup <UserUpdatePopup
@ -421,7 +444,7 @@ const UserListPage: React.FC = (): JSX.Element => {
</ul> </ul>
</td> </td>
<td> {user.name}</td> <td> {user.name}</td>
<td>{user.role}</td> <td>{getUserRole(user.role)}</td>
<td>{user.authorId}</td> <td>{user.authorId}</td>
<td>{boolToElement(user.encryption)}</td> <td>{boolToElement(user.encryption)}</td>
<td>{boolToElement(user.prompt)}</td> <td>{boolToElement(user.prompt)}</td>
@ -524,15 +547,4 @@ const arrayToElement = (
)); ));
}; };
// ライセンスステータスに応じて、ライセンスステータスの文字列を返す
const getLicenseStatus = (licenseStatus: LicenseStatusType): string => {
if (licenseStatus === LICENSE_STATUS.NOLICENSE) {
return NO_LICENSE;
}
if (licenseStatus === LICENSE_STATUS.NORMAL) {
return LICENSE_NORMAL;
}
return licenseStatus;
};
export default UserListPage; export default UserListPage;

View File

@ -197,7 +197,11 @@
"promptLabel": "Eingabeaufforderung", "promptLabel": "Eingabeaufforderung",
"addUsers": "Benutzer hinzufügen", "addUsers": "Benutzer hinzufügen",
"forceEmailVerification": "E-Mail-Verifizierung erzwingen", "forceEmailVerification": "E-Mail-Verifizierung erzwingen",
"search": "Suche" "search": "Suche",
"allocated": "Lizenz zugewiesen",
"notAllocated": "Keine Liszenz",
"alert": "Alarm",
"renew": "Erneuern"
}, },
"text": { "text": {
"downloadExplain": "Bitte laden Sie die CSV-Beispieldatei herunter und geben Sie die erforderlichen Informationen gemäß den folgenden Regeln ein.", "downloadExplain": "Bitte laden Sie die CSV-Beispieldatei herunter und geben Sie die erforderlichen Informationen gemäß den folgenden Regeln ein.",
@ -318,7 +322,9 @@
"rawFileName": "Ursprünglicher Dateiname", "rawFileName": "Ursprünglicher Dateiname",
"fileNameSave": "Führen Sie eine Dateiumbenennung durch", "fileNameSave": "Führen Sie eine Dateiumbenennung durch",
"reopenDictation": "Status auf „Ausstehend“ ändern", "reopenDictation": "Status auf „Ausstehend“ ändern",
"search": "Suche" "search": "Suche",
"high": "Hoch",
"normal": "Normal"
} }
}, },
"cardLicenseIssuePopupPage": { "cardLicenseIssuePopupPage": {

View File

@ -197,7 +197,11 @@
"promptLabel": "Prompt", "promptLabel": "Prompt",
"addUsers": "Add User", "addUsers": "Add User",
"forceEmailVerification": "Force Email Verification", "forceEmailVerification": "Force Email Verification",
"search": "Search" "search": "Search",
"allocated": "License Assigned",
"notAllocated": "No License",
"alert": "Alert",
"renew": "Renew"
}, },
"text": { "text": {
"downloadExplain": "Please download the sample CSV file and apply the required information according to the rules below.", "downloadExplain": "Please download the sample CSV file and apply the required information according to the rules below.",
@ -318,7 +322,9 @@
"rawFileName": "Original File Name", "rawFileName": "Original File Name",
"fileNameSave": "Execute file rename", "fileNameSave": "Execute file rename",
"reopenDictation": "Change status to Pending", "reopenDictation": "Change status to Pending",
"search": "Search" "search": "Search",
"high": "High",
"normal": "Normal"
} }
}, },
"cardLicenseIssuePopupPage": { "cardLicenseIssuePopupPage": {

View File

@ -197,7 +197,11 @@
"promptLabel": "Solicitar", "promptLabel": "Solicitar",
"addUsers": "Agregar usuario", "addUsers": "Agregar usuario",
"forceEmailVerification": "Verificación forzada de correo electrónico", "forceEmailVerification": "Verificación forzada de correo electrónico",
"search": "Búsqueda" "search": "Búsqueda",
"allocated": "Licencia asignada",
"notAllocated": "Sin Lisencia",
"alert": "Alerta",
"renew": "Renovar"
}, },
"text": { "text": {
"downloadExplain": "Descargue el archivo CSV de muestra y aplique la información requerida de acuerdo con las reglas siguientes.", "downloadExplain": "Descargue el archivo CSV de muestra y aplique la información requerida de acuerdo con las reglas siguientes.",
@ -318,7 +322,9 @@
"rawFileName": "Nombre de archivo original", "rawFileName": "Nombre de archivo original",
"fileNameSave": "Ejecutar cambio de nombre de archivo", "fileNameSave": "Ejecutar cambio de nombre de archivo",
"reopenDictation": "Cambiar el estado a Pendiente", "reopenDictation": "Cambiar el estado a Pendiente",
"search": "Búsqueda" "search": "Búsqueda",
"high": "Alto",
"normal": "Normal"
} }
}, },
"cardLicenseIssuePopupPage": { "cardLicenseIssuePopupPage": {

View File

@ -197,7 +197,11 @@
"promptLabel": "Invite", "promptLabel": "Invite",
"addUsers": "Ajouter un utilisateur", "addUsers": "Ajouter un utilisateur",
"forceEmailVerification": "Forcer la vérification de l'e-mail", "forceEmailVerification": "Forcer la vérification de l'e-mail",
"search": "Recherche" "search": "Recherche",
"allocated": "Licence attribuée",
"notAllocated": "Pas de Lisence",
"alert": "Alerte",
"renew": "Renouveler"
}, },
"text": { "text": {
"downloadExplain": "Veuillez télécharger l'exemple de fichier CSV et appliquer les informations requises conformément aux règles ci-dessous.", "downloadExplain": "Veuillez télécharger l'exemple de fichier CSV et appliquer les informations requises conformément aux règles ci-dessous.",
@ -318,7 +322,9 @@
"rawFileName": "Nom du fichier d'origine", "rawFileName": "Nom du fichier d'origine",
"fileNameSave": "Exécuter le changement de nom du fichier", "fileNameSave": "Exécuter le changement de nom du fichier",
"reopenDictation": "Changer le statut en Suspendu", "reopenDictation": "Changer le statut en Suspendu",
"search": "Recherche" "search": "Recherche",
"high": "Haut",
"normal": "Normale"
} }
}, },
"cardLicenseIssuePopupPage": { "cardLicenseIssuePopupPage": {
@ -654,7 +660,7 @@
"label": { "label": {
"title": "Paramètre de suppression automatique de fichiers", "title": "Paramètre de suppression automatique de fichiers",
"autoFileDeleteCheck": "Suppression automatique des fichiers", "autoFileDeleteCheck": "Suppression automatique des fichiers",
"daysAnnotation": "Número de días desde que finalizó la transcripción para eliminar los archivos.", "daysAnnotation": "Nombre de jours à compter de la fin de la transcription pour supprimer les fichiers.",
"days": "Jours", "days": "Jours",
"saveButton": "Enregistrer les paramètres", "saveButton": "Enregistrer les paramètres",
"daysValidationError": "Veuillez saisir un nombre compris entre 1 et 999 pour les jours." "daysValidationError": "Veuillez saisir un nombre compris entre 1 et 999 pour les jours."