copy translated files
This commit is contained in:
parent
692344edfb
commit
64ac9f51a2
15 changed files with 465 additions and 0 deletions
16
src/pages/fr-fr/failure.astro
Normal file
16
src/pages/fr-fr/failure.astro
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{
|
||||||
|
title: "Registration failed",
|
||||||
|
template: "splash",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
An error occurred while we were registering you. Try again later, and if the
|
||||||
|
error persists, join our <a
|
||||||
|
href="https://matrix.to/#/#community:federated.nexus">Matrix room</a
|
||||||
|
> let me know.
|
||||||
|
</StarlightPage>
|
99
src/pages/fr-fr/login.astro
Normal file
99
src/pages/fr-fr/login.astro
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{ title: "Sign In to Federated Nexus", template: "splash" }}
|
||||||
|
>
|
||||||
|
<form method="post" action="https://auth.federated.nexus/login">
|
||||||
|
<input type="hidden" name="state" />
|
||||||
|
<input type="hidden" name="nonce" />
|
||||||
|
<input type="hidden" name="user_id" />
|
||||||
|
<input type="hidden" name="access_token" />
|
||||||
|
<input type="hidden" name="redirect_uri" />
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Username
|
||||||
|
<input type="text" />
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Password
|
||||||
|
<input type="password" />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<noscript id="error">
|
||||||
|
This form will not function without JavaScript.
|
||||||
|
</noscript>
|
||||||
|
<span id="error"> </span>
|
||||||
|
<button type="submit"><span>Submit</span></button>
|
||||||
|
|
||||||
|
<a href="/register">Don't have an account? Sign up now!</a>
|
||||||
|
</form>
|
||||||
|
</StarlightPage>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const params = new URLSearchParams(window.location.search)
|
||||||
|
for (const name of ["redirect_uri", "state", "nonce"]) {
|
||||||
|
const input = document.querySelector(
|
||||||
|
`input[name="${name}"]`
|
||||||
|
) as HTMLInputElement
|
||||||
|
if (input && params.has(name)) input.value = params.get(name)!
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = document.querySelector("form")!
|
||||||
|
const error = document.querySelector("#error")! as HTMLSpanElement
|
||||||
|
form.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
|
error.style.display = "none"
|
||||||
|
|
||||||
|
try {
|
||||||
|
const username = (
|
||||||
|
form.querySelector('[type="text"]') as HTMLInputElement
|
||||||
|
).value
|
||||||
|
const password = (
|
||||||
|
form.querySelector('[type="password"]') as HTMLInputElement
|
||||||
|
).value
|
||||||
|
|
||||||
|
const session =
|
||||||
|
localStorage.getItem("session") ?? crypto.randomUUID()
|
||||||
|
localStorage.setItem("session", session)
|
||||||
|
|
||||||
|
const res = await fetch(
|
||||||
|
"https://matrix.federated.nexus/_matrix/client/v3/login",
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
type: "m.login.password",
|
||||||
|
device_id: session,
|
||||||
|
initial_device_display_name: `Federated Nexus Login from ${navigator.userAgent}`,
|
||||||
|
identifier: { type: "m.id.user", user: username },
|
||||||
|
password,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error((await res.json())["error"])
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await res.json()
|
||||||
|
|
||||||
|
const id = form.querySelector(
|
||||||
|
'input[name="user_id"]'
|
||||||
|
) as HTMLInputElement
|
||||||
|
id.value = data.user_id
|
||||||
|
|
||||||
|
const token = form.querySelector(
|
||||||
|
'input[name="access_token"]'
|
||||||
|
) as HTMLInputElement
|
||||||
|
token.value = data.access_token
|
||||||
|
|
||||||
|
form.submit()
|
||||||
|
} catch (err: any) {
|
||||||
|
error.textContent = err.message || "Login failed"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
26
src/pages/fr-fr/register.astro
Normal file
26
src/pages/fr-fr/register.astro
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{ title: "Register for Federated Nexus", template: "splash" }}
|
||||||
|
>
|
||||||
|
<form method="post" action="https://register.federated.nexus">
|
||||||
|
<label>
|
||||||
|
Username (alphanumeric only, no spaces)
|
||||||
|
<input
|
||||||
|
name="username"
|
||||||
|
type="text"
|
||||||
|
required
|
||||||
|
pattern="^[A-Za-z0-9]+$"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Email
|
||||||
|
<input name="email" type="email" required />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button type="submit"><span>Submit</span></button>
|
||||||
|
</form>
|
||||||
|
</StarlightPage>
|
14
src/pages/fr-fr/success.astro
Normal file
14
src/pages/fr-fr/success.astro
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{
|
||||||
|
title: "Successfully Registered for Federated Nexus",
|
||||||
|
template: "splash",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Once approved, you will receive an email with a username and password.
|
||||||
|
Approval usually takes less than two business days.
|
||||||
|
</StarlightPage>
|
16
src/pages/ru-ru/failure.astro
Normal file
16
src/pages/ru-ru/failure.astro
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{
|
||||||
|
title: "Registration failed",
|
||||||
|
template: "splash",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
An error occurred while we were registering you. Try again later, and if the
|
||||||
|
error persists, join our <a
|
||||||
|
href="https://matrix.to/#/#community:federated.nexus">Matrix room</a
|
||||||
|
> let me know.
|
||||||
|
</StarlightPage>
|
99
src/pages/ru-ru/login.astro
Normal file
99
src/pages/ru-ru/login.astro
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{ title: "Sign In to Federated Nexus", template: "splash" }}
|
||||||
|
>
|
||||||
|
<form method="post" action="https://auth.federated.nexus/login">
|
||||||
|
<input type="hidden" name="state" />
|
||||||
|
<input type="hidden" name="nonce" />
|
||||||
|
<input type="hidden" name="user_id" />
|
||||||
|
<input type="hidden" name="access_token" />
|
||||||
|
<input type="hidden" name="redirect_uri" />
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Username
|
||||||
|
<input type="text" />
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Password
|
||||||
|
<input type="password" />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<noscript id="error">
|
||||||
|
This form will not function without JavaScript.
|
||||||
|
</noscript>
|
||||||
|
<span id="error"> </span>
|
||||||
|
<button type="submit"><span>Submit</span></button>
|
||||||
|
|
||||||
|
<a href="/register">Don't have an account? Sign up now!</a>
|
||||||
|
</form>
|
||||||
|
</StarlightPage>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const params = new URLSearchParams(window.location.search)
|
||||||
|
for (const name of ["redirect_uri", "state", "nonce"]) {
|
||||||
|
const input = document.querySelector(
|
||||||
|
`input[name="${name}"]`
|
||||||
|
) as HTMLInputElement
|
||||||
|
if (input && params.has(name)) input.value = params.get(name)!
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = document.querySelector("form")!
|
||||||
|
const error = document.querySelector("#error")! as HTMLSpanElement
|
||||||
|
form.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
|
error.style.display = "none"
|
||||||
|
|
||||||
|
try {
|
||||||
|
const username = (
|
||||||
|
form.querySelector('[type="text"]') as HTMLInputElement
|
||||||
|
).value
|
||||||
|
const password = (
|
||||||
|
form.querySelector('[type="password"]') as HTMLInputElement
|
||||||
|
).value
|
||||||
|
|
||||||
|
const session =
|
||||||
|
localStorage.getItem("session") ?? crypto.randomUUID()
|
||||||
|
localStorage.setItem("session", session)
|
||||||
|
|
||||||
|
const res = await fetch(
|
||||||
|
"https://matrix.federated.nexus/_matrix/client/v3/login",
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
type: "m.login.password",
|
||||||
|
device_id: session,
|
||||||
|
initial_device_display_name: `Federated Nexus Login from ${navigator.userAgent}`,
|
||||||
|
identifier: { type: "m.id.user", user: username },
|
||||||
|
password,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error((await res.json())["error"])
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await res.json()
|
||||||
|
|
||||||
|
const id = form.querySelector(
|
||||||
|
'input[name="user_id"]'
|
||||||
|
) as HTMLInputElement
|
||||||
|
id.value = data.user_id
|
||||||
|
|
||||||
|
const token = form.querySelector(
|
||||||
|
'input[name="access_token"]'
|
||||||
|
) as HTMLInputElement
|
||||||
|
token.value = data.access_token
|
||||||
|
|
||||||
|
form.submit()
|
||||||
|
} catch (err: any) {
|
||||||
|
error.textContent = err.message || "Login failed"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
26
src/pages/ru-ru/register.astro
Normal file
26
src/pages/ru-ru/register.astro
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{ title: "Register for Federated Nexus", template: "splash" }}
|
||||||
|
>
|
||||||
|
<form method="post" action="https://register.federated.nexus">
|
||||||
|
<label>
|
||||||
|
Username (alphanumeric only, no spaces)
|
||||||
|
<input
|
||||||
|
name="username"
|
||||||
|
type="text"
|
||||||
|
required
|
||||||
|
pattern="^[A-Za-z0-9]+$"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Email
|
||||||
|
<input name="email" type="email" required />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button type="submit"><span>Submit</span></button>
|
||||||
|
</form>
|
||||||
|
</StarlightPage>
|
14
src/pages/ru-ru/success.astro
Normal file
14
src/pages/ru-ru/success.astro
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{
|
||||||
|
title: "Successfully Registered for Federated Nexus",
|
||||||
|
template: "splash",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Once approved, you will receive an email with a username and password.
|
||||||
|
Approval usually takes less than two business days.
|
||||||
|
</StarlightPage>
|
16
src/pages/uk-ua/failure.astro
Normal file
16
src/pages/uk-ua/failure.astro
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{
|
||||||
|
title: "Registration failed",
|
||||||
|
template: "splash",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
An error occurred while we were registering you. Try again later, and if the
|
||||||
|
error persists, join our <a
|
||||||
|
href="https://matrix.to/#/#community:federated.nexus">Matrix room</a
|
||||||
|
> let me know.
|
||||||
|
</StarlightPage>
|
99
src/pages/uk-ua/login.astro
Normal file
99
src/pages/uk-ua/login.astro
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{ title: "Sign In to Federated Nexus", template: "splash" }}
|
||||||
|
>
|
||||||
|
<form method="post" action="https://auth.federated.nexus/login">
|
||||||
|
<input type="hidden" name="state" />
|
||||||
|
<input type="hidden" name="nonce" />
|
||||||
|
<input type="hidden" name="user_id" />
|
||||||
|
<input type="hidden" name="access_token" />
|
||||||
|
<input type="hidden" name="redirect_uri" />
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Username
|
||||||
|
<input type="text" />
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Password
|
||||||
|
<input type="password" />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<noscript id="error">
|
||||||
|
This form will not function without JavaScript.
|
||||||
|
</noscript>
|
||||||
|
<span id="error"> </span>
|
||||||
|
<button type="submit"><span>Submit</span></button>
|
||||||
|
|
||||||
|
<a href="/register">Don't have an account? Sign up now!</a>
|
||||||
|
</form>
|
||||||
|
</StarlightPage>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const params = new URLSearchParams(window.location.search)
|
||||||
|
for (const name of ["redirect_uri", "state", "nonce"]) {
|
||||||
|
const input = document.querySelector(
|
||||||
|
`input[name="${name}"]`
|
||||||
|
) as HTMLInputElement
|
||||||
|
if (input && params.has(name)) input.value = params.get(name)!
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = document.querySelector("form")!
|
||||||
|
const error = document.querySelector("#error")! as HTMLSpanElement
|
||||||
|
form.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
|
error.style.display = "none"
|
||||||
|
|
||||||
|
try {
|
||||||
|
const username = (
|
||||||
|
form.querySelector('[type="text"]') as HTMLInputElement
|
||||||
|
).value
|
||||||
|
const password = (
|
||||||
|
form.querySelector('[type="password"]') as HTMLInputElement
|
||||||
|
).value
|
||||||
|
|
||||||
|
const session =
|
||||||
|
localStorage.getItem("session") ?? crypto.randomUUID()
|
||||||
|
localStorage.setItem("session", session)
|
||||||
|
|
||||||
|
const res = await fetch(
|
||||||
|
"https://matrix.federated.nexus/_matrix/client/v3/login",
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
type: "m.login.password",
|
||||||
|
device_id: session,
|
||||||
|
initial_device_display_name: `Federated Nexus Login from ${navigator.userAgent}`,
|
||||||
|
identifier: { type: "m.id.user", user: username },
|
||||||
|
password,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error((await res.json())["error"])
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await res.json()
|
||||||
|
|
||||||
|
const id = form.querySelector(
|
||||||
|
'input[name="user_id"]'
|
||||||
|
) as HTMLInputElement
|
||||||
|
id.value = data.user_id
|
||||||
|
|
||||||
|
const token = form.querySelector(
|
||||||
|
'input[name="access_token"]'
|
||||||
|
) as HTMLInputElement
|
||||||
|
token.value = data.access_token
|
||||||
|
|
||||||
|
form.submit()
|
||||||
|
} catch (err: any) {
|
||||||
|
error.textContent = err.message || "Login failed"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
26
src/pages/uk-ua/register.astro
Normal file
26
src/pages/uk-ua/register.astro
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{ title: "Register for Federated Nexus", template: "splash" }}
|
||||||
|
>
|
||||||
|
<form method="post" action="https://register.federated.nexus">
|
||||||
|
<label>
|
||||||
|
Username (alphanumeric only, no spaces)
|
||||||
|
<input
|
||||||
|
name="username"
|
||||||
|
type="text"
|
||||||
|
required
|
||||||
|
pattern="^[A-Za-z0-9]+$"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Email
|
||||||
|
<input name="email" type="email" required />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button type="submit"><span>Submit</span></button>
|
||||||
|
</form>
|
||||||
|
</StarlightPage>
|
14
src/pages/uk-ua/success.astro
Normal file
14
src/pages/uk-ua/success.astro
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"
|
||||||
|
import "../styles/page.css"
|
||||||
|
---
|
||||||
|
|
||||||
|
<StarlightPage
|
||||||
|
frontmatter={{
|
||||||
|
title: "Successfully Registered for Federated Nexus",
|
||||||
|
template: "splash",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Once approved, you will receive an email with a username and password.
|
||||||
|
Approval usually takes less than two business days.
|
||||||
|
</StarlightPage>
|
Loading…
Add table
Add a link
Reference in a new issue