Skip to content

Commit

Permalink
Added: German translations (draft)
Browse files Browse the repository at this point in the history
  • Loading branch information
mellelieuwes committed Jun 13, 2024
1 parent c627a5f commit 31eae2d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## 2 - unreleased

* Added: German translations (draft)
* Added: Support for assets available in Python


Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,15 @@ import pandas as pd

table1_title = props.Translatable({
"en": "Title 1",
"de": "Titel 1",
"nl": "Titel 1"
})
table1_data = pd.DataFrame(data, columns=["columnX", "columnY", "columnZ"])
table1 = props.PropsUIPromptConsentFormTable("table_1", table1_title, table1_data)

table2_title = props.Translatable({
"en": "Title 2",
"de": "Titel 2",
"nl": "Titel 2"
})
table2_data = pd.DataFrame(data, columns=["columnA", "columnB", "columnC", "columnD"])
Expand Down Expand Up @@ -405,6 +407,7 @@ from port.api.props import Translatable

copy = Translatable({
"en": "English text",
"de": "Deutscher Text",
"nl": "Nederlandse tekst"
})
```
Expand Down Expand Up @@ -436,6 +439,7 @@ export const MyComponent = ({ dynamicCopy, locale }: Props): JSX.Element => {
const staticCopy = (): Translatable => {
return new TextBundle()
.add('en', 'English')
.add('de', 'Deutsch')
.add('nl', 'Nederlands')
}
```
Expand Down
7 changes: 7 additions & 0 deletions src/framework/processing/py/port/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def process(sessionId):
def render_donation_page(body):
header = props.PropsUIHeader(props.Translatable({
"en": "Port flow example",
"de": "Port beispiel",
"nl": "Port voorbeeld flow"
}))

Expand All @@ -62,14 +63,17 @@ def render_donation_page(body):
def retry_confirmation():
text = props.Translatable({
"en": "Unfortunately, we cannot process your file. Continue, if you are sure that you selected the right file. Try again to select a different file.",
"de": "Leider können wir Ihre Datei nicht bearbeiten. Fahren Sie fort, wenn Sie sicher sind, dass Sie die richtige Datei ausgewählt haben. Versuchen Sie erneut, eine andere Datei auszuwählen.",
"nl": "Helaas, kunnen we uw bestand niet verwerken. Weet u zeker dat u het juiste bestand heeft gekozen? Ga dan verder. Probeer opnieuw als u een ander bestand wilt kiezen."
})
ok = props.Translatable({
"en": "Try again",
"de": "Versuchen Sie es noch einmal",
"nl": "Probeer opnieuw"
})
cancel = props.Translatable({
"en": "Continue",
"de": "Weiter",
"nl": "Verder"
})
return props.PropsUIPromptConfirm(text, ok, cancel)
Expand All @@ -78,6 +82,7 @@ def retry_confirmation():
def prompt_file(extensions):
description = props.Translatable({
"en": "Please select any zip file stored on your device.",
"en": "Wählen Sie eine beliebige Zip-Datei aus, die Sie auf Ihrem Gerät gespeichert haben.",
"nl": "Selecteer een willekeurige zip file die u heeft opgeslagen op uw apparaat."
})

Expand Down Expand Up @@ -106,11 +111,13 @@ def prompt_consent(data, meta_data):

table_title = props.Translatable({
"en": "Zip file contents",
"de": "Inhalt der Zip-Datei",
"nl": "Inhoud zip bestand"
})

log_title = props.Translatable({
"en": "Log messages",
"en": "Logmeldungen",
"nl": "Log berichten"
})

