From 30013f2c348d666938ca0ecfd9c229e392a6be08 Mon Sep 17 00:00:00 2001 From: tuannn2 Date: Mon, 3 Jul 2023 11:06:55 +0700 Subject: [PATCH] feat(component): Translate all strings in add component page Signed-off-by: tuannn2 --- messages/en.json | 36 +++++++++- messages/ja.json | 41 +++++++++++- messages/vi.json | 39 ++++++++++- messages/zh.json | 42 ++++++++++-- src/components/AddAdditionalRoles.tsx | 33 +++++----- src/components/AddKeyValue.tsx | 4 +- .../ComponentAddSummary.tsx | 15 +++-- .../GeneralInfoComponent.tsx | 66 ++++++++++--------- .../ComponentAddSummary/RolesInformation.tsx | 22 ++++--- src/components/SearchUsersModal.tsx | 13 ++-- src/components/SelectCountry.tsx | 7 +- .../ComponentOwnerDialog.tsx | 15 +++-- .../SearchModerators/ModeratorsDiaglog.tsx | 16 +++-- .../sw360/SearchVendorsModal/VendorDialog.tsx | 17 +++-- 14 files changed, 265 insertions(+), 101 deletions(-) diff --git a/messages/en.json b/messages/en.json index 6ca528b3..f7d73256 100644 --- a/messages/en.json +++ b/messages/en.json @@ -10,6 +10,8 @@ "Add Component": "Add Component", "Add License": "Add License", "Add Projects": "Add Projects", + "Add User": "Add User", + "Add Vendor": "Add Vendor", "Additional Data": "Additional Data", "Additional Roles": "Additional Roles", "Advanced Search": "Advanced Search", @@ -21,6 +23,7 @@ "Basic Info": "Basic Info", "Between": "Between", "Blog": "Blog", + "Blog URL": "Blog URL", "Categories": "Categories", "Change Log Id": "Change Log Id", "Change Log": "Change Log", @@ -35,14 +38,21 @@ "Clearing Report": "Clearing Report", "Clearing State": "Clearing State", "Close": "Close", + "Click to edit": "Click to edit", + "Click to add row to Additional Roles": "Click to add row to Additional Roles", + "Click to set vendor": "Click to set vendor", "Code Snippet": "Code Snippet", + "Committer": "Committer", "Components": "Components", "Components only": "Components Only", "Component Name": "Component Name", "Component Owner": "Component Owner", "Component Type": "Component Type", "Components Only": "Components Only", + "Component is created": "Component is created", + "Component is Duplicate": "Component is Duplicate", "Components with releases": "Components With Releases", + "Contributor": "Contributor", "COTS": "COTS", "Closed": "Closed", "Change Vulnerability Rating And Action?": "Change Vulnerability Rating And Action?", @@ -50,6 +60,7 @@ "Created By (Email)": "Created By (Email)", "Created by": "Created by", "Created On": "Created On", + "Create Component": "Create Component", "Customer Project": "Customer Project", "Date": "Date", "Default vendor": "Default vendor", @@ -70,17 +81,29 @@ "Edit component": "Edit component", "Email Address": "Email Address", "entries": "entries", + "Enter Owner Billing Group": "Enter Owner Billing Group", + "Enter Owner Accounting Unit Group": "Enter Owner Accounting Unit Group", + "Enter Owner Accounting Unit": "Enter Owner Accounting Unit", + "Enter Name": "Enter Name", + "Enter Blog URL": "Enter Blog URL", + "Enter Wiki URL": "Enter Wiki URL", + "Enter Mailing List URL": "Enter Mailing List URL", + "Enter Description": "Enter Description", + "Enter search text...": "Enter search text...", "Error when processing!": "Error when processing!", "Export Spreadsheet": "Export Spreadsheet", "External Id": "External Id", "External ids": "External ids", + "Expert": "Expert", "Field Name": "Field Name", "File name": "File name", "Freeware": "Freeware", "General": "General", + "General Information": "General Information", "Group": "Group", "Home": "Home", "Homepage": "Homepage", + "Homepage Url": "Homepage Url", "I could not delete the release, since it is used by another component (release) or project": "I could not delete the release, since it is used by another component (release) or project", "Import SBOM": "Import SBOM", "In order to go ahead, please sign in or create a new account!": "In order to go ahead, please sign in or create a new account!", @@ -99,7 +122,9 @@ "License Shortname": "License Shortname", "License Type": "License Type", "Logout": "Sign Out", + "Learn more about component types.": "Learn more about component types.", "Mailing list": "Mailing list", + "Mailing List URL": "Mailing List URL", "Main Licenses": "Main Licenses", "MAINLINE": "Mainline", "Matched by": "Matched by", @@ -152,6 +177,7 @@ "Release Overview": "Release Overview", "Requests": "Requests", "Release": "Release", + "Reset": "Reset", "REPORT_AVAILABLE": "Report Available", "Roles": "Roles", "SCAN_AVAILABLE": "Scan available", @@ -171,6 +197,11 @@ "Subscribers": "Subscribers", "Summary": "Summary", "SW360 is an open source software project that provides both a web application and a repository to collect, organize and make available information about software components It establishes a central hub for software components in an organization": "SW360 is an open source software project that provides both a web application and a repository to collect, organize and make available information about software components. It establishes a central hub for software components in an organization.", + "Search Vendor": "Search Vendor", + "Select a country": "Select a country", + "Select Users": "Select Users", + "Select User": "Select User", + "Select Vendor": "Select Vendor", "The component cannot be deleted, since it contains releases Please delete the releases first": "The component {name} cannot be deleted, since it contains {releaseCount} releases. Please delete the releases first.", "This release contains": "This release {name} contains: ", "Tag": "Tag", @@ -193,6 +224,9 @@ "Vulnerabilities": "Vulnerabilities", "Vulnerability matching statistics": "Vulnerability matching statistics", "Welcome to SW360!": "Welcome to SW360!", - "Wiki": "Wiki" + "Wiki": "Wiki", + "Will be set auto": "Will be set auto", + "Will be set automatically": "Will be set automatically", + "Wiki URL": "Wiki Url" } } diff --git a/messages/ja.json b/messages/ja.json index de6fa5ad..7b3b32af 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -11,6 +11,8 @@ "Add Component": "コンポーネントの追加", "Add License": "NOT TRANSLATED", "Add Projects": "NOT TRANSLATED", + "Add User": "ユーザーを追加する", + "Add Vendor": "ベンダーを追加", "Additional Data": "追加データ", "Additional Roles": "追加ロール", "Advance Search": "高度な検索", @@ -22,6 +24,8 @@ "Basic Info": "基本情報", "Between": "間", "Blog": "ブログ", + "Blog URL": "ブログURL", + "Cancel" : "キャンセル", "CHECKED": "チェック済み", "Categories": "カテゴリ", "Change Log": "変更履歴", @@ -36,22 +40,30 @@ "Clearing Report": "クリアリングレポート", "Clearing State": "クリアリングステータス", "Close": "キャンセル", - "Closed": "NOT TRANSLATED", + "Closed": "近い", "Code Snippet": "コードスニペット", "Component Name": "コンポーネント名", "Component Owner": "コンポーネントオーナー", "Component Type": "コンポーネントタイプ", - "Components": "NOT TRANSLATED", + "Components": "コミッター", + "Committer": "コミッター", "Components Only": "コンポーネントのみ", + "Component is created": "コンポーネントが作成されました", + "Component is Duplicate": "コンポーネントが重複しています", "Components With Releases": "リリースされたコンポーネント", "Components only": "NOT TRANSLATED", "Components with releases": "NOT TRANSLATED", + "Contributor": "投稿者", + "Click to edit": "クリックして編集する", + "Click to add row to Additional Roles": "クリックして行を「追加の役割」に追加します。", + "Click to set vendor": "クリックしてベンダーを設定します", "COTS": "COTS", "Change Vulnerability Rating And Action?": "脆弱性レートとそのアクションを変更しますか?", "Create Account": "アカウントの作成", "Created By (Email)": "Created by (Email)", "Created On": "作成日", "Created by": "作成日", + "Create Component": "コンポーネントの作成", "Customer Project": "NOT TRANSLATED", "DENIED": "拒否", "DOWNLOAD": "ダウンロード", @@ -61,7 +73,7 @@ "Delete component success!": "コンポーネントの削除が成功しました。", "Delete release success!": "削除リリース成功!", "Delete Release": "リリースの削除", - "Description": "NOT TRANSLATED", + "Description": "説明", "Do you really want to delete the component?": "本当にコンポーネント {name} を削除しますか?", "Do you really want to delete the release?": "本当にリリース: {name}?", "Document Id": "ドキュメントID", @@ -75,13 +87,25 @@ "Export Spreadsheet": "SBOMのインポート", "External Id": "外部ID", "External ids": "外部ID", + "Expert": "エキスパート", + "Enter Owner Billing Group": "所有者の請求先グループを入力してください", + "Enter Owner Accounting Unit Group": "所有者の会計単位グループを入力してください", + "Enter Owner Accounting Unit": "所有者の会計単位を入力してください", + "Enter Name": "名前を入力", + "Enter Blog URL": "ブログの URL を入力してください", + "Enter Wiki URL": "Wiki の URL を入力してください", + "Enter Mailing List URL": "メーリング リストの URL を入力してください", + "Enter Description": "説明を入力してください", + "Enter search text...": "検索テキストを入力してください...", "Field Name": "フィールド名", "File name": "ファイル名", "Freeware": "フリーウェア", "General": "一般的な", + "General Information": "一般情報", "Group": "グループ", "Home": "NOT TRANSLATED", "Homepage": "ホームページ", + "Homepage Url": "ホームページの URL", "I could not delete the release, since it is used by another component (release) or project": "リリースは他のコンポーネント(リリース)やプロジェクトで使用されているため、削除できませんでした。", "INCORRECT": "間違い", "INTERNAL_USE_SCAN_AVAILABLE": "Internal Use Scan Available", @@ -100,8 +124,10 @@ "License Type": "NOT TRANSLATED", "Licenses": "NOT TRANSLATED", "Logout": "ログアウト", + "Learn more about component types.": "コンポーネントの種類について詳しくは、こちらをご覧くだ い。", "MAINLINE": "メインライン", "Mailing list": "メーリングリスト", + "Mailing List URL": "メーリングリストのURL", "Main Licenses": "メインライセンス", "Matched by": "匹配者", "Merge": "マージ", @@ -155,11 +181,17 @@ "Release Overview": "リリース概要", "Requests": "NOT TRANSLATED", "Roles": "役割", + "Reset": "リセット", "SCAN_AVAILABLE": "Scan available", "SENT_TO_CLEARING_TOOL": "クリアリングツールに送る", "SPECIFIC": "特定の", "SW360 is an open source software project that provides both a web application and a repository to collect, organize and make available information about software components It establishes a central hub for software components in an organization": "SW360は、ソフトウェアコンポーネントに関する情報を収集、整理、利用可能にするためのウェブアプリケーションとリポジトリの両方を提供するオープンソースのソフトウェアプロジェクトです。SW360は、組織内のソフトウェアコンポーネントの一元化を行います。", "Search": "検索", + "Search Vendor": "ベンダーを検索", + "Select a country": "国を選択", + "Select Users": "ユーザーを選択", + "Select User": "ユーザーを選択", + "Select Vendor": "ベンダーを選択してください", "Service": "サービス", "Show": "", "Sign In": "サインイン", @@ -195,6 +227,9 @@ "Vulnerability matching statistics": "脆弱性マッチング統計", "Welcome to SW360!": "SW360へようこそ!", "Wiki": "Wiki", + "Will be set auto": "自動に設定されます", + "Will be set automatically": "自動的に設定されます", + "Wiki URL": "ウィキの URL", "entries": "件表示" } } \ No newline at end of file diff --git a/messages/vi.json b/messages/vi.json index 8f149278..6b12933a 100644 --- a/messages/vi.json +++ b/messages/vi.json @@ -11,18 +11,22 @@ "Add Component": "Thêm thành phần", "Add License": "NOT TRANSLATED", "Add Projects": "NOT TRANSLATED", + "Add User": "Thêm Người Dùng", "Additional Data": "Dữ liệu bổ sung", "Additional Roles": "Vai trò bổ sung", "Advance Search": "Tìm Kiếm Nâng Cao", "Advanced Search": "NOT TRANSLATED", "Approved Releases": "NOT TRANSLATED", + "Add Vendor": "Thêm Người bán", "Attachments": "Tệp đính kèm", "Attributes change": "Thay đổi thuộc tính", "Authentication failed Please try again": "Đăng nhập thất bại. Vui lòng thử lại.", "Basic Info": "Basic Info", "Between": "Trong Khoảng", "Blog": "Blog", + "Blog URL": "Blog Url", "CHECKED": "ĐÃ KIỂM TRA", + "Cancel" : "Hủy bỏ", "Categories": "Thể loại", "Change Log": "Change Log", "Change Log Id": "Change Log Id", @@ -41,15 +45,23 @@ "Component Name": "Tên thành phần", "Component Owner": "Chủ sở hữu thành phần", "Component Type": "Loại thành phần", - "Components": "NOT TRANSLATED", + "Components": "Thành Phần", "Components Only": "Chỉ thành phần", "Components With Releases": "Các thành phần có bản phát hành", "Components only": "NOT TRANSLATED", "Components with releases": "NOT TRANSLATED", + "Component is created": "Thành Phần đã được tạo", + "Component is Duplicate": "Thành Phần đã tồn tại", + "Committer": "Ủy viên", + "Contributor": "Người đóng góp", "COTS": "COTS", "Change Vulnerability Rating And Action?": "Change Vulnerability Rating And Action?", + "Click to edit": "Nhấp để sửa", + "Click to add row to Additional Roles": "Nhấp để thêm hàng vào Vai trò bổ sung", + "Click to set vendor": "Nhấp để đặt nhà cung cấp", "Create Account": "Tạo Tài Khoản", "Created By (Email)": "Được Tạo Bởi (Email)", + "Create Component": "Tạo Thành Phần", "Created On": "Được Tạo Vào", "Created by": "Được tạo bởi", "Customer Project": "NOT TRANSLATED", @@ -61,7 +73,7 @@ "Delete component success!": "Xóa thành phần thành công!", "Delete release success!": "Xóa bản phát hành thành công!", "Delete Release": "Xóa bản phát hành", - "Description": "NOT TRANSLATED", + "Description": "Sự miêu tả", "Do you really want to delete the component?": "Bạn có thực sự muốn xóa thành phần {name}?", "Do you really want to delete the release?": "Bạn có chắc chắn muốn xóa bản phát hành: {name}?", "Document Id": "Document Id", @@ -75,13 +87,25 @@ "Export Spreadsheet": "Xuất bảng tính", "External Id": "Id bên ngoài", "External ids": "Id bên ngoài", + "Expert": "Chuyên gia", + "Enter Owner Billing Group": "Nhập Owner Billing Group", + "Enter Owner Accounting Unit Group": "Nhập Owner Billing Group", + "Enter Owner Accounting Unit": "Nhập Owner Billing", + "Enter Name": "Nhập Tên", + "Enter Blog URL": "Nhập Url Blog", + "Enter Wiki URL": "Nhập Url Wiki", + "Enter Mailing List URL": "Nhập Url Danh sách gửi thư", + "Enter Description": "Nhập Miêu tả", + "Enter search text...": "Nhập từ tìm kiếm...", "Field Name": "Tên trường", "File name": "Tên tệp", "Freeware": "Phần mềm miễn phí", "General": "Chung", + "General Information": "Thông tin chung", "Group": "Nhóm", "Home": "NOT TRANSLATED", "Homepage": "Trang chủ", + "Homepage Url": "Trang chủ Url", "I could not delete the release, since it is used by another component (release) or project": "Tôi không thể xóa bản phát hành, vì nó được sử dụng bởi một thành phần (bản phát hành) hoặc dự án khác", "INCORRECT": "Sai", "INTERNAL_USE_SCAN_AVAILABLE": "Internal Use Scan Available", @@ -94,6 +118,7 @@ "Internal Project": "NOT TRANSLATED", "Is Checked": "NOT TRANSLATED", "Languages": "Ngôn ngữ", + "Learn more about component types.": "Tìm hiểu thêm về các loại thành phần.", "License Clearing": "NOT TRANSLATED", "License Fullname": "NOT TRANSLATED", "License Shortname": "NOT TRANSLATED", @@ -102,6 +127,7 @@ "Logout": "Đăng Xuất", "MAINLINE": "Đường chính", "Mailing list": "Danh sách gửi thư", + "Mailing List URL": "Danh sách gửi thư URL", "Main Licenses": "Giấy phép chính", "Matched by": "Phù hợp với", "Merge": "Hợp nhất", @@ -154,13 +180,19 @@ "Release Mainline State": "Trạng thái chính bản phát hành", "Release Overview": "Tổng quan bản phát hành", "Requests": "NOT TRANSLATED", + "Reset": "Còn lại", "Roles": "Vai trò", "SCAN_AVAILABLE": "Scan available", "SENT_TO_CLEARING_TOOL": "Sent to clearing tool", "SPECIFIC": "Riêng", "SW360 is an open source software project that provides both a web application and a repository to collect, organize and make available information about software components It establishes a central hub for software components in an organization": "SW360 là một dự án phần mềm nguồn mở cung cấp cả ứng dụng web và kho lưu trữ để thu thập, sắp xếp và cung cấp thông tin có sẵn về các thành phần của phần mềm. Nó thiết lập một trung tâm trung tâm cho các thành phần phần mềm trong một tổ chức.", "Search": "Tìm Kiếm", + "Search Vendor": "Tìm kiếm người bán", "Service": "Dịch vụ", + "Select a country": "Chọn Quốc Gia", + "Select Users": "Chọn Người dùng", + "Select User": "Chọn Người Dùng", + "Select Vendor": "Chọn Người bán", "Show": "Xem", "Sign In": "Đăng Nhập", "Size": "Kích thước", @@ -195,6 +227,9 @@ "Vulnerability matching statistics": "Thống kê phù hợp với lỗ hổng", "Welcome to SW360!": "Chào mừng bạn đến với SW360!", "Wiki": "Wiki", + "Will be set auto": "Sẽ được đặt thành", + "Will be set automatically": "Sẽ được thiết lập tự động", + "Wiki URL": "Wiki Url", "entries": "mục" } } \ No newline at end of file diff --git a/messages/zh.json b/messages/zh.json index 9671bf94..33efb29c 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -15,6 +15,8 @@ "Additional Roles": "附加角色", "Advance Search": "高级搜索", "Advanced Search": "NOT TRANSLATED", + "Add User": "添加用户", + "Add Vendor": "添加供应商", "Approved Releases": "NOT TRANSLATED", "Attachments": "附件", "Attributes change": "属性更改", @@ -22,8 +24,10 @@ "Basic Info": "基本信息", "Between": "之间", "Blog": "博客", + "Blog URL": "博客网址", "CHECKED": "已检查", "Categories": "类别", + "Cancel" : "取消", "Change Log": "更改日志", "Change Log Id": "更改日志 id", "Change State": "更改状态", @@ -36,16 +40,23 @@ "Clearing Report": "明确报告", "Clearing State": "明确状态", "Close": "取消", - "Closed": "NOT TRANSLATED", + "Closed": "关闭", "Code Snippet": "代码片段", "Component Name": "组件名称", "Component Owner": "组件所有者", "Component Type": "组件类型", - "Components": "NOT TRANSLATED", + "Components": "成分", + "Component is created": "组件已创建", + "Component is Duplicate": "组件重复", "Components Only": "仅组件", "Components With Releases": "具有发行版本的组件", "Components only": "NOT TRANSLATED", "Components with releases": "NOT TRANSLATED", + "Committer": "提交者", + "Contributor": "贡献者", + "Click to edit": "点击编辑", + "Click to add row to Additional Roles": "单击将行添加到其他角色", + "Click to set vendor":"点击设置供应商", "COTS": "COTS", "Change Vulnerability Rating And Action?": "是否更改漏洞等级和操作?", "Create Account": "创建账户", @@ -61,7 +72,7 @@ "Delete component success!": "删除组件成功!", "Delete release success!": "删除发布成功!", "Delete Release": "删除发行版本", - "Description": "NOT TRANSLATED", + "Description": "描述", "Do you really want to delete the component?": "确定删除组件 {name}?", "Do you really want to delete the release?": "确定删除发行版本: {name}?", "Document Id": "文档ID", @@ -75,13 +86,25 @@ "Export Spreadsheet": "导出电子表格", "External Id": "外部ID", "External ids": "外部ID", + "Expert": "专家", + "Enter Owner Billing Group": "输入所有者计费组", + "Enter Owner Accounting Unit Group":"输入所有者会计单位组", + "Enter Owner Accounting Unit": "输入所有者会计单位", + "Enter Name": "输入名字", + "Enter Blog URL":"输入博客网址", + "Enter Wiki URL": "输入维基网址", + "Enter Mailing List URL": "输入邮件列表 URL", + "Enter Description": "输入描述", + "Enter search text...": "输入搜索文本...", "Field Name": "领域名称", "File name": "文件名", "Freeware": "免费软件", "General": "一般", + "General Information": "一般信息", "Group": "组", "Home": "NOT TRANSLATED", "Homepage": "主页", + "Homepage Url": "主页网址", "I could not delete the release, since it is used by another component (release) or project": "无法删除该版本,因为它正在被另一个组件或发行版本或项目使用", "INCORRECT": "不正确", "INTERNAL_USE_SCAN_AVAILABLE": "Internal Use Scan Available", @@ -100,8 +123,10 @@ "License Type": "NOT TRANSLATED", "Licenses": "NOT TRANSLATED", "Logout": "登出", + "Learn more about component types.": "了解有关组件类型的更多信息。", "MAINLINE": "主线", "Mailing list": "邮件列表", + "Mailing List URL": "邮件列表网址", "Main Licenses": "主许可证", "Matched by": "適合", "Merge": "合并", @@ -155,6 +180,7 @@ "Release Overview": "发行版本概述", "Requests": "NOT TRANSLATED", "Roles": "角色", + "Reset": "重置", "SCAN_AVAILABLE": "扫描可用", "SENT_TO_CLEARING_TOOL": "发送到明确工具", "SPECIFIC": "具体", @@ -172,6 +198,11 @@ "Subscribe": "订阅", "Subscribers": "订阅者", "Summary": "摘要", + "Search Vendor": "搜索供应商", + "Select a country": "选择一个国家", + "Select Users": "选择用户", + "Select User": "选择用户", + "Select Vendor": "选择供应商", "Tag": "NOT TRANSLATED", "The component cannot be deleted, since it contains releases Please delete the releases first": "组件 {name} 无法被删除,因为它包含发行版本 {releaseCount}。请先删除发行版本。", "This release contains": "发行版本 {name} 包含:", @@ -195,6 +226,9 @@ "Vulnerability matching statistics": "匹配漏洞统计", "Welcome to SW360!": "欢迎来到SW360!", "Wiki": "Wiki", - "entries": "entries" + "entries": "entries", + "Will be set auto": "将设置为自动", + "Will be set automatically": "将自动设置", + "Wiki URL": "维基网址" } } \ No newline at end of file diff --git a/src/components/AddAdditionalRoles.tsx b/src/components/AddAdditionalRoles.tsx index c001277d..a8ead903 100644 --- a/src/components/AddAdditionalRoles.tsx +++ b/src/components/AddAdditionalRoles.tsx @@ -12,6 +12,8 @@ import styles from "@/css/AddKeyValue.module.css" import { FaTrashAlt } from 'react-icons/fa'; import DocumentTypes from '@/object-types/enums/DocumentTypes'; import { RolesType } from '@/object-types/RolesType'; +import { useTranslations } from 'next-intl'; +import { COMMON_NAMESPACE } from '@/object-types/Constants'; interface Props { documentType?: string; @@ -25,6 +27,7 @@ interface Input { export default function AddAdditionalRolesComponent({documentType, setRoles}: Props) { + const t = useTranslations(COMMON_NAMESPACE); const [inputList, setInputList] = useState([]); const handleInputChange = (e: React.ChangeEvent, index: number) => { @@ -54,7 +57,7 @@ export default function AddAdditionalRolesComponent({documentType, setRoles}: Pr return( <>
-

Additional Roles

+

{t('Additional Roles')}

{ @@ -67,21 +70,21 @@ export default function AddAdditionalRolesComponent({documentType, setRoles}: Pr documentType === DocumentTypes.COMPONENT ? <> - - - + + + : <> - - - - - - - - - + + + + + + + + + } @@ -90,14 +93,14 @@ export default function AddAdditionalRolesComponent({documentType, setRoles}: Pr handleInputChange(e, j)} className="form-control" placeholder={`Enter email`} aria-describedby={`Email`} />
- +
) }) }
- +
diff --git a/src/components/AddKeyValue.tsx b/src/components/AddKeyValue.tsx index e1937d77..933fd494 100644 --- a/src/components/AddKeyValue.tsx +++ b/src/components/AddKeyValue.tsx @@ -12,6 +12,8 @@ import styles from '@/css/AddKeyValue.module.css' import { useState } from 'react' import { FaTrashAlt } from 'react-icons/fa' import { AddtionalDataType } from '@/object-types/AddtionalDataType' +import { useTranslations } from 'next-intl' +import { COMMON_NAMESPACE } from '@/object-types/Constants' interface Props { header: string @@ -88,7 +90,7 @@ export default function AddKeyValueComponent(props: Props) { onClick={() => handleRemoveClick(j)} className={`fw-bold btn btn-light button-plain`} > - + diff --git a/src/components/ComponentAddSummary/ComponentAddSummary.tsx b/src/components/ComponentAddSummary/ComponentAddSummary.tsx index 4ebb662a..75c95cae 100644 --- a/src/components/ComponentAddSummary/ComponentAddSummary.tsx +++ b/src/components/ComponentAddSummary/ComponentAddSummary.tsx @@ -26,11 +26,14 @@ import 'react-toastify/dist/ReactToastify.css' import GeneralInfoComponent from './GeneralInfoComponent' import RolesInformation from './RolesInformation' import { useState } from 'react' +import { useTranslations } from 'next-intl' +import { COMMON_NAMESPACE } from '@/object-types/Constants' interface Props { session: Session } export default function ComponentAddSummary({ session }: Props) { + const t = useTranslations(COMMON_NAMESPACE); const [selectedTab, setSelectedTab] = useState(CommonTabIds.SUMMARY) const router = useRouter() const [componentPayload, setComponentPayload] = useState({ @@ -121,10 +124,10 @@ export default function ComponentAddSummary({ session }: Props) { if (response.status == HttpStatus.CREATED) { const data = await response.json() - notify('Component is created', 'success') + notify(t('Component is created'), 'success') router.push('/components/detail/' + data.id) } else { - notify('Component is Duplicate', 'error') + notify(t('Component is Duplicate'), 'error') } } @@ -152,7 +155,7 @@ export default function ComponentAddSummary({ session }: Props) {
@@ -162,7 +165,7 @@ export default function ComponentAddSummary({ session }: Props) { className='btn btn-secondary' onClick={handleCancelClick} > - Cancel + {t('Cancel')}
@@ -187,14 +190,14 @@ export default function ComponentAddSummary({ session }: Props) {
diff --git a/src/components/ComponentAddSummary/GeneralInfoComponent.tsx b/src/components/ComponentAddSummary/GeneralInfoComponent.tsx index eb60509e..4334fbb0 100644 --- a/src/components/ComponentAddSummary/GeneralInfoComponent.tsx +++ b/src/components/ComponentAddSummary/GeneralInfoComponent.tsx @@ -16,14 +16,16 @@ import { Session } from '@/object-types/Session' import Vendor from '@/object-types/Vendor' import 'react-toastify/dist/ReactToastify.css' import ComponentPayload from '@/object-types/ComponentPayLoad' +import { useTranslations } from 'next-intl' +import { COMMON_NAMESPACE } from '@/object-types/Constants' interface Props { session: Session componentPayload: ComponentPayload setComponentPayload: React.Dispatch> } - const GeneralInfoComponent = ({ session, componentPayload, setComponentPayload}: Props) => { - +const GeneralInfoComponent = ({ session, componentPayload, setComponentPayload }: Props) => { + const t = useTranslations(COMMON_NAMESPACE) const [vendorName, setVendorName] = useState() const [dialogOpenVendor, setDialogOpenVendor] = useState(false) @@ -69,17 +71,17 @@ interface Props {
-

General Information

+

{t('General Information')}

Learn more about component types. @@ -155,14 +157,14 @@ interface Props {