Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Show disclaimer in lang other than English #743

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion locales/bg-BG/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Ново име на портфейла",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Не е съхранена фраза за възстановяване заедно с този портфейл",
"No transactions to display": "Няма транзакции за показване",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Вашият портфейл",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Neuer Walletname",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Es wurde keine Wiederherstellungsphrase zusammen mit dieser Wallet gespeichert.",
"No transactions to display": "Keine anzuzeigende Transaktionen",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Ihre Wallet",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,5 +434,7 @@
"Your Wallet": "Your Wallet",
"{{ amount }} words entered": "{{ amount }} words entered",
"{{ number }} selected": "{{ number }} selected",
"No NFTs found.": "No NFTs found."
"No NFTs found.": "No NFTs found.",
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/es-ES/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Nuevo nombre de la billetera",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "No se almacenó ninguna frase de recuperación junto con esta billetera",
"No transactions to display": "No hay transacciones que visualizar",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Su billetera",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/fr-FR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Nouveau nom de portefeuille",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "Aucun de contact trouvé. Vous pouvez créer des contacts dans le menu Adresse.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "Aucune option ne correspond à ces critères.",
"No recovery phrase was stored along with this wallet": "Aucune phrase de récupération n'a été enregistrée avec ce portefeuille",
"No transactions to display": "Aucune transaction à afficher",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Votre fichier CSV a été généré correctement.",
"Your CSV file is being compiled in the background.": "Votre fichier CSV est en cours de création.",
"Your Wallet": "Votre portefeuille",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/id-ID/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Nama dompet baru",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Tidak ada frase pemulihan yang disimpan bersama dompet ini",
"No transactions to display": "Tidak ada transaksi untuk ditampilkan",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Dompet Anda",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/pt-PT/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Novo nome da carteira",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Nenhuma frase de recuperação foi guardada juntamente com esta carteira",
"No transactions to display": "Sem transações a exibir",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "A sua carteira",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/ru-RU/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Новое имя кошелька",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Никакая фраза восстановления не была сохранена для этого кошелька",
"No transactions to display": "Транзакции для отображения отсутствуют",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Ваш кошелек",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/tr-TR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Yeni cüzdan ismi",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Bu cüzdan için kurtarma sözcükleri kaydedilmedi",
"No transactions to display": "Gösterilecek işlem yok",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Cüzdanınız",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
4 changes: 3 additions & 1 deletion locales/vi-VN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"New wallet name": "Tên ví mới",
"NFTs": "NFTs",
"No contacts found. You can create contacts in the Addresses page.": "No contacts found. You can create contacts in the Addresses page.",
"No NFTs found.": "No NFTs found.",
"No options match the search criteria.": "No options match the search criteria.",
"No recovery phrase was stored along with this wallet": "Không có cụm từ khôi phục nào được lưu với ví này",
"No transactions to display": "Không có giao dịch nào để hiển thị",
Expand Down Expand Up @@ -434,5 +435,6 @@
"Your CSV file has been generated successfully.": "Your CSV file has been generated successfully.",
"Your CSV file is being compiled in the background.": "Your CSV file is being compiled in the background.",
"Your Wallet": "Ví của bạn",
"No NFTs found.": "No NFTs found."
"Disclaimer": "Disclaimer",
"The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.": "The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version."
}
41 changes: 12 additions & 29 deletions src/components/Inputs/InlineLabelValueInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,33 @@ You should have received a copy of the GNU Lesser General Public License
along with the library. If not, see <http://www.gnu.org/licenses/>.
*/

