fix(i18n): wrap untranslated frontend strings and add i18n lint rule (#37776)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-02-23 00:27:37 -05:00
committed by GitHub
parent 672a380587
commit 3f64ad3da5
71 changed files with 65097 additions and 15158 deletions

View File

@@ -97,7 +97,7 @@ export const httpPath = ({
validationMethods={{ onBlur: getValidation }}
errorMessage={validationErrors?.http_path}
placeholder={t('e.g. sql/protocolv1/o/12345')}
label="HTTP Path"
label={t('HTTP Path')}
onChange={changeMethods.onExtraInputChange}
helpText={t('Copy the name of the HTTP Path of your cluster.')}
/>
@@ -187,7 +187,7 @@ export const httpPathField = ({
validationMethods={{ onBlur: getValidation }}
errorMessage={validationErrors?.http_path}
placeholder={t('e.g. sql/protocolv1/o/12345')}
label="HTTP Path"
label={t('HTTP Path')}
onChange={changeMethods.onParametersChange}
helpText={t('Copy the name of the HTTP Path of your cluster.')}
/>
@@ -335,7 +335,7 @@ export const forceSSLField = ({
});
}}
/>
<span css={toggleStyle}>SSL</span>
<span css={toggleStyle}>{t('SSL')}</span>
<InfoTooltip
tooltip={t('SSL Mode "require" will be used.')}
placement="right"
@@ -359,7 +359,7 @@ export const projectIdfield = ({
value={db?.parameters?.project_id}
validationMethods={{ onBlur: getValidation }}
errorMessage={validationErrors?.project_id}
placeholder="your-project-1234-a1"
placeholder={t('your-project-1234-a1')}
label={t('Project Id')}
onChange={changeMethods.onParametersChange}
helpText={t('Enter the unique project id for your database.')}

View File

@@ -18,15 +18,16 @@
*/
import { useState } from 'react';
import { t } from '@apache-superset/core';
import { Input, Collapse, FormItem } from '@superset-ui/core/components';
import { CustomParametersChangeType, FieldPropTypes } from '../../types';
const LABELS = {
CLIENT_ID: 'Client ID',
SECRET: 'Client Secret',
AUTH_URI: 'Authorization Request URI',
TOKEN_URI: 'Token Request URI',
SCOPE: 'Scope',
CLIENT_ID: t('Client ID'),
SECRET: t('Client Secret'),
AUTH_URI: t('Authorization Request URI'),
TOKEN_URI: t('Token Request URI'),
SCOPE: t('Scope'),
};
interface OAuth2ClientInfo {
@@ -81,7 +82,7 @@ export const OAuth2ClientField = ({
items={[
{
key: 'oauth2-client-information',
label: 'OAuth2 client information',
label: t('OAuth2 client information'),
children: (
<>
<FormItem label={LABELS.CLIENT_ID}>

View File

@@ -22,19 +22,19 @@ import { DatabaseParameters, FieldPropTypes } from '../../types';
const FIELD_TEXT_MAP = {
account: {
label: 'Account',
label: t('Account'),
helpText: t(
'Copy the identifier of the account you are trying to connect to.',
),
placeholder: t('e.g. xy12345.us-east-2.aws'),
},
warehouse: {
label: 'Warehouse',
label: t('Warehouse'),
placeholder: t('e.g. compute_wh'),
className: 'form-group-w-50',
},
role: {
label: 'Role',
label: t('Role'),
placeholder: t('e.g. AccountAdmin'),
className: 'form-group-w-50',
},

View File

@@ -537,7 +537,7 @@ const ExtraOptions = ({
type="text"
name="schemas_allowed_for_file_upload"
value={schemasText}
placeholder="schema1,schema2"
placeholder={t('schema1,schema2')}
onChange={e => setSchemasText(e.target.value)}
onBlur={() =>
onExtraInputChange({

View File

@@ -159,11 +159,11 @@ const SSHTunnelForm = ({
data-test="ssh-tunnel-password-input"
iconRender={visible =>
visible ? (
<Tooltip title="Hide password.">
<Tooltip title={t('Hide password.')}>
<Icons.EyeInvisibleOutlined />
</Tooltip>
) : (
<Tooltip title="Show password.">
<Tooltip title={t('Show password.')}>
<Icons.EyeOutlined />
</Tooltip>
)
@@ -207,11 +207,11 @@ const SSHTunnelForm = ({
data-test="ssh-tunnel-private_key_password-input"
iconRender={visible =>
visible ? (
<Tooltip title="Hide password.">
<Tooltip title={t('Hide password.')}>
<Icons.EyeInvisibleOutlined />
</Tooltip>
) : (
<Tooltip title="Show password.">
<Tooltip title={t('Show password.')}>
<Icons.EyeOutlined />
</Tooltip>
)

View File

@@ -114,13 +114,14 @@ const TABS_KEYS = {
const engineSpecificAlertMapping = {
[Engines.GSheet]: {
message: 'Why do I need to create a database?',
description:
message: t('Why do I need to create a database?'),
description: t(
'To begin using your Google Sheets, you need to create a database first. ' +
'Databases are used as a way to identify ' +
'your data so that it can be queried and visualized. This ' +
'database will hold all of your individual Google Sheets ' +
'you choose to connect here.',
'Databases are used as a way to identify ' +
'your data so that it can be queried and visualized. This ' +
'database will hold all of your individual Google Sheets ' +
'you choose to connect here.',
),
},
};

View File

@@ -40,7 +40,7 @@ const ColumnsPreview: FC<ColumnsPreviewProps> = ({
return (
<StyledDivContainer>
<Typography.Text type="secondary">Columns:</Typography.Text>
<Typography.Text type="secondary">{t('Columns')}:</Typography.Text>
{columns.length === 0 ? (
<p className="help-block">{t('Upload file to preview columns')}</p>
) : (

View File

@@ -731,7 +731,10 @@ const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({
name="table_name"
required
rules={[
{ required: true, message: 'Table name is required' },
{
required: true,
message: t('Table name is required'),
},
]}
>
<Input
@@ -1024,7 +1027,7 @@ const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({
rules={[
{
required: true,
message: 'Header row is required',
message: t('Header row is required'),
},
]}
>
@@ -1057,7 +1060,7 @@ const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({
rules={[
{
required: true,
message: 'Skip rows is required',
message: t('Skip rows is required'),
},
]}
>

View File

@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t } from '@apache-superset/core';
export default function RightPanel() {
return <div>Right Panel</div>;
return <div>{t('Right Panel')}</div>;
}

View File

@@ -95,7 +95,7 @@ function UserInfoModal({
>
<Input.Password
name="password"
placeholder="Enter the user's password"
placeholder={t("Enter the user's password")}
/>
</FormItem>
<FormItem

View File

@@ -236,7 +236,7 @@ function UserListModal({
>
<Input.Password
name="password"
placeholder="Enter the user's password"
placeholder={t("Enter the user's password")}
/>
</FormItem>
<FormItem