From f806b9749d348c1d22344b36a3c0e93ad2cf6e60 Mon Sep 17 00:00:00 2001 From: Laura Benz <48948963+L-M-K-B@users.noreply.github.com> Date: Wed, 1 May 2024 13:17:53 +0200 Subject: [PATCH] refactor: replace static placeholders with translatable ones (#87130) * refactor: replace static placeholders with translatable ones * refactor * refactor: keep default option * refactor: improve expression * refactor: run extraction after merging fix --- conf/defaults.ini | 6 +++--- public/app/core/components/Login/LoginForm.tsx | 4 ++-- public/locales/en-US/grafana.json | 2 ++ public/locales/pseudo-LOCALE/grafana.json | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 401a65c6314..d51b97c4482 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -490,8 +490,8 @@ verify_email_enabled = false login_default_org_id = # Background text for the user field on the login page -login_hint = email or username -password_hint = password +login_hint = +password_hint = # Default UI theme ("dark" or "light" or "system") default_theme = dark @@ -1850,4 +1850,4 @@ fetch_access_policy_timeout = 5s # How long to wait for a request to create to delete an access policy to complete delete_access_policy_timeout = 5s # The domain name used to access cms -domain = grafana-dev.net \ No newline at end of file +domain = grafana-dev.net diff --git a/public/app/core/components/Login/LoginForm.tsx b/public/app/core/components/Login/LoginForm.tsx index cfc706ad62c..ffaa9d452ac 100644 --- a/public/app/core/components/Login/LoginForm.tsx +++ b/public/app/core/components/Login/LoginForm.tsx @@ -42,7 +42,7 @@ export const LoginForm = ({ children, onSubmit, isLoggingIn, passwordHint, login id={usernameId} autoFocus autoCapitalize="none" - placeholder={loginHint} + placeholder={loginHint || t('login.form.username-placeholder', 'email or username')} data-testid={selectors.pages.Login.username} /> @@ -55,7 +55,7 @@ export const LoginForm = ({ children, onSubmit, isLoggingIn, passwordHint, login {...register('password', { required: t('login.form.password-required', 'Password is required') })} id={passwordId} autoComplete="current-password" - placeholder={passwordHint} + placeholder={passwordHint || t('login.form.password-placeholder', 'password')} />