chore(translations): Add missing i18n (#17525)

* Add *.ts to babel.cfg

* Add missing i18n calls

* Update pot file

* Fix lint issues and review comment

* Incorparate review feedback

* Fix missing or non-extractable i18n calls

* Update pot file

* Fix syntax error in CommonParameters.tsx

* Fix introduced issues
This commit is contained in:
Holger Bruch
2021-11-27 13:50:33 +01:00
committed by GitHub
parent 4cf429c154
commit 6604a6ab28
22 changed files with 1167 additions and 567 deletions

View File

@@ -90,38 +90,42 @@ const engineSpecificAlertMapping = {
const errorAlertMapping = {
CONNECTION_MISSING_PARAMETERS_ERROR: {
message: 'Missing Required Fields',
description: 'Please complete all required fields.',
message: t('Missing Required Fields'),
description: t('Please complete all required fields.'),
},
CONNECTION_INVALID_HOSTNAME_ERROR: {
message: 'Could not verify the host',
description:
message: t('Could not verify the host'),
description: t(
'The host is invalid. Please verify that this field is entered correctly.',
),
},
CONNECTION_PORT_CLOSED_ERROR: {
message: 'Port is closed',
description: 'Please verify that port is open to connect.',
message: t('Port is closed'),
description: t('Please verify that port is open to connect.'),
},
CONNECTION_INVALID_PORT_ERROR: {
message: 'Invalid Port Number',
description: 'The port must be a whole number less than or equal to 65535.',
message: t('Invalid Port Number'),
description: t(
'The port must be a whole number less than or equal to 65535.',
),
},
CONNECTION_ACCESS_DENIED_ERROR: {
message: 'Invalid account information',
description: 'Either the username or password is incorrect.',
message: t('Invalid account information'),
description: t('Either the username or password is incorrect.'),
},
CONNECTION_INVALID_PASSWORD_ERROR: {
message: 'Invalid account information',
description: 'Either the username or password is incorrect.',
message: t('Invalid account information'),
description: t('Either the username or password is incorrect.'),
},
INVALID_PAYLOAD_SCHEMA_ERROR: {
message: 'Incorrect Fields',
description: 'Please make sure all fields are filled out correctly',
message: t('Incorrect Fields'),
description: t('Please make sure all fields are filled out correctly'),
},
TABLE_DOES_NOT_EXIST_ERROR: {
message: 'URL could not be identified',
description:
message: t('URL could not be identified'),
description: t(
'The URL could not be identified. Please check for typos and make sure that "Type of google sheet allowed" selection matches the input',
),
},
};
interface DatabaseModalProps {
@@ -661,13 +665,13 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const renderAvailableSelector = () => (
<div className="available">
<h4 className="available-label">
Or choose from a list of other databases we support:
{t('Or choose from a list of other databases we support:')}
</h4>
<div className="control-label">Supported databases</div>
<div className="control-label">{t('Supported databases')}</div>
<Select
className="available-select"
onChange={setDatabaseModel}
placeholder="Choose a database..."
placeholder={t('Choose a database...')}
>
{[...(availableDbs?.databases || [])]
?.sort((a: DatabaseForm, b: DatabaseForm) =>
@@ -680,7 +684,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
))}
{/* Allow users to connect to DB via legacy SQLA form */}
<Select.Option value="Other" key="Other">
Other
{t('Other')}
</Select.Option>
</Select>
<Alert
@@ -695,8 +699,9 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
description={
connectionAlert?.ADD_DATABASE ? (
<>
Any databases that allow connections via SQL Alchemy URIs can be
added.{' '}
{t(
'Any databases that allow connections via SQL Alchemy URIs can be added. ',
)}
<a
href={connectionAlert?.ADD_DATABASE.contact_link}
target="_blank"
@@ -708,14 +713,15 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
</>
) : (
<>
Any databases that allow connections via SQL Alchemy URIs can be
added. Learn about how to connect a database driver{' '}
{t(
'Any databases that allow connections via SQL Alchemy URIs can be added. Learn about how to connect a database driver ',
)}
<a
href={DOCUMENTATION_LINK}
target="_blank"
rel="noopener noreferrer"
>
here
{t('here')}
</a>
.
</>
@@ -761,14 +767,14 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
return (
<>
<StyledFooterButton key="back" onClick={handleBackButtonOnConnect}>
Back
{t('Back')}
</StyledFooterButton>
<StyledFooterButton
key="submit"
buttonStyle="primary"
onClick={onSave}
>
Connect
{t('Connect')}
</StyledFooterButton>
</>
);
@@ -777,7 +783,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
return (
<>
<StyledFooterButton key="back" onClick={handleBackButtonOnFinish}>
Back
{t('Back')}
</StyledFooterButton>
<StyledFooterButton
key="submit"
@@ -785,7 +791,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
onClick={onSave}
data-test="modal-confirm-button"
>
Finish
{t('Finish')}
</StyledFooterButton>
</>
);
@@ -796,10 +802,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const renderEditModalFooter = () => (
<>
<StyledFooterButton key="close" onClick={onClose}>
Close
{t('Close')}
</StyledFooterButton>
<StyledFooterButton key="submit" buttonStyle="primary" onClick={onSave}>
Finish
{t('Finish')}
</StyledFooterButton>
</>
);
@@ -901,7 +907,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
<Alert
type="error"
css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
message="Database Creation Error"
message={t('Database Creation Error')}
description={message?.[0] || dbErrors}
/>
);
@@ -1059,7 +1065,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
}
css={theme => alchemyButtonLinkStyles(theme)}
>
Connect this database using the dynamic form instead
{t('Connect this database using the dynamic form instead')}
</Button>
<InfoTooltip
tooltip={t(
@@ -1118,16 +1124,16 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
showIcon
description={
<>
Select databases require additional fields to be completed
in the Advanced tab to successfully connect the database.
Learn what requirements your databases has{' '}
{t(
'Select databases require additional fields to be completed in the Advanced tab to successfully connect the database. Learn what requirements your databases has ',
)}
<a
href={DOCUMENTATION_LINK}
target="_blank"
rel="noopener noreferrer"
className="additional-fields-alert-description"
>
here
{t('here')}
</a>
.
</>
@@ -1292,7 +1298,9 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
}
css={buttonLinkStyles}
>
Connect this database with a SQLAlchemy URI string instead
{t(
'Connect this database with a SQLAlchemy URI string instead',
)}
</Button>
<InfoTooltip
tooltip={t(