Skip to content

Commit

Permalink
Clean up translations
Browse files Browse the repository at this point in the history
This moves any top-level strings to `general`,
removes some (but not all) duplications,
renames some strings and fixes some punctuation stuff.
  • Loading branch information
owi92 committed Sep 8, 2023
1 parent 1924d4b commit d1a8177
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 90 deletions.
54 changes: 23 additions & 31 deletions frontend/src/i18n/locales/de.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
language-name: Deutsch
language: Sprache
language-selection: Sprachauswahl, Deutsch ausgewählt
loading: Lade...
close: Schließen
cancel: Abbrechen
save: Speichern
back: Zurück
home: Startseite
navigation: Navigation
rename: Umbenennen
this-field-is-required: Dieses Feld ist erforderlich.
version-information: Version

general:
goto-homepage: Zur Startseite
language:
language_one: Sprache
language_other: Sprachen
name: Deutsch
selection: Sprachauswahl, Deutsch ausgewählt
loading: Lade...
home: Startseite
homepage: Startseite
navigation: Navigation
leave-page-confirmation: >
Seite verlassen? Vorgenommene Änderungen sind möglicherweise noch nicht gespeichert!
action:
close: Schließen
cancel: Abbrechen
save: Speichern
back: Zurück
rename: Umbenennen
goto-homepage: Zur Startseite
share: Teilen
version-information: Version
logo-alt: Das Logo von „{{title}}“
no-root-children: Noch keine Seiten ...
failed-to-load-thumbnail: Konnte Vorschaubild nicht laden
failed-to-load-thumbnail: Vorschaubild konnte nicht geladen werden.
yes: Ja
no: Nein
share: Teilen
form:
this-field-is-required: Dieses Feld ist erforderlich.
select:
no-options: Keine Optionen
select-option: Option auswählen...


welcome:
title: Willkommen zu Tobira!
body: >
Expand All @@ -50,7 +51,7 @@ errors:
are-you-connected-to-internet: Sind Sie mit dem Internet verbunden?
unknown: Unbekannter Fehler.
detailed-error-info: Detaillierte Fehlerinformationen für Entwickler
embedded: In der eingebetteten Anwendung ist ein Fehler aufgetreten
embedded: In der eingebetteten Anwendung ist ein Fehler aufgetreten.

not-found:
page-not-found: Seite nicht gefunden
Expand Down Expand Up @@ -126,8 +127,6 @@ video:
created: Erstellt
updated: Zuletzt angepasst
duration: Abspielzeit
language_one: Sprache
language_other: Sprachen
part-of-series: Teil von Serie
more-from-series: Mehr von „{{series}}“
deleted-video-block: Das hier referenzierte Video wurde gelöscht.
Expand All @@ -146,15 +145,14 @@ video:
source: Quelle
stream-ended: Dieser Stream ist beendet.
stream-not-started-yet: Dieser Stream hat noch nicht begonnen.
started-generic: Gestartet
started: Gestartet {{duration}}
started: Gestartet
started-when: Gestartet {{duration}}
starts: Startet
starts-in: Startet {{duration}}
description:
show-more: Mehr anzeigen
show-less: Weniger anzeigen
embed:
button: Einbetten
title: Video einbetten
copy-embed-code-to-clipboard: Einbettungscode in Zwischenablage kopieren
caption: Untertitel
Expand Down Expand Up @@ -294,10 +292,6 @@ upload:
jwt-invalid: 'Interner Fremdauthentifizierungsfehler: Opencast hat das Hochladen nicht autorisiert.'

manage:
nav:
dashboard: Dashboard
my-videos: Meine Videos

dashboard:
title: Dashboard
upload-tile: Hier können Sie Videos von Ihrem Computer hochladen.
Expand Down Expand Up @@ -473,10 +467,8 @@ manage:
title: Titel
show-title: Titel anzeigen

save: Speichern
cancel: Verwerfen
confirm-cancel: Änderungen verwerfen?

cancel-warning: Ihre Änderungen wurden noch nicht gespeichert!

removing-failed: Entfernen ist fehlgeschlagen.
Expand Down Expand Up @@ -524,4 +516,4 @@ api-remote-errors:
Kontaktieren Sie einen Systemadministrator für weitere Unterstützung.
embed:
not-supported: Diese Seite kann nicht eingebettet werden
not-supported: Diese Seite kann nicht eingebettet werden.
57 changes: 25 additions & 32 deletions frontend/src/i18n/locales/en.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
language-name: English
language: Language
language-selection: Language selection, English selected
loading: Loading...
close: Close
cancel: Cancel
save: Save
back: Back
home: Home
navigation: Navigation
rename: Rename
this-field-is-required: This field is required.
version-information: Version

