diff options
author | 2021-09-02 22:28:11 +0200 | |
---|---|---|
committer | 2021-09-02 23:54:56 +0200 | |
commit | f08f6ca0a9d337efff280d4d1669a41b5d9c31c2 (patch) | |
tree | 7dee778ba742deb5f499f2aa08a1ba040606d633 /configs | |
parent | 9f74c550927671f4ded301d0cf3e9d592716375c (diff) | |
download | my_apps-f08f6ca0a9d337efff280d4d1669a41b5d9c31c2.tar.gz my_apps-f08f6ca0a9d337efff280d4d1669a41b5d9c31c2.tar.bz2 my_apps-f08f6ca0a9d337efff280d4d1669a41b5d9c31c2.zip |
finish translations, force maximize
Diffstat (limited to 'configs')
-rw-r--r-- | configs/appList.js | 8 | ||||
-rw-r--r-- | configs/dbConnect.js | 46 | ||||
-rw-r--r-- | configs/sendMail.js | 26 | ||||
-rw-r--r-- | configs/translations.js | 284 |
4 files changed, 364 insertions, 0 deletions
diff --git a/configs/appList.js b/configs/appList.js new file mode 100644 index 0000000..a114a70 --- /dev/null +++ b/configs/appList.js @@ -0,0 +1,8 @@ +import {Notes, Settings} from 'apps' + +const appList = { + Notes: {component: Notes, icon: true, buttons: ['min', 'max', 'close'], height: '64em', width: '64em'}, + Settings: {component: Settings, icon: false, buttons: ['min'], height: '23em', width: '20em'}, +}; + +export default appList diff --git a/configs/dbConnect.js b/configs/dbConnect.js new file mode 100644 index 0000000..0a0d200 --- /dev/null +++ b/configs/dbConnect.js @@ -0,0 +1,46 @@ +import mongoose from 'mongoose' + +const MONGODB_URI = process.env.MYAPPS_MONGODB_URI +// const MONGODB_URI = 'mongodb://localhost:27017/myapps' + +if (!MONGODB_URI) { + throw new Error( + 'MONGODB_URI missing in dbConnect' + ) +} + +/** + * Global is used here to maintain a cached connection across hot reloads + * in development. This prevents connections growing exponentially + * during API Route usage. + */ +let cached = global.mongoose + +if (!cached) { + cached = global.mongoose = {conn: null, promise: null} +} + +async function dbConnect() { + if (cached.conn) { + return cached.conn + } + + if (!cached.promise) { + const opts = { + useNewUrlParser: true, + useUnifiedTopology: true, + bufferCommands: false, + bufferMaxEntries: 0, + useFindAndModify: false, + useCreateIndex: true, + } + + cached.promise = mongoose.connect(MONGODB_URI, opts).then((mongoose) => { + return mongoose + }) + } + cached.conn = await cached.promise + return cached.conn +} + +export default dbConnect diff --git a/configs/sendMail.js b/configs/sendMail.js new file mode 100644 index 0000000..f50eaf1 --- /dev/null +++ b/configs/sendMail.js @@ -0,0 +1,26 @@ +import nodemailer from 'nodemailer' + +const sendMail = (to, subject, text, html) => { + + const transporter = nodemailer.createTransport({ + port: 465, + host: process.env.MYAPPS_MAIL_SMTP_SERVER, + auth: { + user: process.env.MYAPPS_MAIL_ADDRESS, + pass: process.env.MYAPPS_MAIL_PASSWORD, + }, + secure: true, + }) + + const mailData = { + from: `"Notes App" <${process.env.MYAPPS_MAIL_ADDRESS}>`, + to, + subject, + text, + html, + } + + return transporter.sendMail(mailData) +} + +export default sendMail diff --git a/configs/translations.js b/configs/translations.js new file mode 100644 index 0000000..4d204ea --- /dev/null +++ b/configs/translations.js @@ -0,0 +1,284 @@ +const translations = { + en: { + register_user: 'Register new user', + log_in: 'Log in to My Apps', + password: 'password', + confirm_password: 'confirm password', + color_theme: 'Color theme:', + language: 'Language:', + login: 'Login', + login_error: 'Could not log in', + logout: 'Logout', + register: 'Register', + register_error: 'Could not register user', + edit: 'Edit', + remove: 'Remove', + copy: 'Copy', + save: 'Save', + back: 'Back', + cancel: 'Cancel', + select_all: 'Select all', + import: 'Import', + export: 'Export', + choose_files: 'Choose files', + import_finished: 'Import finished.', + no_connection: 'No connection', + loading: 'Loading...', + sending: 'Sending...', + title: 'Title', + created: 'Created', + modified: 'Modified', + Notes: 'Notes', + Settings: 'Settings', + mail_ver_subject: 'Verification of your new My Apps account', + mail_ver_t1: 'Thank you for creating an account in My Apps.', + mail_ver_t2: 'We are sending you the verification code:', + mail_ver_t3: 'To finish verification log in and paste this code.', + verification_mail_error: 'Could not send verification email', + verification_error: 'Could not verify user', + verification_title: 'One last step missing!', + verification_text: 'To start using My Apps type the verification code we sent to your email', + verification_key: 'Verification key', + verify: 'Verify', + verification_not_received: 'If you did not receive the verification email', + verification_send_again: 'send it again', + verification_sent_again: 'Mail was successfully sent again, check your mailbox!', + settings_saved: 'Settings saved', + settings_save_error: 'Could not save settings', + passwords_not_match: 'Passwords do not match', + notes_new: 'New note', + notes_edit: 'Edit note:', + notes_add: 'Add note', + notes_save: 'Save note', + notes_add_new: 'Add new note:', + notes_list_empty: 'Your notes list is empty.', + notes_click_to_export: 'Click to export your notes:', + notes_to_export: 'Notes to export:', + notes_import: 'Import new notes:', + notes_to_import: 'Notes to import:', + notes_import_go_back: 'Go back to notes list or choose other notes to import.', + notes_copy_success: 'Note content was copied to clipboard', + notes_copy_error: 'Could not copy to clipboard', + notes_open_error: 'Could not open note', + notes_added: 'New note added', + notes_added_error: 'Could not save note', + notes_updated: 'Note updated', + notes_updated_error: 'Could not update note', + notes_removed: 'Note was removed', + notes_removed_error: 'Could not remove note', + notes_remove_confirm: 'Do you want to remove note?', + }, + pl: { + register_user: 'Zarejestruj użytkownika', + log_in: 'Zaloguj się do My Apps', + password: 'hasło', + confirm_password: 'potwierdź hasło', + color_theme: 'Wybierz motyw:', + language: 'Język:', + login: 'Zaloguj', + login_error: 'Błąd podczas logowania', + logout: 'Wyloguj', + register: 'Zarejestruj', + register_error: 'Błąd podczas rejestracji', + edit: 'Edytuj', + remove: 'Usuń', + copy: 'Kopiuj', + save: 'Zapisz', + back: 'Powrót', + cancel: 'Anuluj', + select_all: 'Wybierz wszystkie', + import: 'Wyślij', + export: 'Pobierz', + choose_files: 'Wybierz pliki', + import_finished: 'Wysyłanie zakończone.', + no_connection: 'Brak połączenia', + loading: 'Ładowanie...', + sending: 'Wysyłanie...', + title: 'Tytuł', + created: 'Utworzono', + modified: 'Zmodyfikowano', + Notes: 'Notatki', + Settings: 'Ustawienia', + mail_ver_subject: 'Weryfikacja Twojego nowego konta w aplikacji My Apps.', + mail_ver_t1: 'Dziękujemy za założenie konta w My Apps', + mail_ver_t2: 'Przesyłamy Ci kod weryfikacyjny:', + mail_ver_t3: 'W celu zakończenia weryfikacji zaloguj się i podaj ten kod.', + verification_mail_error: 'Błąd podczas wysyłania maila z kodem weryfikacyjnym', + verification_error: 'Błąd podczas weryfikacji użytkownika', + verification_title: 'Pozostał ostatni krok!', + verification_text: 'Aby rozpocząć korzystanie z My Apps wpisz kod weryfikacyjny, który wysłaliśmy Ci mailem na adres', + verification_key: 'Kod weryfikacyjny', + verify: 'Weryfikuj', + verification_not_received: 'Jeżeli nie otrzymałeś maila z kodem weryfikacyjnym', + verification_send_again: 'wyślij go ponownie', + verification_sent_again: 'Mail został wysłany ponownie, sprawdź skrzynkę!', + settings_saved: 'Ustawienia zapisane', + settings_save_error: 'Błąd podczas zapisu ustawień', + passwords_not_match: 'Podane hasła nie są identyczne', + notes_new: 'Nowa notatka', + notes_edit: 'Edytuj notatkę:', + notes_add: 'Dodaj notatkę', + notes_save: 'Zapisz notatkę', + notes_add_new: 'Dodaj nową notatkę:', + notes_list_empty: 'Twoja lista notatek jest pusta.', + notes_click_to_export: 'Kliknij aby pobrać Twoje notatki:', + notes_to_export: 'Notatki, które zostaną pobrane:', + notes_import: 'Wyślij nowe notatki:', + notes_to_import: 'Notatki do wysłania:', + notes_import_go_back: 'Wróć do listy notatek lub wyślij więcej plików.', + notes_copy_success: 'Skopiowano notatkę do schowka', + notes_copy_error: 'Błąd podczas kopiowania notatki', + notes_open_error: 'Błąd podczas otwierania notatki', + notes_added: 'Dodano nową notatkę', + notes_added_error: 'Błąd podczas dodawania notatki', + notes_updated: 'Notatka zmieniona', + notes_updated_error: 'Błąd podczas zapisu zmian w notatce', + notes_removed: 'Usunięto notatkę', + notes_removed_error: 'Błąd podczas usuwania notatki', + notes_remove_confirm: 'Czy na pewno chcesz usunąć notatkę?', + }, + es: { + register_user: 'Registrar al usuario', + log_in: 'Iniciar sesión en Mis aplicaciones', + password: 'contraseña', + confirm_password: 'confirmar la contraseña', + color_theme: 'Elige un tema: ', + language: 'Lengua: ', + login: 'Acceso', + login_error: 'Error de inicio de sesión', + logout: 'Cerrar sesión', + register: 'Registrarse', + register_error: 'Error durante el registro', + edit: 'Editar', + remove: 'Borrar', + copy: 'Dupdo', + save: 'Ahorrar', + back: 'Regreso', + cancel: 'Cancelar', + select_all: 'Elegir todos', + import: 'Enviar', + export: 'Descargar', + choose_files: 'Seleccione archivos', + import_finished: 'Envío completo.', + no_connection: 'Sin conexión', + loading: 'Aterrizaje...', + sending: 'Enviando ...', + title: 'Título', + created: 'Creado', + modified: 'Modificado', + Notes: 'Notas', + Settings: 'Ajustes', + mail_ver_subject: 'Verificación de su nueva cuenta en la aplicación My Apps.', + mail_ver_t1: 'Gracias por crear una cuenta con Mis aplicaciones', + mail_ver_t2: 'Te enviamos un código de verificación: ', + mail_ver_t3: 'Para completar la verificación, inicie sesión e ingrese este código.', + verification_mail_error: 'Error al enviar el correo electrónico con el código de verificación', + verification_error: 'Error de verificación del usuario', + verification_title: '¡Queda un último paso!', + verification_text: 'Para comenzar a usar Mis aplicaciones, ingrese el código de verificación que le enviamos por correo electrónico a la dirección', + verification_key: 'Código de verificación', + verify: 'Verificar', + verification_not_received: 'Si no ha recibido el correo electrónico con el código de verificación', + verification_send_again: 'reenvialo', + verification_sent_again: 'El correo ha sido enviado de nuevo, por favor revise su bandeja de entrada.', + settings_saved: 'Se guardó la configuración', + settings_save_error: 'No se pudo guardar la configuración', + passwords_not_match: 'Las contraseñas proporcionadas no coinciden', + notes_new: 'Nueva nota', + notes_edit: 'Edita la nota: ', + notes_add: 'Agrega una nota', + notes_save: 'Guardar la nota', + notes_add_new: 'Agrega una nota nueva: ', + notes_list_empty: 'Tu lista de notas está vacía.', + notes_click_to_export: 'Haz clic para descargar tus notas: ', + notes_to_export: 'Notas que se descargarán: ', + notes_import: 'Enviar nuevas notas: ', + notes_to_import: 'Notas a enviar: ', + notes_import_go_back: 'Regrese a la lista de notas o envíe más archivos.', + notes_copy_success: 'La nota se copió en el portapapeles.', + notes_copy_error: 'Error al copiar la nota', + notes_open_error: 'Error al abrir la nota', + notes_added: 'Se ha agregado una nueva nota', + notes_added_error: 'Error al agregar la nota', + notes_updated: 'Nota modificada', + notes_updated_error: 'Error al guardar cambios en la nota', + notes_removed: 'Nota eliminada', + notes_removed_error: 'Error al eliminar la nota', + notes_remove_confirm: '¿Estás seguro de que deseas eliminar la nota?', + }, + de: { + register_user: 'Registrieren Sie den Benutzer', + log_in: 'Melden Sie sich bei Meine Apps an', + password: 'Passwort', + confirm_password: 'Bestätige das Passwort', + color_theme: 'Wähle ein Thema: ', + language: 'Zunge: ', + login: 'Anmeldung', + login_error: 'Login Fehler', + logout: 'Ausloggen', + register: 'Registrieren', + register_error: 'Fehler bei der Registrierung', + edit: 'Bearbeiten', + remove: 'Löschen', + copy: 'Kopieren', + save: 'Speichern', + back: 'Zurückkehren', + cancel: 'Abbrechen', + select_all: 'Alles auswählen', + import: 'Senden', + export: 'Herunterladen', + choose_files: 'Dateien auswählen', + import_finished: 'Senden abgeschlossen.', + no_connection: 'Keine Verbindung', + loading: 'Landung...', + sending: 'Senden ...', + title: 'Titel', + created: 'Erstellt', + modified: 'Geändert', + Notes: 'Anmerkungen', + Settings: 'Einstellungen', + mail_ver_subject: 'Bestätigen Ihres neuen Kontos in der Anwendung „Meine Apps“.', + mail_ver_t1: 'Vielen Dank, dass Sie ein Konto bei My Apps erstellt haben', + mail_ver_t2: 'Wir senden Ihnen einen Bestätigungscode: ', + mail_ver_t3: 'Um die Verifizierung abzuschließen, loggen Sie sich ein und geben Sie diesen Code ein.', + verification_mail_error: 'Fehler beim Senden der E-Mail mit dem Bestätigungscode', + verification_error: 'Fehler bei der Benutzerüberprüfung', + verification_title: 'Ein letzter Schritt bleibt!', + verification_text: 'Um mit der Nutzung von Meine Apps zu beginnen, geben Sie den Bestätigungscode ein, den wir Ihnen per E-Mail an die Adresse gesendet haben', + verification_key: 'Verifizierungs-Schlüssel', + verify: 'Verifizieren', + verification_not_received: 'Wenn Sie die E-Mail mit dem Bestätigungscode nicht erhalten haben', + verification_send_again: 'Sende es erneut', + verification_sent_again: 'E-Mail wurde erneut gesendet, bitte überprüfen Sie Ihren Posteingang!', + settings_saved: 'Einstellungen gespeichert', + settings_save_error: 'Einstellungen konnten nicht gespeichert werden', + passwords_not_match: 'Die angegebenen Passwörter stimmen nicht überein', + notes_new: 'Neue Notiz', + notes_edit: 'Bearbeiten Sie die Notiz: ', + notes_add: 'Füg ein Notiz hinzu', + notes_save: 'Notiz speichern', + notes_add_new: 'Fügen Sie eine neue Notiz hinzu: ', + notes_list_empty: 'Ihre Notizenliste ist leer.', + notes_click_to_export: 'Klicken Sie hier, um Ihre Notizen herunterzuladen: ', + notes_to_export: 'Notizen, die heruntergeladen werden: ', + notes_import: 'Neue Notizen senden: ', + notes_to_import: 'Zu sendende Hinweise: ', + notes_import_go_back: 'Kehren Sie zur Notizliste zurück oder senden Sie weitere Dateien.', + notes_copy_success: 'Die Notiz wurde in die Zwischenablage kopiert', + notes_copy_error: 'Fehler beim Kopieren der Notiz', + notes_open_error: 'Fehler beim Öffnen der Notiz', + notes_added: 'Eine neue Notiz wurde hinzugefügt', + notes_added_error: 'Fehler beim Hinzufügen einer Notiz', + notes_updated: 'Hinweis geändert', + notes_updated_error: 'Fehler beim Speichern der Änderungen an der Notiz', + notes_removed: 'Notiz gelöscht', + notes_removed_error: 'Fehler beim Löschen der Notiz', + notes_remove_confirm: 'Möchten Sie die Notiz wirklich löschen? ', + } +} + +export const t = (l, k) => translations[l][k] + ? translations[l][k] + : translations.en[k] + +export default translations |