SiteView,
} from "lemmy-js-client";
import { joinLemmyUrl } from "../../config";
-import { i18n } from "../../i18next";
import { mdToHtml } from "../../markdown";
-import { UserService } from "../../services";
+import { I18NextService, UserService } from "../../services";
import { HttpService, RequestState } from "../../services/HttpService";
import { toast } from "../../toast";
import { HtmlTags } from "../common/html-tags";
}
titleName(siteView: SiteView): string {
- return i18n.t(
+ return I18NextService.i18n.t(
siteView.local_site.private_instance ? "apply_to_join" : "sign_up"
);
}
className="col-sm-2 col-form-label"
htmlFor="register-username"
>
- {i18n.t("username")}
+ {I18NextService.i18n.t("username")}
</label>
<div className="col-sm-10">
required
minLength={3}
pattern="[a-zA-Z0-9_]+"
- title={i18n.t("community_reqs")}
+ title={I18NextService.i18n.t("community_reqs")}
/>
</div>
</div>
<div className="mb-3 row">
<label className="col-sm-2 col-form-label" htmlFor="register-email">
- {i18n.t("email")}
+ {I18NextService.i18n.t("email")}
</label>
<div className="col-sm-10">
<input
className="form-control"
placeholder={
siteView.local_site.require_email_verification
- ? i18n.t("required")
- : i18n.t("optional")
+ ? I18NextService.i18n.t("required")
+ : I18NextService.i18n.t("optional")
}
value={this.state.form.email}
autoComplete="email"
!validEmail(this.state.form.email) && (
<div className="mt-2 mb-0 alert alert-warning" role="alert">
<Icon icon="alert-triangle" classes="icon-inline me-2" />
- {i18n.t("no_password_reset")}
+ {I18NextService.i18n.t("no_password_reset")}
</div>
)}
</div>
className="col-sm-2 col-form-label"
htmlFor="register-password"
>
- {i18n.t("password")}
+ {I18NextService.i18n.t("password")}
</label>
<div className="col-sm-10">
<input
/>
{this.state.form.password && (
<div className={this.passwordColorClass}>
- {i18n.t(this.passwordStrength as NoOptionI18nKeys)}
+ {I18NextService.i18n.t(
+ this.passwordStrength as NoOptionI18nKeys
+ )}
</div>
)}
</div>
className="col-sm-2 col-form-label"
htmlFor="register-verify-password"
>
- {i18n.t("verify_password")}
+ {I18NextService.i18n.t("verify_password")}
</label>
<div className="col-sm-10">
<input
<div className="offset-sm-2 col-sm-10">
<div className="mt-2 alert alert-warning" role="alert">
<Icon icon="alert-triangle" classes="icon-inline me-2" />
- {i18n.t("fill_out_application")}
+ {I18NextService.i18n.t("fill_out_application")}
</div>
{siteView.local_site.application_question && (
<div
className="col-sm-2 col-form-label"
htmlFor="application_answer"
>
- {i18n.t("answer")}
+ {I18NextService.i18n.t("answer")}
</label>
<div className="col-sm-10">
<MarkdownTextArea
onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
/>
<label className="form-check-label" htmlFor="register-show-nsfw">
- {i18n.t("show_nsfw")}
+ {I18NextService.i18n.t("show_nsfw")}
</label>
</div>
</div>
return (
<div className="mb-3 row">
<label className="col-sm-2" htmlFor="register-captcha">
- <span className="me-2">{i18n.t("enter_code")}</span>
+ <span className="me-2">
+ {I18NextService.i18n.t("enter_code")}
+ </span>
<button
type="button"
className="btn btn-secondary"
onClick={linkEvent(this, this.handleRegenCaptcha)}
- aria-label={i18n.t("captcha")}
+ aria-label={I18NextService.i18n.t("captcha")}
>
<Icon icon="refresh-cw" classes="icon-refresh-cw" />
</button>
className="rounded-top img-fluid"
src={this.captchaPngSrc(captchaRes)}
style="border-bottom-right-radius: 0; border-bottom-left-radius: 0;"
- alt={i18n.t("captcha")}
+ alt={I18NextService.i18n.t("captcha")}
/>
{captchaRes.wav && (
<button
className="rounded-bottom btn btn-sm btn-secondary d-block"
style="border-top-right-radius: 0; border-top-left-radius: 0;"
- title={i18n.t("play_captcha_audio")}
+ title={I18NextService.i18n.t("play_captcha_audio")}
onClick={linkEvent(this, this.handleCaptchaPlay)}
type="button"
disabled={this.state.captchaPlaying}
i.props.history.replace("/communities");
} else {
if (data.verify_email_sent) {
- toast(i18n.t("verify_email_sent"));
+ toast(I18NextService.i18n.t("verify_email_sent"));
}
if (data.registration_created) {
- toast(i18n.t("registration_application_sent"));
+ toast(I18NextService.i18n.t("registration_application_sent"));
}
i.props.history.push("/");
}