general:
language:
language_one: Language
language_other: Languages
name: English
selection: Language selection, English selected
loading: Loading...
home: Home
homepage: Homepage
goto-homepage: Go to homepage
navigation: Navigation
leave-page-confirmation: Leave page? Changes you made may not be saved!
action:
close: Close
cancel: Cancel
save: Save
back: Back
rename: Rename
goto-homepage: Go to homepage
share: Share
version-information: Version
logo-alt: Logo of “{{title}}”
no-root-children: No pages yet ...
failed-to-load-thumbnail: Failed to load thumbnail
failed-to-load-thumbnail: Failed to load thumbnail.
yes: "Yes"
no: "No"
share: Share
form:
this-field-is-required: This field is required.
select:
no-options: No options
select-option: Select option...
Expand All @@ -48,7 +50,7 @@ errors:
are-you-connected-to-internet: Are you connected to the internet?
unknown: Unknown error.
detailed-error-info: Detailed error information for developers
embedded: An error occurred in the embedded application
embedded: An error occurred in the embedded application.

not-found:
page-not-found: Page not found
Expand Down Expand Up @@ -123,16 +125,14 @@ video:
created: Created
updated: Last updated
duration: Duration
language_one: Language
language_other: Languages
part-of-series: Part of series
more-from-series: More from “{{series}}”
deleted-video-block: The video referenced here was deleted.
not-allowed-video-block: You are not allowed to view the video embedded here.
not-ready:
title: Video not processed, yet
title: Video not processed yet
text: >
This video hasn't been processed, yet. This should
This video hasn't been processed yet. This should
happen automatically soon. Try again in a few minutes.
label: unprocessed
thumbnail-for: Thumbnail for “{{video}}”
Expand All @@ -143,15 +143,14 @@ video:
source: Source
stream-ended: This stream has ended.
stream-not-started-yet: This stream has not started yet.
started-generic: Started
started: Started {{duration}}
started: Started
started-when: Started {{duration}}
starts: Starts
starts-in: Starts {{duration}}
description:
show-more: Show more
show-less: Show less
embed:
button: Embed
title: Embed video
copy-embed-code-to-clipboard: Copy embed code to clipboard
caption: Caption
Expand Down Expand Up @@ -287,10 +286,6 @@ upload:
jwt-invalid: 'Internal cross-authentication error: Opencast did not authorize the upload.'

manage:
nav:
dashboard: Dashboard
my-videos: My videos

dashboard:
title: Dashboard
upload-tile: Here you can upload a new video from your computer.
Expand Down Expand Up @@ -460,10 +455,8 @@ manage:
title: Title
show-title: Show title

save: Save
cancel: Discard
confirm-cancel: Discard changes?

cancel-warning: Your changes have not yet been saved!

