From d8859001a7e0abc3465cf546d1662ce59d8d5cdf Mon Sep 17 00:00:00 2001 From: Ady Nemo Date: Tue, 9 Jun 2020 13:34:11 +0000 Subject: [PATCH 1/8] Translated using Weblate (French) Currently translated at 100.0% (246 of 246 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/ --- ui/translations/fr.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/translations/fr.json b/ui/translations/fr.json index 827142498..f7457b2e1 100644 --- a/ui/translations/fr.json +++ b/ui/translations/fr.json @@ -28,7 +28,7 @@ "community_reqs": "en minuscule, sans espace et avec tiret du bas.", "create_private_message": "Créer un message privé", "send_secure_message": "Envoyer le message sécurisé", - "send_message": "Enovyer le message", + "send_message": "Envoyer le message", "message": "Message", "edit": "éditer", "reply": "répondre", @@ -58,14 +58,14 @@ "remove_as_admin": "Supprimer comme admin", "appoint_as_admin": "Nommer comme admin", "remove": "retirer", - "removed": "retiré", + "removed": "retiré par le modérateur", "locked": "bloqué", "stickied": "épinglé", "reason": "Raison", "mark_as_read": "marquer comme lu", "mark_as_unread": "marquer comme non-lu", "delete": "supprimer", - "deleted": "supprimé", + "deleted": "supprimé par le créateur", "delete_account": "Supprimer le compte", "delete_account_confirm": "Avertissement : cette action supprimera toutes vos données de façons permanente ! Saisissez votre mot de passe pour confirmer.", "restore": "restaurer", @@ -171,7 +171,7 @@ "theme": "Thème", "sponsors": "Sponsors", "sponsors_of_lemmy": "Sponsors de Lemmy", - "sponsor_message": "Lemmy est un logiciel libre et <1>open-source, c’est à dire, il fonctionne sans publicité et sans monétisation aucune. Vos dons soutiennent directement le développement du projet à temps plein. Merci à toutes ces personnes :", + "sponsor_message": "Lemmy est un logiciel libre et <1>open-source, sans jamais aucune publicité, ni monétisation ou capital-risque. Vos dons soutiennent directement le développement du projet à temps plein. Merci à toutes ces personnes :", "support_on_patreon": "Soutenir sur Patreon", "support_on_liberapay": "Soutenir sur Liberapay", "donate_to_lemmy": "Faire un don à Lemmy", @@ -251,5 +251,7 @@ "number_of_downvotes_plural": "{{count}} votes contre", "downvote": "Voter contre", "emoji_picker": "Sélecteur d’émojis", - "silver_sponsors": "Les sponsors argent sont ceux et celles qui ont fait une donation de 40$ à Lemmy." + "silver_sponsors": "Les sponsors argent sont ceux et celles qui ont fait une donation de 40$ à Lemmy.", + "select_a_community": "Sélectionner une communauté", + "invalid_username": "Nom d'utilisateur invalide." } From 7bc601ad3bba8cb63331ae06a3101cf05cc24953 Mon Sep 17 00:00:00 2001 From: maxigaz Date: Tue, 9 Jun 2020 13:34:11 +0000 Subject: [PATCH 2/8] Translated using Weblate (Hungarian) Currently translated at 5.6% (14 of 246 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/ Translated using Weblate (Hungarian) Currently translated at 2.4% (6 of 246 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/ --- ui/translations/hu.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/translations/hu.json b/ui/translations/hu.json index 0967ef424..35f826750 100644 --- a/ui/translations/hu.json +++ b/ui/translations/hu.json @@ -1 +1,18 @@ -{} +{ + "post": "Elküld", + "remove_post": "Bejegyzés eltávolítása", + "no_posts": "Nincs bejegyzés.", + "create_post": "Új bejegyzés létrehozása", + "create_a_post": "Új bejegyzés létrehozása", + "number_of_posts": "{{count}} bejegyzés", + "number_of_posts_plural": "{{count}} bejegyzés", + "posts": "Bejegyzések", + "related_posts": "Ezek a bejegyzések kapcsolódhatnak", + "cross_posts": "Ez a hivatkozás itt is be lett küldve:", + "cross_post": "keresztbejegyzés", + "comments": "Hozzászólások", + "remove_comment": "Hozzászólások eltávolítása", + "cross_posted_to": "beküldve ide is: ", + "number_of_comments": "{{count}} hozzászólás", + "number_of_comments_plural": "{{count}} hozzászólás" +} From 2e4c7256476e4d5c79f43c9c86c6c8dc3c6965af Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 9 Jun 2020 22:41:04 -0400 Subject: [PATCH 3/8] Fixing toast background for all but i386. Fixes #794 --- ui/src/utils.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index cb56ba581..82900cab6 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -481,7 +481,7 @@ export function messageToastify( text: `${body}
${creator}`, avatar: avatar, backgroundColor: backgroundColor, - className: 'text-body', + className: 'text-dark', close: true, gravity: 'top', position: 'right', @@ -868,9 +868,7 @@ function canUseWebP() { if (!!(elem.getContext && elem.getContext('2d'))) { var testString = !(window.mozInnerScreenX == null) ? 'png' : 'webp'; // was able or not to get WebP representation - return ( - elem.toDataURL('image/webp').startsWith('data:image/' + testString) - ); + return elem.toDataURL('image/webp').startsWith('data:image/' + testString); } // very old browser like IE 8, canvas not supported From 46bb3064ed64bee31e8ae3a31a9380bf9fb17f14 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 9 Jun 2020 22:49:42 -0400 Subject: [PATCH 4/8] Version v0.6.72 --- ansible/VERSION | 2 +- docker/prod/docker-compose.yml | 2 +- server/src/version.rs | 2 +- ui/src/version.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/VERSION b/ansible/VERSION index e31dcbc42..7fc60200e 100644 --- a/ansible/VERSION +++ b/ansible/VERSION @@ -1 +1 @@ -v0.6.71 +v0.6.72 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index db6e40045..8d7735697 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -12,7 +12,7 @@ services: restart: always lemmy: - image: dessalines/lemmy:v0.6.71 + image: dessalines/lemmy:v0.6.72 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/server/src/version.rs b/server/src/version.rs index 354b86b40..23f0242b1 100644 --- a/server/src/version.rs +++ b/server/src/version.rs @@ -1 +1 @@ -pub const VERSION: &str = "v0.6.71"; +pub const VERSION: &str = "v0.6.72"; diff --git a/ui/src/version.ts b/ui/src/version.ts index 9abc8bceb..d4c3c0452 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.6.71'; +export const version: string = 'v0.6.72'; From 13771d56cd948addc93569dcf7a67d7641bbd747 Mon Sep 17 00:00:00 2001 From: Lorenz Schmidt Date: Wed, 10 Jun 2020 17:11:51 +0200 Subject: [PATCH 5/8] Add default themes with media queries (#796) * Indicate unstable API in README and mdbook * Support user preference for light and dark theme * Add default themes and load them in `setTheme` * Fixes #758 --- ui/src/components/user.tsx | 2 +- ui/src/index.html | 3 ++- ui/src/services/UserService.ts | 4 +--- ui/src/utils.ts | 19 ++++++++++++++----- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index eded9998c..7cd460a17 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -922,7 +922,7 @@ export class User extends Component { handleUserSettingsThemeChange(i: User, event: any) { i.state.userSettingsForm.theme = event.target.value; - setTheme(event.target.value); + setTheme(event.target.value, true); i.setState(i.state); } diff --git a/ui/src/index.html b/ui/src/index.html index f39773d02..7cea8c4e8 100644 --- a/ui/src/index.html +++ b/ui/src/index.html @@ -15,7 +15,8 @@ - + + diff --git a/ui/src/services/UserService.ts b/ui/src/services/UserService.ts index 47e28c73e..786d5d07e 100644 --- a/ui/src/services/UserService.ts +++ b/ui/src/services/UserService.ts @@ -41,9 +41,7 @@ export class UserService { private setUser(jwt: string) { this.user = jwt_decode(jwt); - if (this.user.theme != 'darkly') { - setTheme(this.user.theme); - } + setTheme(this.user.theme, true); this.sub.next({ user: this.user }); console.log(this.user); } diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 81bb01475..93b9cab08 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -404,7 +404,7 @@ export function getMomentLanguage(): string { return lang; } -export function setTheme(theme: string = 'darkly') { +export function setTheme(theme: string = 'darkly', loggedIn: boolean = false) { // unload all the other themes for (var i = 0; i < themes.length; i++) { let styleSheet = document.getElementById(themes[i]); @@ -413,10 +413,19 @@ export function setTheme(theme: string = 'darkly') { } } - // Load the theme dynamically - let cssLoc = `/static/assets/css/themes/${theme}.min.css`; - loadCss(theme, cssLoc); - document.getElementById(theme).removeAttribute('disabled'); + // if the user is not logged in, we load the default themes and let the browser decide + if(!loggedIn) { + document.getElementById("default-light").removeAttribute('disabled') + document.getElementById("default-dark").removeAttribute('disabled') + } else { + document.getElementById("default-light").setAttribute('disabled', 'disabled'); + document.getElementById("default-dark").setAttribute('disabled', 'disabled'); + + // Load the theme dynamically + let cssLoc = `/static/assets/css/themes/${theme}.min.css`; + loadCss(theme, cssLoc); + document.getElementById(theme).removeAttribute('disabled'); + } } export function loadCss(id: string, loc: string) { From 36e8ce624c86546af9e833a96d9ff645d2450617 Mon Sep 17 00:00:00 2001 From: kartikynwa Date: Wed, 10 Jun 2020 20:42:53 +0530 Subject: [PATCH 6/8] Change "Forgot Password" button's type to "button" (#797) --- ui/src/components/login.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx index 84014f68c..ce04d0d4f 100644 --- a/ui/src/components/login.tsx +++ b/ui/src/components/login.tsx @@ -111,6 +111,7 @@ export class Login extends Component { required />