import { Info } from 'lucide-react'
import { ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'

import ActionLink from '@/components/ActionLink'
import { openInWebBrowser } from '@/utils/misc'

interface InlineLabelValueInputProps {
label: ReactNode
InputComponent: ReactNode
description?: string
moreInfoLink?: string
children?: ReactNode
className?: string
}

const InlineLabelValueInput = ({
label,
InputComponent,
description,
moreInfoLink,
children,
className
}: InlineLabelValueInputProps) => {
const { t } = useTranslation()

return (
<KeyValueInputContainer className={className}>
<KeyContainer>
<Label>{label}</Label>
{description && <DescriptionContainer>{description}</DescriptionContainer>}
{moreInfoLink && (
<ActionLinkStyled onClick={() => openInWebBrowser(moreInfoLink)}>
<Info size={12} /> {t('More info')}
</ActionLinkStyled>
)}
</KeyContainer>
<InputContainer>{InputComponent}</InputContainer>
</KeyValueInputContainer>
)
}
}: InlineLabelValueInputProps) => (
<KeyValueInputContainer className={className}>
<KeyContainer>
<Label>{label}</Label>
{description && <DescriptionContainer>{description}</DescriptionContainer>}
{children}
</KeyContainer>
<InputContainer>{InputComponent}</InputContainer>
</KeyValueInputContainer>
)

export default InlineLabelValueInput

Expand Down Expand Up @@ -88,7 +75,3 @@ const InputContainer = styled.div`
justify-content: flex-end;
flex: 1;
`

const ActionLinkStyled = styled(ActionLink)`
gap: 0.3em;
`
35 changes: 32 additions & 3 deletions src/modals/SettingsModal/GeneralSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ You should have received a copy of the GNU Lesser General Public License
along with the library. If not, see <http://www.gnu.org/licenses/>.
*/

import { AlertTriangle, Info } from 'lucide-react'
import { usePostHog } from 'posthog-js/react'
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'

import ActionLink from '@/components/ActionLink'
import Box from '@/components/Box'
import HorizontalDivider from '@/components/Dividers/HorizontalDivider'
import KeyValueInput from '@/components/Inputs/InlineLabelValueInput'
Expand All @@ -41,6 +44,7 @@ import {
import { switchTheme } from '@/storage/settings/settingsStorageUtils'
import { Currency, Language, ThemeSettings } from '@/types/settings'
import { links } from '@/utils/links'
import { openInWebBrowser } from '@/utils/misc'
import { fiatCurrencyOptions, languageOptions, locktimeInMinutes } from '@/utils/settings'

interface GeneralSettingsSectionProps {
Expand Down Expand Up @@ -201,7 +205,18 @@ const GeneralSettingsSection = ({ className }: GeneralSettingsSectionProps) => {
heightSize="small"
/>
}
/>
>
{language !== 'en-US' && (
<Disclaimer
data-tooltip-html={t(
'The wallet is developed in English.<br />Translations in other languages are provided by the Alephium community.<br />In case of doubt, always refer to the English version.'
)}
data-tooltip-id="default"
>
<AlertTriangle size={12} /> <span>{t('Disclaimer')}</span>
</Disclaimer>
)}
</KeyValueInput>
<HorizontalDivider />
<KeyValueInput
label={t('Currency')}
Expand All @@ -222,9 +237,12 @@ const GeneralSettingsSection = ({ className }: GeneralSettingsSectionProps) => {
<KeyValueInput
label={t('Analytics')}
description={t('Help us improve your experience!')}
moreInfoLink={links.analytics}
InputComponent={<Toggle toggled={analytics} onToggle={handleAnalyticsToggle} />}
/>
>
<ActionLinkStyled onClick={() => openInWebBrowser(links.analytics)}>
<Info size={12} /> {t('More info')}
</ActionLinkStyled>
</KeyValueInput>
<ModalPortal>
{isPasswordModelOpen && (
<CenteredModal title={t('Password')} onClose={() => setIsPasswordModalOpen(false)} focusMode skipFocusOnMount>
Expand All @@ -241,3 +259,14 @@ const GeneralSettingsSection = ({ className }: GeneralSettingsSectionProps) => {
}

export default GeneralSettingsSection

const ActionLinkStyled = styled(ActionLink)`
gap: 0.3em;
`

const Disclaimer = styled.div`
display: flex;
align-items: center;
gap: 0.3em;
color: ${({ theme }) => theme.global.highlight};
`
Loading