Expand Down
13 changes: 13 additions & 0 deletions src/framework/visualisation/react/ui/elements/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,51 +458,62 @@ interface Copy {

const link = new TextBundle()
.add('en', 'Check out')
.add('de', 'Siehe')
.add('nl', 'Bekijk')

const searchPlaceholder = new TextBundle()
.add('en', 'Search')
.add('de', 'Suche')
.add('nl', 'Zoeken')

const noDataLabel = new TextBundle()
.add('en', 'No data found')
.add('de', 'Keine Daten gefunden')
.add('nl', 'Geen gegevens gevonden')

const noDataLeftLabel = new TextBundle()
.add('en', 'All data removed')
.add('de', 'Alle Daten gelöscht')
.add('nl', 'Alle gegevens verwijderd')

const noResultsLabel = new TextBundle()
.add('en', 'No search results')
.add('de', 'Keine Suchergebnisse')
.add('nl', 'Geen zoek resultaten')

const editLabel = new TextBundle()
.add('en', 'Adjust')
.add('de', 'Anpassen')
.add('nl', 'Aanpassen')

const undoLabel = new TextBundle()
.add('en', 'Undo')
.add('de', 'Wiederherstellung')
.add('nl', 'Herstel')

const deleteLabel = new TextBundle()
.add('en', 'Delete selected')
.add('de', 'Auswahl löschen')
.add('nl', 'Verwijder selectie')

function deletedNoneRowLabel (): TextBundle {
return new TextBundle()
.add('en', 'No adjustments')
.add('de', 'Keine Anpassungen')
.add('nl', 'Geen aanpassingen')
}

function deletedRowLabel (amount: number): TextBundle {
return new TextBundle()
.add('en', `${amount} row deleted`)
.add('de', `${amount} Zeile entfernt`)
.add('nl', `${amount} rij verwijderd`)
}

function deletedRowsLabel (amount: number): TextBundle {
return new TextBundle()
.add('en', `${amount} rows deleted`)
.add('de', `${amount} Zeilen entfernt`)
.add('nl', `${amount} rijen verwijderd`)
}

Expand All @@ -515,12 +526,14 @@ function deletedLabel (amount: number): TextBundle {
function singlePageLabel (): TextBundle {
return new TextBundle()
.add('en', '1 page')
.add('de', '1 Seite')
.add('nl', '1 pagina')
}

function multiplePagesLabel (amount: number): TextBundle {
return new TextBundle()
.add('en', `${amount} pages`)
.add('de', `${amount} Seiten`)
.add('nl', `${amount} pagina's`)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ function prepareCopy ({ header: { title }, locale }: Props): Copy {
const forwardButtonLabel = (): Translatable => {
return new TextBundle()
.add('en', 'Skip')
.add('de', 'Überspringen')
.add('nl', 'Overslaan')
}
2 changes: 2 additions & 0 deletions src/framework/visualisation/react/ui/pages/end_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ function prepareCopy ({ locale }: Props): Copy {

const title = new TextBundle()
.add('en', 'Thank you')
.add('de', 'Danke')
.add('nl', 'Bedankt')

const text = new TextBundle()
.add('en', 'Thank you for your participation. You can now close the page or refresh to restart the donation flow.')
.add('de', 'Herzlichen Dank für Ihre Teilnahme. Sie können diese Seite nun schließen oder die Seite aktualisieren, um den Ablauf erneut zu durchlaufen.')
.add('nl', 'Hartelijk dank voor uw deelname. U kunt deze pagina nu sluiten of de pagina verversen om de flow nogmaals te doorlopen.')
4 changes: 4 additions & 0 deletions src/framework/visualisation/react/ui/prompts/consent_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,20 @@ export const ConsentForm = (props: Props): JSX.Element => {

const donateQuestionLabel = new TextBundle()
.add('en', 'Do you want to donate the above data?')
.add('de', 'Möchten Sie die oben genannten Angaben spenden?')
.add('nl', 'Wilt u de bovenstaande gegevens doneren?')

const donateButtonLabel = new TextBundle()
.add('en', 'Yes, donate')
.add('de', 'Ja, spenden')
.add('nl', 'Ja, doneer')

const cancelButtonLabel = new TextBundle()
.add('en', 'No')
.add('de', 'Nein')
.add('nl', 'Nee')

const description = new TextBundle()
.add('en', 'Determine whether you would like to donate the data below. Carefully check the data and adjust when required. With your donation you contribute to the previously described research. Thank you in advance.')
.add('de', 'Entscheiden Sie, ob Sie die nachstehenden Angaben spenden möchten. Bitte überprüfen Sie die Angaben sorgfältig und passen Sie sie ggf. an. Mit Ihrer Spende tragen Sie zu der oben beschriebenen Forschung bei. Wir danken Ihnen im Voraus.')
.add('nl', 'Bepaal of u de onderstaande gegevens wilt doneren. Bekijk de gegevens zorgvuldig en pas zo nodig aan. Met uw donatie draagt u bij aan het eerder beschreven onderzoek. Alvast hartelijk dank.')
4 changes: 4 additions & 0 deletions src/framework/visualisation/react/ui/prompts/file_input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,27 @@ function prepareCopy ({ description, extensions, locale }: Props): Copy {
const continueButtonLabel = (): Translatable => {
return new TextBundle()
.add('en', 'Continue')
.add('de', 'Weiter')
.add('nl', 'Verder')
}

const selectButtonLabel = (): Translatable => {
return new TextBundle()
.add('en', 'Choose file')
.add('de', 'Datei wählen')
.add('nl', 'Kies bestand')
}

const note = (): Translatable => {
return new TextBundle()
.add('en', 'Note: The process to extract the correct data from the file is done on your own computer. No data is stored or sent yet.')
.add('de', 'Anmerkung: Der Prozess der Extraktion der korrekten Daten aus der Datei erfolgt auf Ihrem eigenen Computer. Es werden noch keine Daten gespeichert oder gesendet.')
.add('nl', 'NB: Het proces om de juiste gegevens uit het bestand te halen gebeurt op uw eigen computer. Er worden nog geen gegevens opgeslagen of verstuurd.')
}

const placeholder = (): Translatable => {
return new TextBundle()
.add('en', 'Choose a file')
.add('de', 'Eine Datei wählen')
.add('nl', 'Kies een bestand')
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ export const RadioInput = (props: Props): JSX.Element => {
const continueButtonLabel = (): Translatable => {
return new TextBundle()
.add('en', 'Continue')
.add('de', 'Weiter')
.add('nl', 'Doorgaan')
}

0 comments on commit 31eae2d

Please sign in to comment.