From c7f22dc9938c9fbee92abd37725c7dae480cb864 Mon Sep 17 00:00:00 2001 From: amrsoll Date: Mon, 29 Apr 2024 20:58:58 +0200 Subject: [PATCH 1/2] translations of public/ to english --- admin/dist/index.html | 8 +- admin/dist/member.html | 8 +- admin/src/Components/CategoryPeriodsInput.js | 21 +-- admin/src/Components/CollectionTable.js | 18 +-- admin/src/Components/Currency.jsx | 2 +- admin/src/Components/FileInput.jsx | 43 ++---- admin/src/Components/GroupForm.js | 22 +-- admin/src/Components/KeyHandoutForm.jsx | 71 +++------ admin/src/Components/Login.jsx | 34 ++--- admin/src/Components/MemberForm.js | 139 +++++------------- admin/src/Components/MessageForm.jsx | 24 +-- admin/src/Components/ProductForm.jsx | 130 ++++------------ admin/src/Components/RequestPasswordReset.jsx | 27 +--- admin/src/Components/SearchBox.jsx | 14 +- admin/src/Membership/GroupAdd.js | 2 +- admin/src/Membership/GroupBox.jsx | 27 +--- admin/src/Membership/GroupBoxMembers.jsx | 27 ++-- admin/src/Membership/KeyEdit.jsx | 8 +- admin/src/Membership/MemberList.jsx | 18 +-- admin/src/Sales/AccountingExport.jsx | 6 +- admin/src/Statistics/StatisticsOverview.js | 2 +- admin/src/app.jsx | 38 ++--- admin/src/auth.js | 20 +-- api/src/change_phone_request.py | 2 +- api/src/firstrun.py | 12 +- .../messages/test/labacess_reminder_test.py | 2 +- .../messages/test/membership_reminder_test.py | 2 +- api/src/multiaccessy/README.md | 2 +- api/src/shop/stripe_subscriptions.py | 4 +- .../shop/test/stripe_product_price_test.py | 48 +++--- api/src/shop/test/stripe_util_test.py | 2 +- api/src/systest/api/purchase_test.py | 2 +- api/src/test_aid/obj.py | 2 +- public/src/templates/product.html | 4 +- public/ts/cartpage.tsx | 17 +-- public/ts/courses.tsx | 16 +- public/ts/history.tsx | 4 +- public/ts/licenses.tsx | 4 +- public/ts/login.tsx | 32 ++-- public/ts/member.tsx | 39 +++-- public/ts/payment_common.tsx | 10 +- public/ts/receipt.tsx | 3 +- public/ts/register.tsx | 4 +- public/ts/shop.tsx | 2 +- public/ts/sidebar.tsx | 14 +- public/ts/statistics.ts | 6 +- public/ts/translations.tsx | 32 ++-- 47 files changed, 345 insertions(+), 629 deletions(-) diff --git a/admin/dist/index.html b/admin/dist/index.html index 5896d74c2..25afd2ade 100644 --- a/admin/dist/index.html +++ b/admin/dist/index.html @@ -1,9 +1,9 @@ - - - - Makeradmin - Stockholm Makerspace + + + + Makeradmin v1.0 - Odense Makerspace - - - - Medlemssidor v0.1 - Stockholm Makerspace + + + + Memberpage v0.1 - Odense Makerspace ); })} - + ); } diff --git a/admin/src/Components/CollectionTable.js b/admin/src/Components/CollectionTable.js index df86b2107..bcffd44d3 100644 --- a/admin/src/Components/CollectionTable.js +++ b/admin/src/Components/CollectionTable.js @@ -168,18 +168,12 @@ export default class CollectionTable extends React.Component { {rows} - {loading ? ( -
-
- - {" "} - Hämtar data... - -
-
- ) : ( - "" - )} + {loading ? +
+
+ Retrieving data... +
+
: ''} {pagination} diff --git a/admin/src/Components/Currency.jsx b/admin/src/Components/Currency.jsx index a0f24f901..a0d5d509a 100644 --- a/admin/src/Components/Currency.jsx +++ b/admin/src/Components/Currency.jsx @@ -1,7 +1,7 @@ import React from "react"; const Currency = (props) => { - const formatter = new Intl.NumberFormat("sv-SE", { + const formatter = new Intl.NumberFormat('da-DK', { // style: 'currency', // currency: 'SEK', minimumFractionDigits: 2, diff --git a/admin/src/Components/FileInput.jsx b/admin/src/Components/FileInput.jsx index bd08ce26b..2c2704fea 100644 --- a/admin/src/Components/FileInput.jsx +++ b/admin/src/Components/FileInput.jsx @@ -105,36 +105,19 @@ module.exports = class FileInput extends React.Component { this.state.model.set(this.props.name, event.target.value); } */ - render() { - return ( -
-
-

- - {this.state.filename ? ( - - {this.state.filename} ( - - Ta bort - - ) - - ) : ( - - Ladda upp genom att dra och släppa en fil här - eller klicka på{" "} - - ladda upp - - - . - - )} -

+ render() + { + return ( +
+
+

+ + {this.state.filename ? + {this.state.filename} (Delete) + : + Upload by dragging and dropping a file here or click upload. + } +

{this.state.progressbarVisible ? (
diff --git a/admin/src/Components/GroupForm.js b/admin/src/Components/GroupForm.js index 99e4d74e2..ecb47dc62 100644 --- a/admin/src/Components/GroupForm.js +++ b/admin/src/Components/GroupForm.js @@ -1,6 +1,6 @@ import React from "react"; -import TextInput from "./TextInput"; import { withRouter } from "react-router"; +import TextInput from "./TextInput"; import Textarea from "./Textarea"; class GroupForm extends React.Component { @@ -51,24 +51,8 @@ class GroupForm extends React.Component {
- {group.id ? ( - - Ta bort - grupp - - ) : ( - "" - )} - + {group.id ? Remove group : ""} +
diff --git a/admin/src/Components/KeyHandoutForm.jsx b/admin/src/Components/KeyHandoutForm.jsx index 13b5b9849..480b6f7fa 100644 --- a/admin/src/Components/KeyHandoutForm.jsx +++ b/admin/src/Components/KeyHandoutForm.jsx @@ -1,14 +1,13 @@ import React from "react"; -import { Prompt } from "react-router"; -import TextInput from "./TextInput"; -import { withRouter } from "react-router"; -import Span, { filterCategory } from "../Models/Span"; +import { renderToString } from "react-dom/server"; +import { Prompt, withRouter } from "react-router"; import Collection from "../Models/Collection"; import { ADD_LABACCESS_DAYS } from "../Models/ProductAction"; -import { dateTimeToStr, parseUtcDate, utcToday } from "../utils"; +import Span, { filterCategory } from "../Models/Span"; import { get, post } from "../gateway"; import { notifySuccess } from "../message"; -import { renderToString } from "react-dom/server"; +import { dateTimeToStr, parseUtcDate, utcToday } from "../utils"; +import TextInput from "./TextInput"; function last_span_enddate(spans, category) { const last_span = filterCategory(spans, category).splice(-1)[0]; @@ -27,35 +26,14 @@ function DateView(props) { let status, text; if (!props.date) { - status = ( -
- Saknas -
- ); - text = ( -

- {props.placeholder} -

- ); + status =
Missing
; + text =

{props.placeholder}

; } else if (!is_valid) { - status = ( -
- Utgånget -
- ); - text = ( -

- Giltigt till:{" "} - - {props.date} - -

- ); + status =
Expired
; + text =

Valid untill: {props.date}

; } else { - status = ( -
OK
- ); - text =

Giltigt till: {props.date}

; + status =
OK
; + text =

Valid untill: {props.date}

; } // Override if there are pending days to be synchronized @@ -65,23 +43,12 @@ function DateView(props) { ); } - return ( -
-

- {props.title} -

- {status} - {text} - {props.pending ? ( -

- - ({props.pending} dagar kommer läggas till vid en - nyckelsynkronisering) - -

- ) : null} -
- ); + return
+

{props.title}

+ {status} + {text} + { props.pending ?

({props.pending} days will be added after key sync)

: null } +
; } class KeyHandoutForm extends React.Component { @@ -223,7 +190,7 @@ class KeyHandoutForm extends React.Component { if (this.state.accessy_in_org) { notifySuccess("Medlem redan i Makerspace Accessy org"); } else { - notifySuccess("Accessy invite skickad"); + notifySuccess("Accessy invite succeeded"); } }); return false; @@ -277,7 +244,7 @@ class KeyHandoutForm extends React.Component { } else { invite_part = ( - Invite skickad + Invite succeeded ); } diff --git a/admin/src/Components/Login.jsx b/admin/src/Components/Login.jsx index b1acfc3eb..a58919088 100644 --- a/admin/src/Components/Login.jsx +++ b/admin/src/Components/Login.jsx @@ -9,8 +9,9 @@ export default class Login extends React.Component { const username = this.username.value; const password = this.password.value; - if (!username || !password) { - showError("Du måste fylla i email/medlemsnummer och lösenord"); + if (!username || !password) + { + showError("You must enter a username and password"); return; } @@ -29,20 +30,13 @@ export default class Login extends React.Component { onSubmit={this.login.bind(this)} >
-

Logga in

+

Log in

- - { - this.username = c; - }} - className="uk-form-large uk-form-width-large" - type="text" - placeholder="Email/Medlemsnummer" - /> + + { this.username = c; }} className="uk-form-large uk-form-width-large" type="text" placeholder="Email / User ID" />
@@ -55,27 +49,17 @@ export default class Login extends React.Component { }} className="uk-form-large uk-form-width-large" type="password" - placeholder="Lösenord" + placeholder="Password" />
- +
- - Glömt ditt lösenord? - + Forgot your password?
diff --git a/admin/src/Components/MemberForm.js b/admin/src/Components/MemberForm.js index 450d8ca0a..b6077dc5e 100644 --- a/admin/src/Components/MemberForm.js +++ b/admin/src/Components/MemberForm.js @@ -1,8 +1,8 @@ import React from "react"; +import { withRouter } from "react-router"; import CountryDropdown from "./CountryDropdown"; import DateTimeShow from "./DateTimeShow"; import TextInput from "./TextInput"; -import { withRouter } from "react-router"; class MemberForm extends React.Component { constructor(props) { @@ -42,61 +42,23 @@ class MemberForm extends React.Component { Personuppgifter - - - - - + + + + +
- - Adress - + Address - - - - + + + +
- +
- - {member.id ? ( -
- - Metadata - - -
- -
- -   - -
-
- -
- -
- -   - -
-
-
- ) : ( - "" - )} + + {member.id + ? +
+ Metadata + +
+ +
+ +   + +
+
+ +
+ +
+ +   + +
+
+
+ : + ""}
- {member.id ? ( - - Ta bort medlem - - ) : ( - "" - )} - + {member.id ? Remove member : ""} +
diff --git a/admin/src/Components/MessageForm.jsx b/admin/src/Components/MessageForm.jsx index 2ce11a06d..4f276cb58 100644 --- a/admin/src/Components/MessageForm.jsx +++ b/admin/src/Components/MessageForm.jsx @@ -1,11 +1,11 @@ import React from "react"; import { withRouter } from "react-router"; -import TextInput from "./TextInput"; -import Textarea from "./Textarea"; import { Async } from "react-select"; -import { get } from "../gateway"; import Group from "../Models/Group"; import Member from "../Models/Member"; +import { get } from "../gateway"; +import TextInput from "./TextInput"; +import Textarea from "./Textarea"; const groupOption = (d) => { const id = d[Group.model.id]; @@ -13,7 +13,7 @@ const groupOption = (d) => { return { id, type, - label: `Grupp: ${d.title}`, + label: `Group: ${d.title}`, value: type + id, }; }; @@ -25,7 +25,7 @@ const memberOption = (d) => { return { id, type, - label: `Medlem: ${d.firstname} ${lastname} (#${d.member_number})`, + label: `Member: ${d.firstname} ${lastname} (#${d.member_number})`, value: type + id, }; }; @@ -123,20 +123,10 @@ class MessageForm extends React.Component {
-

- - {message.body.length} - {" "} - tecken -

+

{message.body.length} sign

- +
diff --git a/admin/src/Components/ProductForm.jsx b/admin/src/Components/ProductForm.jsx index a041b6ad9..d3dedf305 100644 --- a/admin/src/Components/ProductForm.jsx +++ b/admin/src/Components/ProductForm.jsx @@ -1,12 +1,12 @@ import React from "react"; -import TextInput from "./TextInput"; -import Textarea from "./Textarea"; -import DateTimeInput from "./DateTimeInput"; -import * as _ from "underscore"; -import SelectInput from "./SelectInput"; import ReactSelect from "react-select"; +import * as _ from "underscore"; import ProductAction, { ACTION_TYPES } from "../Models/ProductAction"; import CheckboxInput from "./CheckboxInput"; +import DateTimeInput from "./DateTimeInput"; +import SelectInput from "./SelectInput"; +import TextInput from "./TextInput"; +import Textarea from "./Textarea"; // Return list of available actions types based on selected ones const filterAvailableActions = (actions) => { @@ -118,46 +118,14 @@ class ProductForm extends React.Component { }} >
- - Produkt - - - - o.name} - getValue={(o) => o.id} - dataSource={"/webshop/category"} - /> - )} - {!this.state.csv_content && ( - this.exportMembers()} - > - Exportera alla aktiva medlemmar som CSV - {this.state.state === "loading" ? "..." : ""} + { !this.state.csv_content && ( + this.exportMembers()}> + Export all active members as CSV{this.state.state === "loading" ? "..." : ""} )}
diff --git a/admin/src/Membership/MemberList.jsx b/admin/src/Membership/MemberList.jsx index d7844fc8a..ac3213d85 100644 --- a/admin/src/Membership/MemberList.jsx +++ b/admin/src/Membership/MemberList.jsx @@ -45,7 +45,7 @@ class MemberList extends CollectionNavigation { {title: "First name", sort: "firstname"}, {title: "Last name", sort: "lastname"}, {title: "Email", sort: "email"}, - {title: "Became member", sort: "created_at"}, + {title: "Joined", sort: "created_at"}, {title: ""}, ]; @@ -53,15 +53,8 @@ class MemberList extends CollectionNavigation {

Medlemmar

-

- På denna sida ser du en lista på samtliga medlemmar. -

- - Skapa ny medlem - +

On this page you see the list of all the members.

+ Create new member { - e.preventDefault(); - onSave(); - return false; - }} - > - - - this.setState({ showHistoric: e.target.checked }) - } - /> - {this.categoryPeriodsList.map((cp) => ( - - ))} - +
{e.preventDefault(); onSave(); return false;}}> + + this.setState({showHistoric: e.target.checked})}/> + {this.categoryPeriodsList.map(cp => )} + ); } diff --git a/admin/src/Membership/SpanList.jsx b/admin/src/Membership/SpanList.jsx index bc8c959d9..f2325c2a1 100644 --- a/admin/src/Membership/SpanList.jsx +++ b/admin/src/Membership/SpanList.jsx @@ -1,12 +1,12 @@ import React from "react"; import { Link } from "react-router-dom"; -import Date from "../Components/DateShow"; -import Collection from "../Models/Collection"; import CollectionTable from "../Components/CollectionTable"; +import Date from "../Components/DateShow"; import DateTimeShow from "../Components/DateTimeShow"; +import Collection from "../Models/Collection"; +import CollectionNavigation from "../Models/CollectionNavigation"; import Span from "../Models/Span"; import { confirmModal } from "../message"; -import CollectionNavigation from "../Models/CollectionNavigation"; const Row = (deleteItem) => (props) => { const { item } = props; @@ -67,25 +67,20 @@ class SpanList extends CollectionNavigation { ); const columns = [ - { title: "#", sort: "span_id" }, - { title: "Typ", sort: "type" }, - { title: "Skapad", sort: "created_at" }, - { title: "" }, - { title: "Raderad", sort: "deleted_at" }, - { title: "Medlem", sort: "member_id" }, - { title: "Start", sort: "startdate" }, - { title: "Slut", sort: "enddate" }, + {title: "#", sort: "span_id"}, + {title: "Type", sort: "type"}, + {title: "Created", sort: "created_at"}, + {title: ""}, + {title: "Deleted", sort: "deleted_at"}, + {title: "Member id", sort: "member_id"}, + {title: "Start", sort: "startdate"}, + {title: "End", sort: "enddate"}, ]; return (
-

Medlemsperioder

- +

Membership periods

+
); } diff --git a/admin/src/Membership/SpanShow.jsx b/admin/src/Membership/SpanShow.jsx index 2f8de734b..df5289ef8 100644 --- a/admin/src/Membership/SpanShow.jsx +++ b/admin/src/Membership/SpanShow.jsx @@ -25,7 +25,7 @@ class SpanShow extends React.Component { return (
-

Medlemsperiod {data.span_id}

+

Membership periods {data.span_id}

{_.keys(data).map((key) => (