diff --git a/.changeset/gentle-hornets-float.md b/.changeset/gentle-hornets-float.md new file mode 100644 index 00000000000..9f423734871 --- /dev/null +++ b/.changeset/gentle-hornets-float.md @@ -0,0 +1,5 @@ +--- +"@wso2is/console": patch +--- + +Generalize the i18n strings in API Resource related UIs diff --git a/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx b/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx index d59ed7a03ac..50faca42c49 100644 --- a/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx +++ b/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. + * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -21,6 +21,8 @@ import { Field, Form } from "@wso2is/form"; import { DocumentationLink, Message, useDocumentation } from "@wso2is/react-components"; import React, { FunctionComponent, ReactElement } from "react"; import { Trans, useTranslation } from "react-i18next"; +import { useSelector } from "react-redux"; +import { AppState } from "../../../../../../features/core/store"; import { ExtendedFeatureConfigInterface } from "../../../../../configs/models"; import { AuthorizationAPIResourceInterface } from "../../../models"; @@ -69,6 +71,7 @@ export const AddAPIResourceAuthorization: FunctionComponent state.config.ui.productName); /** * Prepare form values for submitting. @@ -94,7 +97,7 @@ export const AddAPIResourceAuthorization: FunctionComponent { t("extensions:develop.apiResource.wizard.addApiResource.steps.authorization.form." + - "rbacMessage") } + "rbacMessage", { productName }) } diff --git a/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx b/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx index 2932b468bd4..485e60b6919 100644 --- a/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx +++ b/apps/console/src/extensions/components/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. + * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -21,7 +21,9 @@ import { Field, FormField, FormValue, Forms, Validation } from "@wso2is/forms"; import { Hint } from "@wso2is/react-components"; import React, { FunctionComponent, MutableRefObject, ReactElement, useRef } from "react"; import { Trans, useTranslation } from "react-i18next"; +import { useSelector } from "react-redux"; import { Grid } from "semantic-ui-react"; +import { AppState } from "../../../../../../features/core/store"; import { ExtendedFeatureConfigInterface } from "../../../../../configs/models"; import { getAPIResourcesForIdenitifierValidation } from "../../../api"; import { APIResourcesConstants } from "../../../constants"; @@ -80,6 +82,7 @@ export const AddAPIResourceBasic: FunctionComponent = useRef(); + const productName: string = useSelector((state: AppState) => state.config.ui.productName); /** * Prepare form values for submitting. @@ -146,7 +149,8 @@ export const AddAPIResourceBasic: FunctionComponent + "form.fields.identifier.hint" } + tOptions={ { productName } }> We recommend using a URI as the identifier, but you do not need to make the URI publicly available since Asgardeo will not access your API. Asgardeo will use this identifier value as the audience(aud) claim in the @@ -173,7 +177,7 @@ export const AddAPIResourceBasic: FunctionComponent { t("extensions:develop.apiResource.wizard.addApiResource.steps.basic.form.fields." + - "name.hint") } + "name.hint", { productName }) } diff --git a/apps/console/src/extensions/components/application/components/api-authorization/wizard/authorize-api-resource.tsx b/apps/console/src/extensions/components/application/components/api-authorization/wizard/authorize-api-resource.tsx index 931e81a6a75..dc108e2291c 100644 --- a/apps/console/src/extensions/components/application/components/api-authorization/wizard/authorize-api-resource.tsx +++ b/apps/console/src/extensions/components/application/components/api-authorization/wizard/authorize-api-resource.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. + * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -35,9 +35,10 @@ import { } from "@wso2is/react-components"; import React, { FunctionComponent, ReactElement, SyntheticEvent, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { Dispatch } from "redux"; import { Dropdown, DropdownItemProps, DropdownProps, Grid, Header, Modal } from "semantic-ui-react"; +import { AppState } from "../../../../../../features/core/store"; import { useAPIResources } from "../../../../api-resources/api"; import { APIResourcesConstants } from "../../../../api-resources/constants"; import { APIResourceInterface, APIResourcePermissionInterface } from "../../../../api-resources/models"; @@ -78,6 +79,7 @@ export const AuthorizeAPIResource: FunctionComponent state.config.ui.productName); const [ allAPIResourcesListData, setAllAPIResourcesListData ] = useState([]); const [ isSubmitting, setIsSubmitting ] = useState(false); @@ -473,7 +475,8 @@ export const AuthorizeAPIResource: FunctionComponentThis field should be unique; once created, it is not editable.", + hint: "We recommend using a URI as the identifier, but you do not need to make the URI publicly available since {{ productName }} will not access your API. {{ productName }} will use this identifier value as the audience(aud) claim in the issued JWT tokens. <1>This field should be unique; once created, it is not editable.", label: "Identifier", placeholder: "https://api.bookmyhotel.com" }, @@ -724,7 +724,7 @@ export const extensions: Extensions = { authorization: { stepTitle: "Authorization", form: { - rbacMessage: "At present, Asgardeo exclusively supports Role-Based Access Control (RBAC) for authorization.", + rbacMessage: "At present, {{ productName }} exclusively supports Role-Based Access Control (RBAC) for authorization.", fields: { authorize: { label: "Requires authorization", @@ -919,7 +919,7 @@ export const extensions: Extensions = { hint: "Select the policy to authorize the API for the application." } }, - rbacPolicyMessage: "This API resource requires authorization and Asgardeo exclusively supports Role-Based Access Control (RBAC) for authorization.", + rbacPolicyMessage: "This API resource requires authorization and {{ productName }} exclusively supports Role-Based Access Control (RBAC) for authorization.", buttons: { finish: "Finish", cancel: "Cancel" diff --git a/apps/console/src/extensions/i18n/resources/fr-FR/extensions.ts b/apps/console/src/extensions/i18n/resources/fr-FR/extensions.ts index ed27d72a31f..893301ff0e3 100755 --- a/apps/console/src/extensions/i18n/resources/fr-FR/extensions.ts +++ b/apps/console/src/extensions/i18n/resources/fr-FR/extensions.ts @@ -703,14 +703,14 @@ export const extensions: Extensions = { name: { emptyValidate: "Le nom de l'affichage ne peut pas être vide", label: "Afficher un nom", - hint: "Nom significatif pour identifier votre ressource API dans Asgardeo.", + hint: "Nom significatif pour identifier votre ressource API dans {{ productName }}.", placeholder: "API des réservations" }, identifier: { emptyValidate: "L'identifiant ne peut pas être vide", alreadyExistsError: "L'identifiant existe déjà dans l'organisation.Veuillez en choisir un autre", invalid: "L'identifiant ne peut pas contenir d'espaces", - hint: "Nous vous recommandons d'utiliser une URI comme identifiant, mais vous n'avez pas besoin de rendre l'URI accessible au public car Asgardeo n'accèdera pas à votre API. Asgardeo utilisera cette valeur d'identifiant comme la réclamation d'audience(aud) dans les jetons JWT émis. <1>Ce champ devrait être unique;Une fois créé, il n'est pas modifiable.", + hint: "Nous vous recommandons d'utiliser une URI comme identifiant, mais vous n'avez pas besoin de rendre l'URI accessible au public car {{ productName }} n'accèdera pas à votre API. {{ productName }} utilisera cette valeur d'identifiant comme la réclamation d'audience(aud) dans les jetons JWT émis. <1>Ce champ devrait être unique;Une fois créé, il n'est pas modifiable.", label: "Identifiant", placeholder: "https://api.bookmyhotel.com" }, @@ -724,7 +724,7 @@ export const extensions: Extensions = { authorization: { stepTitle: "Autorisation", form: { - rbacMessage: "À l'heure actuelle, Asgardeo prend en charge exclusivement le contrôle d'accès basé sur les rôles (RBAC) pour l'autorisation.", + rbacMessage: "À l'heure actuelle, {{ productName }} prend en charge exclusivement le contrôle d'accès basé sur les rôles (RBAC) pour l'autorisation.", fields: { authorize: { label: "Nécessite une autorisation", @@ -920,7 +920,7 @@ export const extensions: Extensions = { hint: "Sélectionnez la politique pour autoriser l'API pour l'application." } }, - rbacPolicyMessage: "Cette ressource API nécessite l'autorisation et Asgardeo prend en charge exclusivement le contrôle d'accès basé sur les rôles (RBAC) pour l'autorisation.", + rbacPolicyMessage: "Cette ressource API nécessite l'autorisation et {{ productName }} prend en charge exclusivement le contrôle d'accès basé sur les rôles (RBAC) pour l'autorisation.", buttons: { finish: "Finir", cancel: "Annuler" diff --git a/apps/console/src/extensions/i18n/resources/si-LK/extensions.ts b/apps/console/src/extensions/i18n/resources/si-LK/extensions.ts index d64790f4610..425a9378011 100755 --- a/apps/console/src/extensions/i18n/resources/si-LK/extensions.ts +++ b/apps/console/src/extensions/i18n/resources/si-LK/extensions.ts @@ -693,14 +693,14 @@ export const extensions: Extensions = { name: { emptyValidate: "ප්රදර්ශන නම හිස් විය නොහැක", label: "ප්රදර්ශන නාමය", - hint: "Asgardeo හි ඔබගේ API සම්පත හඳුනා ගැනීම සඳහා අර්ථවත් නම.", + hint: "{{ productName }} හි ඔබගේ API සම්පත හඳුනා ගැනීම සඳහා අර්ථවත් නම.", placeholder: "වෙන්කරවා ගැනීම සදහා වූ API" }, identifier: { emptyValidate: "හඳුනාගැනුම හිස් විය නොහැක", alreadyExistsError: "හඳුනාගැනුම දැනටමත් සංවිධානය තුළ පවතී.කරුණාකර වෙනත් එකක් තෝරන්න", invalid: "හඳුනාගැනුමක අවකාශයන් අඩංගු විය නොහැක", - hint: "අනන්යතාවය ලෙස URI එකක් භාවිතා කිරීම අපි නිර්දේශ කරමු, නමුත් Asgardeo ඔබගේ API වෙත ප්‍රවේශ නොවන බැවින් ඔබට URI ප්‍රසිද්ධ කිරීමට අවශ්‍ය නොවේ. Asgardeo විසින් නිකුත් කරන ලද JWT ටෝකනවල ප්රේක්ෂක(aud) ප්රකාශය ලෙස මෙම හඳුනාගැනීම් අගය භාවිතා කරනු ඇත. <1>මෙම ක්ෂේත්රය අද්විතීය විය යුතුය;මැවූ පසු, එය සංස්කරණය කළ නොහැක.", + hint: "අනන්යතාවය ලෙස URI එකක් භාවිතා කිරීම අපි නිර්දේශ කරමු, නමුත් {{ productName }} ඔබගේ API වෙත ප්‍රවේශ නොවන බැවින් ඔබට URI ප්‍රසිද්ධ කිරීමට අවශ්‍ය නොවේ. {{ productName }} විසින් නිකුත් කරන ලද JWT ටෝකනවල ප්රේක්ෂක(aud) ප්රකාශය ලෙස මෙම හඳුනාගැනීම් අගය භාවිතා කරනු ඇත. <1>මෙම ක්ෂේත්රය අද්විතීය විය යුතුය;මැවූ පසු, එය සංස්කරණය කළ නොහැක.", label: "හඳුනාගැනුම", placeholder: "https://api.bookmyhotel.com" }, @@ -714,7 +714,7 @@ export const extensions: Extensions = { authorization: { stepTitle: "බලය පැවරීම", form: { - rbacMessage: "මේ වන විට Asgardeo අවසරය සඳහා Role Based Access Control (RBAC) සදහා පමණක් සීමා වේ.", + rbacMessage: "මේ වන විට {{ productName }} අවසරය සඳහා Role Based Access Control (RBAC) සදහා පමණක් සීමා වේ.", fields: { authorize: { label: "අවසරය අවශ්ය වේ", diff --git a/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx b/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx index 4ed8f4137f3..84715b0eee9 100644 --- a/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx +++ b/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-authorization.tsx @@ -21,7 +21,8 @@ import { Field, Form } from "@wso2is/form"; import { DocumentationLink, Message, useDocumentation } from "@wso2is/react-components"; import React, { FunctionComponent, ReactElement } from "react"; import { Trans, useTranslation } from "react-i18next"; -import { FeatureConfigInterface } from "../../../../core"; +import { useSelector } from "react-redux"; +import { AppState, FeatureConfigInterface } from "../../../../core"; import { AuthorizationAPIResourceInterface } from "../../../models"; /** @@ -69,6 +70,7 @@ export const AddAPIResourceAuthorization: FunctionComponent state.config.ui.productName); /** * Prepare form values for submitting. @@ -94,7 +96,7 @@ export const AddAPIResourceAuthorization: FunctionComponent { t("extensions:develop.apiResource.wizard.addApiResource.steps.authorization.form." + - "rbacMessage") } + "rbacMessage", { productName }) } diff --git a/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx b/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx index 2b3831a0a64..496b1e48c98 100644 --- a/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx +++ b/apps/console/src/features/api-resources/components/wizard/add-api-resource-steps/add-api-resource-basic.tsx @@ -21,8 +21,9 @@ import { Field, FormField, FormValue, Forms, Validation } from "@wso2is/forms"; import { Hint } from "@wso2is/react-components"; import React, { FunctionComponent, MutableRefObject, ReactElement, useRef } from "react"; import { Trans, useTranslation } from "react-i18next"; +import { useSelector } from "react-redux"; import { Grid } from "semantic-ui-react"; -import { FeatureConfigInterface } from "../../../../core"; +import { AppState, FeatureConfigInterface } from "../../../../core"; import { getAPIResourcesForIdenitifierValidation } from "../../../api"; import { APIResourcesConstants } from "../../../constants"; import { APIResourcesListInterface, BasicAPIResourceInterface } from "../../../models"; @@ -80,6 +81,7 @@ export const AddAPIResourceBasic: FunctionComponent = useRef(); + const productName: string = useSelector((state: AppState) => state.config.ui.productName); /** * Prepare form values for submitting. @@ -146,7 +148,8 @@ export const AddAPIResourceBasic: FunctionComponent + "form.fields.identifier.hint" } + tOptions={ { productName } }> We recommend using a URI as the identifier, but you do not need to make the URI publicly available since WSO2 Identity Server will not access your API. WSO2 Identity Server will use this identifier value as the audience(aud) claim in the @@ -173,7 +176,7 @@ export const AddAPIResourceBasic: FunctionComponent { t("extensions:develop.apiResource.wizard.addApiResource.steps.basic.form.fields." + - "name.hint") } + "name.hint", { productName }) } diff --git a/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx b/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx index a5e6e8a25e7..d00f0012bdf 100644 --- a/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx +++ b/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx @@ -36,12 +36,13 @@ import { } from "@wso2is/react-components"; import React, { FunctionComponent, ReactElement, SyntheticEvent, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { Dispatch } from "redux"; import { Dropdown, DropdownItemProps, DropdownProps, Grid, Header, Modal } from "semantic-ui-react"; import { useAPIResources } from "../../../../api-resources/api"; import { APIResourcesConstants } from "../../../../api-resources/constants"; import { APIResourceInterface, APIResourcePermissionInterface } from "../../../../api-resources/models"; +import { AppState } from "../../../../core/store"; import useScopesOfAPIResources from "../../../api/use-scopes-of-api-resources"; import { Policy, PolicyInfo, policyDetails } from "../../../constants/api-authorization"; import { ApplicationTemplateIdTypes } from "../../../models"; @@ -85,6 +86,7 @@ export const AuthorizeAPIResource: FunctionComponent state.config.ui.productName); const [ allAPIResourcesListData, setAllAPIResourcesListData ] = useState([]); const [ isSubmitting, setIsSubmitting ] = useState(false); @@ -497,7 +499,8 @@ export const AuthorizeAPIResource: FunctionComponent