removing-failed: Removing failed.
Expand Down Expand Up @@ -511,4 +504,4 @@ api-remote-errors:
further assistance.
embed:
not-supported: This page can't be embedded
not-supported: This page can't be embedded.
4 changes: 2 additions & 2 deletions frontend/src/layout/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Nav: React.FC<Props> = ({ fragRef }) => {
const parent = realm.isUserRoot
? {
path: "/",
name: t("home"),
name: t("general.home"),
isMainRoot: true,
}
: realm.parent;
Expand Down Expand Up @@ -78,7 +78,7 @@ export const Nav: React.FC<Props> = ({ fragRef }) => {
{/* Show arrow and hide chevron in burger menu */}
<FiCornerLeftUp css={{ display: "none" }}/>
<FiChevronLeft />
{parent.isMainRoot ? t("home") : parent.name ?? <MissingRealmName />}
{parent.isMainRoot ? t("general.home") : parent.name ?? <MissingRealmName />}
</LinkWithIcon>
<div css={{
padding: "8px 14px 8px 16px",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const InitialLoading: React.FC = () => {
marginTop: 32,
animation: `${pulsing} 1.2s infinite`,
fontSize: 20,
}}>{t("loading")}</div>
}}>{t("general.loading")}</div>
</div>
</Main>
<Footer />
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/layout/header/UserBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ export const LanguageSettings: React.FC = () => {

const menuItems = Object.keys(languages).map(lng => checkboxMenuItem({
checked: isCurrentLanguage(lng),
children: <>{t("language-name", { lng })}</>,
children: <>{t("general.language.name", { lng })}</>,
onClick: () => {
if (!isCurrentLanguage(lng)) {
i18n.changeLanguage(lng);
}
},
}));

const label = t("language");
const label = t("general.language.language_one");
return (
<WithHeaderMenu
menu={{
Expand All @@ -153,7 +153,7 @@ export const LanguageSettings: React.FC = () => {
breakpoint: BREAKPOINT_MEDIUM,
}}
>
<ActionIcon title={t("language-selection")}>
<ActionIcon title={t("general.language.selection")}>
<HiOutlineTranslate />
</ActionIcon>
</WithHeaderMenu>
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/layout/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ const SearchMode: React.FC = () => {
const menu = useMenu();

return <>
<ActionIcon title={t("back")} onClick={() => menu.close()} css={{ marginLeft: 8 }}>
<ActionIcon
title={t("general.action.back")}
onClick={() => menu.close()}
css={{ marginLeft: 8 }}
>
<FiArrowLeft />
</ActionIcon>
<SearchField variant="mobile" />
Expand All @@ -73,7 +77,7 @@ const OpenMenuMode: React.FC = () => {
<Logo />
<ButtonContainer>
<ActionIcon
title={t("close")}
title={t("general.action.close")}
onClick={() => menu.close()}
css={buttonOutline}
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const About: React.FC = () => {
<a href="https://github.com/elan-ev/tobira">GitHub repo</a>
</Trans>
</p>
<h2>{t("version-information")}</h2>
<h2>{t("general.version-information")}</h2>
<a href={`https://github.com/elan-ev/tobira/releases/tag/${version.identifier}`}>
Tobira <strong>{version.identifier}</strong>
</a>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const BackButton: React.FC = () => {
borderRadius: 4,
textDecoration: "none",
}}
><FiChevronLeft />{t("back")}</Link>;
><FiChevronLeft />{t("general.action.back")}</Link>;
};

type FormData = {
Expand All @@ -129,7 +129,7 @@ const LoginBox: React.FC = () => {
const userid = watch("userid", "");
const password = watch("password", "");

const validation = { required: t("this-field-is-required") };
const validation = { required: t("general.form.this-field-is-required") };

type State = "idle" | "pending" | "success";
const [state, setState] = useState<State>("idle");
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/routes/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ const ShareButton: React.FC<{ event: SyncedEvent }> = ({ event }) => {
<FloatingTrigger>
<Button onClick={() => setState(state => state === "closed" ? "main" : "closed")}>
<FiShare2 size={16} />
{t("general.share")}
{t("general.action.share")}
</Button>
</FloatingTrigger>
<Floating
Expand Down Expand Up @@ -772,7 +772,7 @@ const VideoDate: React.FC<VideoDateProps> = ({ event }) => {
} else if (event.isLive) {
tooltip = <>
<i>{hasStarted
? t("video.started-generic")
? t("video.started")
: t("video.starts")
}
</i>: {startFull}
Expand Down Expand Up @@ -804,7 +804,7 @@ const VideoDate: React.FC<VideoDateProps> = ({ event }) => {

tooltip = <>
{startedDate
? <><i>{t("video.started-generic")}</i>: {startFull}</>
? <><i>{t("video.started")}</i>: {startFull}</>
: <><i>{t("video.created")}</i>: {createdFull}</>
}
{updatedFull && <>
Expand Down Expand Up @@ -851,7 +851,7 @@ const MetadataTable = React.forwardRef<HTMLDListElement, MetadataTableProps>(({
const languages = event.metadata.dcterms.language.map(lng => languageNames.of(lng) ?? lng);

pairs.push([
t("video.language", { count: languages.length }),
t("general.language.language", { count: languages.length }),
languages.join(", "),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/manage/Realm/ChildOrder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const ChildOrder: React.FC<Props> = ({ fragRef }) => {
</ChildList>

<div css={{ display: "flex", alignItems: "center" }}>
<Button onClick={save} disabled={!anyChange}>{t("save")}</Button>
<Button onClick={save} disabled={!anyChange}>{t("general.action.save")}</Button>
{isInFlight && <Spinner size={20} css={{ marginLeft: 16 }} />}
</div>
{boxError(commitError)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const EditModeButtons: React.FC<EditModeButtonsProps> = ({ onCancel }) => {
kind="happy"
type="submit"
>
{t("manage.realm.content.save")}
{t("general.action.save")}
</Button>
</div>;
};
Loading

0 comments on commit d1a8177

Please sign in to comment.