Migrate more strings to translation keys (#11601)

This commit is contained in:
Michael Telatynski 2023-09-13 09:30:56 +01:00 committed by GitHub
parent 564d4eda7c
commit 8c35abbb04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 3784 additions and 3553 deletions

View file

@ -74,8 +74,8 @@ const UserWelcomeTop: React.FC = () => {
<div>
<MiniAvatarUploader
hasAvatar={!!ownProfile.avatarUrl}
hasAvatarLabel={_tDom("Great, that'll help people know it's you")}
noAvatarLabel={_tDom("Add a photo so people know it's you.")}
hasAvatarLabel={_tDom("onboarding|has_avatar_label")}
noAvatarLabel={_tDom("onboarding|no_avatar_label")}
setAvatarUrl={(url) => cli.setAvatarUrl(url)}
isUserAvatar
onClick={(ev) => PosthogTrackers.trackInteraction("WebHomeMiniAvatarUploadButton", ev)}
@ -88,8 +88,8 @@ const UserWelcomeTop: React.FC = () => {
/>
</MiniAvatarUploader>
<h1>{_tDom("Welcome %(name)s", { name: ownProfile.displayName })}</h1>
<h2>{_tDom("Now, let's help you get started")}</h2>
<h1>{_tDom("onboarding|welcome_user", { name: ownProfile.displayName })}</h1>
<h2>{_tDom("onboarding|welcome_detail")}</h2>
</div>
);
};
@ -113,8 +113,8 @@ const HomePage: React.FC<IProps> = ({ justRegistered = false }) => {
introSection = (
<React.Fragment>
<img src={logoUrl} alt={config.brand} />
<h1>{_tDom("Welcome to %(appName)s", { appName: config.brand })}</h1>
<h2>{_tDom("Own your conversations.")}</h2>
<h1>{_tDom("onboarding|intro_welcome", { appName: config.brand })}</h1>
<h2>{_tDom("onboarding|intro_byline")}</h2>
</React.Fragment>
);
}
@ -125,13 +125,13 @@ const HomePage: React.FC<IProps> = ({ justRegistered = false }) => {
{introSection}
<div className="mx_HomePage_default_buttons">
<AccessibleButton onClick={onClickSendDm} className="mx_HomePage_button_sendDm">
{_tDom("Send a Direct Message")}
{_tDom("onboarding|send_dm")}
</AccessibleButton>
<AccessibleButton onClick={onClickExplore} className="mx_HomePage_button_explore">
{_tDom("Explore Public Rooms")}
{_tDom("onboarding|explore_rooms")}
</AccessibleButton>
<AccessibleButton onClick={onClickNewRoom} className="mx_HomePage_button_createGroup">
{_tDom("Create a Group Chat")}
{_tDom("onboarding|create_room")}
</AccessibleButton>
</div>
</div>

View file

@ -523,7 +523,7 @@ export default class Registration extends React.Component<IProps, IState> {
// i18n: ssoButtons is a placeholder to help translators understand context
continueWithSection = (
<h2 className="mx_AuthBody_centered">
{_t("Continue with %(ssoButtons)s", { ssoButtons: "" }).trim()}
{_t("auth|continue_with_sso", { ssoButtons: "" }).trim()}
</h2>
);
}
@ -540,7 +540,7 @@ export default class Registration extends React.Component<IProps, IState> {
action={SSOAction.REGISTER}
/>
<h2 className="mx_AuthBody_centered">
{_t("%(ssoButtons)s Or %(usernamePassword)s", {
{_t("auth|sso_or_username_password", {
ssoButtons: "",
usernamePassword: "",
}).trim()}
@ -591,7 +591,7 @@ export default class Registration extends React.Component<IProps, IState> {
const signIn = (
<span className="mx_AuthBody_changeFlow">
{_t(
"Already have an account? <a>Sign in here</a>",
"auth|sign_in_instead",
{},
{
a: (sub) => (
@ -621,13 +621,10 @@ export default class Registration extends React.Component<IProps, IState> {
regDoneText = (
<div>
<p>
{_t(
"Your new account (%(newAccountId)s) is registered, but you're already logged into a different account (%(loggedInUserId)s).",
{
newAccountId: this.state.registeredUsername,
loggedInUserId: this.state.differentLoggedInUserId,
},
)}
{_t("auth|account_clash", {
newAccountId: this.state.registeredUsername,
loggedInUserId: this.state.differentLoggedInUserId,
})}
</p>
<p>
<AccessibleButton
@ -639,7 +636,7 @@ export default class Registration extends React.Component<IProps, IState> {
}
}}
>
{_t("Continue with previous account")}
{_t("auth|account_clash_previous_account")}
</AccessibleButton>
</p>
</div>
@ -650,7 +647,7 @@ export default class Registration extends React.Component<IProps, IState> {
regDoneText = (
<h2>
{_t(
"<a>Log in</a> to your new account.",
"auth|log_in_new_account",
{},
{
a: (sub) => (
@ -673,7 +670,7 @@ export default class Registration extends React.Component<IProps, IState> {
}
body = (
<div>
<h1>{_t("Registration Successful")}</h1>
<h1>{_t("auth|registration_successful")}</h1>
{regDoneText}
</div>
);
@ -685,8 +682,8 @@ export default class Registration extends React.Component<IProps, IState> {
title={_t("Create account")}
serverPicker={
<ServerPicker
title={_t("Host account on")}
dialogTitle={_t("Decide where your account is hosted")}
title={_t("auth|server_picker_title")}
dialogTitle={_t("auth|server_picker_dialog_title")}
serverConfig={this.props.serverConfig}
onServerConfigChange={
this.state.doingUIAuth ? undefined : this.props.onServerConfigChange

View file

@ -287,7 +287,7 @@ export default class SoftLogout extends React.Component<IProps, IState> {
<p>{_t("Sign in and regain access to your account.")}</p>
{this.renderSsoForm(null)}
<h2 className="mx_AuthBody_centered">
{_t("%(ssoButtons)s Or %(usernamePassword)s", {
{_t("auth|sso_or_username_password", {
ssoButtons: "",
usernamePassword: "",
}).trim()}

View file

@ -189,7 +189,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
tabs.push(
new Tab(
UserTab.Help,
_td("Help & About"),
_td("setting|help_about|title"),
"mx_UserSettingsDialog_helpIcon",
<HelpUserSettingsTab closeSettingsFn={() => this.props.onFinished()} />,
"UserSettingsHelpAbout",

View file

@ -115,7 +115,7 @@ export default class ErrorBoundary extends React.PureComponent<Props, IState> {
if (MatrixClientPeg.get()) {
clearCacheButton = (
<AccessibleButton onClick={this.onClearCacheAndReload} kind="danger">
{_t("Clear cache and reload")}
{_t("setting|help_about|clear_cache_reload")}
</AccessibleButton>
);
}

View file

@ -78,8 +78,8 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
: "<not-enabled>";
return {
appVersion: `${_t("%(brand)s version:", { brand })} ${appVersion}`,
olmVersion: `${_t("Olm version:")} ${olmVersion}`,
appVersion: `${_t("setting|help_about|brand_version", { brand })} ${appVersion}`,
olmVersion: `${_t("setting|help_about|olm_version")} ${olmVersion}`,
};
}
@ -228,7 +228,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
const brand = SdkConfig.get().brand;
let faqText = _t(
"For help with using %(brand)s, click <a>here</a>.",
"setting|help_about|help_link",
{
brand,
},
@ -240,7 +240,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
faqText = (
<div>
{_t(
"For help with using %(brand)s, click <a>here</a> or start a chat with our bot using the button below.",
"setting|help_about|help_link_chat_bot",
{
brand,
},
@ -258,7 +258,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
)}
<div>
<AccessibleButton onClick={this.onStartBotChat} kind="primary">
{_t("Chat with %(brand)s Bot", { brand })}
{_t("setting|help_about|chat_bot", { brand })}
</AccessibleButton>
</div>
</div>
@ -306,10 +306,10 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
return (
<SettingsTab>
<SettingsSection heading={_t("Help & About")}>
<SettingsSection heading={_t("setting|help_about|title")}>
{bugReportingSection}
<SettingsSubsection heading={_t("common|faq")} description={faqText} />
<SettingsSubsection heading={_t("Versions")}>
<SettingsSubsection heading={_t("setting|help_about|versions")}>
<SettingsSubsectionText>
<CopyableText getTextToCopy={this.getVersionTextToCopy}>
{appVersion}
@ -325,7 +325,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
<SettingsSubsection heading={_t("Advanced")}>
<SettingsSubsectionText>
{_t(
"Homeserver is <code>%(homeserverUrl)s</code>",
"setting|help_about|homeserver",
{
homeserverUrl: this.context.getHomeserverUrl(),
},
@ -337,7 +337,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
{this.context.getIdentityServerUrl() && (
<SettingsSubsectionText>
{_t(
"Identity server is <code>%(identityServerUrl)s</code>",
"setting|help_about|identity_server",
{
identityServerUrl: this.context.getIdentityServerUrl(),
},
@ -350,18 +350,14 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
<SettingsSubsectionText>
<details>
<summary>{_t("common|access_token")}</summary>
<b>
{_t(
"Your access token gives full access to your account. Do not share it with anyone.",
)}
</b>
<b>{_t("setting|help_about|access_token_detail")}</b>
<CopyableText getTextToCopy={() => this.context.getAccessToken()}>
{this.context.getAccessToken()}
</CopyableText>
</details>
</SettingsSubsectionText>
<AccessibleButton onClick={this.onClearCacheAndReload} kind="danger">
{_t("Clear cache and reload")}
{_t("setting|help_about|clear_cache_reload")}
</AccessibleButton>
</SettingsSubsection>
</SettingsSection>