Skip to content

Commit

Permalink
Merge pull request #11 from xeptagondev/feature/carbon-258
Browse files Browse the repository at this point in the history
translation fixes
  • Loading branch information
palindaa authored Aug 22, 2023
2 parents 1bd25af + 3adb4d1 commit 1939089
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 11 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@types/react-dom": "^18.0.8",
"@types/styled-components": "^5.1.26",
"@types/validator": "^13.7.13",
"@undp/carbon-library": "^1.0.73",
"@undp/carbon-library": "^1.0.74",
"antd": "^4.24.1",
"apexcharts": "^3.36.3",
"axios": "^1.1.3",
Expand Down
4 changes: 3 additions & 1 deletion web/public/Assets/i18n/coBenifits/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
"specify":"Specify",
"contactInformation":"Contact Information",
"feasibilityReport":"Feasibility Report",
"invalidFileFormat": "Unsupported file format"
"invalidFileFormat": "Unsupported file format",
"email": "Email",
"isInvalid": "is invalid!"
}


19 changes: 18 additions & 1 deletion web/src/Components/Internationalization/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ i18n
//NOTE - Disabled in production
debug: true,
//separate name spaces for each pages
ns: ['common', 'login', 'dashboard', 'nav', 'company', 'user', 'programme', 'view', 'homepage'],
ns: [
'common',
'login',
'dashboard',
'nav',
'company',
'user',
'programme',
'view',
'homepage',
'ndcAction',
'coBenifits',
'environment',
'genderParity',
'safeguards',
'social',
'economic',
],
});
export default i18n;
13 changes: 11 additions & 2 deletions web/src/Pages/NdcActionManagement/addNDCAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ import { getSdgGoalImages } from '../../Definitions/InterfacesAndType/ndcAction.

const AddNDCAction = () => {
const navigate = useNavigate();
const { t } = useTranslation(['ndcAction']);
const { t, i18n } = useTranslation([
'ndcAction',
'coBenifits',
'common',
'economic',
'environment',
'genderParity',
'safeguards',
'social',
]);
const sdgGoalImages = getSdgGoalImages();

const onNavigateToProgrammeManagementView = (programmeId: any) => {
Expand All @@ -24,7 +33,7 @@ const AddNDCAction = () => {

return (
<AddNdcActionComponent
t={t}
translator={i18n}
useLocation={useLocation}
useConnection={useConnection}
useUserContext={useUserContext}
Expand Down
13 changes: 11 additions & 2 deletions web/src/Pages/NdcActionManagement/ndcActionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ import { getSdgGoalImages } from '../../Definitions/InterfacesAndType/ndcAction.

const NdcActionView = () => {
const navigate = useNavigate();
const { t } = useTranslation(['ndcAction']);
const { t, i18n } = useTranslation([
'ndcAction',
'coBenifits',
'common',
'economic',
'environment',
'genderParity',
'safeguards',
'social',
]);
const sdgGoalImages = getSdgGoalImages();

const onNavigateToNdcManagementView = (record: any) => {
Expand All @@ -23,7 +32,7 @@ const NdcActionView = () => {
useUserContext={useUserContext}
useLocation={useLocation}
onNavigateToNdcManagementView={onNavigateToNdcManagementView}
t={t}
translator={i18n}
sdgGoalImages={sdgGoalImages}
></NdcActionViewComponent>
);
Expand Down
8 changes: 4 additions & 4 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2733,10 +2733,10 @@
"@types/node" "^18.11.9"
convert-units "^2.3.4"

"@undp/carbon-library@^1.0.73":
version "1.0.73"
resolved "https://registry.yarnpkg.com/@undp/carbon-library/-/carbon-library-1.0.73.tgz#ee54e3bf035c69ca88c94fcd5cc58d397fdeb496"
integrity sha512-sOWgDh300u2iOaw3YMdfzcEluvSE8NJkDWisFzkvyWjVTWKvtDWUQhpt1TlGZoGdCr1aWxadyCpqO0G/PsFVXA==
"@undp/carbon-library@^1.0.74":
version "1.0.74"
resolved "https://registry.yarnpkg.com/@undp/carbon-library/-/carbon-library-1.0.74.tgz#7e6a9fae815db9a7d6f11b53265af5f4b7b3feaf"
integrity sha512-nyk6MY5jHi8BG4rD7Ct1RF0jnSWgvmcanbt/Kd6ljuMjsAOtnh1hm0OOSsDcjQxisz9+1wc9LqYGCoB/qt1/KQ==
dependencies:
"@rollup/plugin-commonjs" "^25.0.0"
"@rollup/plugin-node-resolve" "^15.0.2"
Expand Down

0 comments on commit 1939089

Please sign in to comment.