Skip to content

Commit

Permalink
Add Simple Enable Amendment Translations (#1084)
Browse files Browse the repository at this point in the history
## High Level Overview of Change

Add translations to the EnableAmendment/Simple.tsx file for the table
labels. Small code cleanup raised in
#1076

<!--
Please include a summary/list of the changes.
If too broad, please consider splitting into multiple PRs.
-->

### Context of Change

<!--
Please include the context of a change.
If a bug fix, when was the bug introduced? What was the behavior?
If a new feature, why was this architecture chosen? What were the
alternatives?
If a refactor, how is this better than the previous implementation?

If there is a design document for this feature, please link it here.
-->

### Type of Change

<!--
Please check relevant options, delete irrelevant ones.
-->

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (non-breaking change that only restructures code)
- [ ] Tests (You added tests for code that already exists, or your new
feature included in this PR)
- [ ] Documentation Updates
- [ ] Translation Updates
- [ ] Release

### TypeScript/Hooks Update

<!--
In an effort to modernize the codebase, you should convert the files
that you work with to React Hooks and TypeScript.
If this is not possible (e.g. it's too many changes, touching too many
files, etc.) please explain why here.
-->

- [ ] Updated files to React Hooks
- [ ] Updated files to TypeScript

## Before / After

<!--
If just refactoring / back-end changes, this can be just an in-English
description of the change at a technical level.
If a UI change, screenshots should be included.
-->

## Test Plan

<!--
Please describe the tests that you ran to verify your changes and
provide instructions so that others can reproduce.
-->

<!--
## Future Tasks
For future tasks related to PR.
-->
  • Loading branch information
achowdhry-ripple authored Nov 13, 2024
1 parent 531a59a commit dae75f4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
5 changes: 4 additions & 1 deletion public/locales/ca-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,8 @@
"can_trade": null,
"can_transfer": null,
"can_clawback": null,
"search_results_banner": null
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
}
6 changes: 5 additions & 1 deletion public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,9 @@
"can_trade": "Can Trade",
"can_transfer": "Can Transfer",
"can_clawback": "Can Clawback",
"search_results_banner": "Token search by name and account is now available! Try searching for USD"
"search_results_banner": "Token search by name and account is now available! Try searching for USD",
"enable_amendment_name": "Amendment Name",
"amendment_status": "Amendment Status",
"expected_date": "Expected Date"

}
5 changes: 4 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,5 +553,8 @@
"can_trade": null,
"can_transfer": null,
"can_clawback": null,
"search_results_banner": null
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
}
5 changes: 4 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,5 +554,8 @@
"can_trade": null,
"can_transfer": null,
"can_clawback": null,
"search_results_banner": null
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
}
5 changes: 4 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,5 +553,8 @@
"can_trade": null,
"can_transfer": null,
"can_clawback": null,
"search_results_banner": null
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
}
5 changes: 4 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,5 +551,8 @@
"can_trade": null,
"can_transfer": null,
"can_clawback": null,
"search_results_banner": null
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useContext, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useLanguage } from '../../../hooks'
import { SimpleRow } from '../SimpleRow'
import { TransactionSimpleProps } from '../types'
Expand All @@ -16,6 +17,7 @@ const states = {

export const Simple = ({ data }: TransactionSimpleProps<EnableAmendment>) => {
const language = useLanguage()
const { t } = useTranslation()
const [amendmentDetails, setAmendmentDetails] = useState({
name: states.loading,
minRippledVersion: states.loading,
Expand Down Expand Up @@ -56,24 +58,24 @@ export const Simple = ({ data }: TransactionSimpleProps<EnableAmendment>) => {

return (
<>
<SimpleRow label="Amendment Name" data-test="name">
<SimpleRow label={t('enable_amendment_name')} data-test="name">
<RouteLink
to={AMENDMENT_ROUTE}
params={{ identifier: data.instructions.Amendment }}
>
{amendmentDetails.name}
</RouteLink>
</SimpleRow>
<SimpleRow label="Amendment Status" data-test="status">
<SimpleRow label={t('amendment_status')} data-test="status">
<a href="https://xrpl.org/enableamendment.html#enableamendment-flags">
{amendmentStatus}
</a>
</SimpleRow>
<SimpleRow label="Introduced In" data-test="version">
<SimpleRow label={t('introduced_in')} data-test="version">
{amendmentDetails.minRippledVersion}
</SimpleRow>
{amendmentStatus === 'Got Majority' && (
<SimpleRow label="Expected Date" data-test="date">
<SimpleRow label={t('expected_date')} data-test="date">
{expectedDate}
</SimpleRow>
)}
Expand Down

0 comments on commit dae75f4

Please sign in to comment.