From 7f57ec7ca730a5ad523177a4b0d8f009aadcbc76 Mon Sep 17 00:00:00 2001 From: Rynach Date: Sun, 26 Jan 2020 16:27:45 +0200 Subject: [PATCH 01/31] Create fi.ts Create the Finnish translation of Lemmy. --- ui/src/translations/fi.ts | 233 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 ui/src/translations/fi.ts diff --git a/ui/src/translations/fi.ts b/ui/src/translations/fi.ts new file mode 100644 index 00000000..2bc1f6a0 --- /dev/null +++ b/ui/src/translations/fi.ts @@ -0,0 +1,233 @@ +export const fi = { + translation: { + post: 'viesti', + remove_post: 'Poista viesti', + no_posts: 'Ei viestjä.', + create_a_post: 'Luo viesti', + create_post: 'Luo viestit', + number_of_posts: '{{count}} viestiä', + posts: 'Viestit', + related_posts: 'Nämä viestit voivat liittyä toisiinsa', + cross_posts: 'Tämä linkki on jaettu:', + cross_post: 'jaa ristiin', + comments: 'Kommentit', + number_of_comments: '{{count}} kommenttia', + remove_comment: 'Poista kommentti', + communities: 'Yhteisöt', + users: 'Käyttäjät', + create_a_community: 'Luo yhteisö', + create_community: 'Luo yhteisö', + remove_community: 'Poista yhteisö', + subscribed_to_communities: 'Tilannut seuraavat <1>yhteisöt', + trending_communities: 'Nousevat <1>yhteisöt', + list_of_communities: 'Lista yhteisöistä', + number_of_communities: '{{count}} yhteisöä', + community_reqs: 'pienillä kirjaimilla, alleviivauksella, eikä välilyöntejä.', + create_private_message: 'Luo yksityisviesti', + send_secure_message: 'Lähetä suojattu viesti', + send_message: 'Lähetä viesti', + message: 'Viesti', + edit: 'muokkaa', + reply: 'vastaa', + cancel: 'Peru', + preview: 'Esikatselu', + upload_image: 'lataa kuva', + avatar: 'avatar', + upload_avatar: 'Lähetä avatar', + show_avatars: 'Näytä avatarit', + formatting_help: 'apua muotoiluun', + view_source: 'näytä lähde', + unlock: 'avaa', + lock: 'lukitse', + sticky: 'kiinnitä', + unsticky: 'poista kiinnitys', + link: 'linkitä', + archive_link: 'arkistoi linkki', + mod: 'moderaattori', + mods: 'moderaattorit', + moderates: 'Moderoi', + settings: 'Asetukset', + remove_as_mod: 'Poista moderaattorin asemassa', + appoint_as_mod: 'Nimitä moderaattoriksi', + modlog: 'Moderoinnin loki', + admin: 'Ylläpitäjä', + admins: 'ylläpitäjät', + remove_as_admin: 'poista adminin asemassa', + appoint_as_admin: 'nimitä adminiksi', + remove: 'poista', + removed: 'poistettu', + locked: 'lukittu', + stickied: 'kiinnitetty', + reason: 'Syy', + mark_as_read: 'merkitse luetuksi', + mark_as_unread: 'merkitse lukemattomaksi', + delete: 'poista', + deleted: 'deleted', + delete_account: 'Poista tili', + delete_account_confirm: + 'Varoitus: tämä poistaa pysyvästi kaiken datasi. Anna salasanasi varmistukseksi.', + restore: 'palauta', + ban: 'porttikielto', + ban_from_site: 'aseta porttikielto sivulle', + unban: 'poista porttikielto', + unban_from_site: 'poista porttikielto sivulta', + banned: 'asetettu porttikieltoon', + save: 'tallenna', + unsave: 'jätä tallentamatta', + create: 'luo', + creator: 'luoja', + username: 'Käyttäjänimi', + email_or_username: 'Sähköposti tai käyttäjätunnus', + number_of_users: '{{count}} käyttäjää', + number_of_subscribers: '{{count}} tilaajaaa', + number_of_points: '{{count}} pistettä', + number_online: '{{count}} käyttäjää kirjautuneena', + name: 'Nimi', + title: 'Titteli', + category: 'Luokka', + subscribers: 'Tilaajat', + both: 'Molemmat', + saved: 'Tallennettu', + unsubscribe: 'Poista tilaus', + subscribe: 'Tilaa', + subscribed: 'Tilattu', + prev: 'Edellinen', + next: 'Seuraava', + sidebar: 'Sivupalkki', + sort_type: 'Lajittele tyypin mukaan', + hot: 'Kuumat', + new: 'Uudet', + top_day: 'Päivän parhaimmat', + week: 'Viikko', + month: 'Kuukausi', + year: 'Vuosi', + all: 'Kaikki', + top: 'Parhaimmat', + api: 'API', + docs: 'Dokumentaatio', + inbox: 'Postilaatikko', + inbox_for: 'Postilaatikko käyttäjällä <1>{{user}}', + mark_all_as_read: 'aseta kaikki luetuiksi', + type: 'Tyyppi', + unread: 'Lukematon', + replies: 'Vastaukset', + mentions: 'Maininnat', + reply_sent: 'Vastaus lähetetty', + message_sent: 'Viesti lähetetty', + search: 'Etsi', + overview: 'Yleiskatsaus', + view: 'Katso', + logout: 'Kirjaudu ulos', + login_sign_up: 'Kirjaudu sisään / Rekisteröidy', + login: 'Kirjaudu sisään', + sign_up: 'Rekisteröidy', + notifications_error: + 'Työpöydän ilmoitukset eivät ole saatavilla selaimellesi. Yritä Firefoxia tai Chromea.', + unread_messages: 'Lukemattomat viestit', + messages: 'Viestit', + password: 'Salasana', + verify_password: 'Vahvista salasana', + old_password: 'Vanha salasana', + forgot_password: 'unohdin salasanani', + reset_password_mail_sent: 'Sähköposti lähetettiin salasanan nollaamiseksi.', + password_change: 'Salasanan muutos', + new_password: 'Uusi salasana', + no_email_setup: "Tämä palvelin ei ole asettanut sähköpostia oikein.", + email: 'Sähköposti', + matrix_user_id: ' Matrix-käyttäjä', + private_message_disclaimer: + 'Varoitus: Yksityisviestit Lemmyssä eivät ole turvallisia. Luo tili <1>Riot.im-palveluun turvallista viestintää varten.', + send_notifications_to_email: 'Lähetä ilmoitukset sähköpostiin', + optional: 'Valinnainen', + expires: 'Umpeutuu', + language: 'Kieli', + browser_default: 'Selaimen oletus', + downvotes_disabled: 'Alaäänet otettu pois päältä', + enable_downvotes: 'Salli alaäänet', + open_registration: 'Avaa rekisteröityminen', + registration_closed: 'Rekisteröityminen suljettu', + enable_nsfw: 'Salli NSFW', + url: 'URL', + body: 'Body', + copy_suggested_title: 'kopioi ehdotettu otsikko: {{title}}', + community: 'Yhteisö', + expand_here: 'Laajenna tässä', + subscribe_to_communities: 'Tilaa joitakin <1>communities.', + chat: 'Chat', + recent_comments: 'Viimeaikaiset kommentit', + no_results: 'Ei tuloksia.', + setup: 'Asetus', + lemmy_instance_setup: 'Lemmy-instanssin asetus', + setup_admin: 'Aseta sivuston ylläpitäjä', + your_site: 'sivustosi', + modified: 'muokattu', + nsfw: 'NSFW', + show_nsfw: 'Näytä NSFW-sisältö', + theme: 'Teema', + sponsors: 'Sponsorit', + sponsors_of_lemmy: 'Lemmy-sponsorit', + sponsor_message: + 'Lemmy on vapaa, <1>avoimen lähdekoodin -ohjelmisto, eli mainontaa, rahantekemistä, tai pääomasijoitusta täällä ei tule ikinä olemaan. Lahjoituksesi tukevat suoraaan projektin täysipäiväistä kehitystä. Kiitokset seuraaville ihmisille:', + support_on_patreon: 'Tue Patreonissa', + donate_to_lemmy: 'Lahjoita Lemmylle', + donate: 'Lahjoita', + general_sponsors: + 'Yleisiä sponsoreja ovat he, jotka lupaavat 10-39 dollaria Lemmylle.', + crypto: 'Crypto', + bitcoin: 'Bitcoin', + ethereum: 'Ethereum', + monero: 'Monero', + code: 'Code', + joined: 'Liittyi', + by: 'lahjoittajalta', + to: 'kohteelle', + from: 'paikasta', + transfer_community: 'siirron yhteisö', + transfer_site: 'siirron määrä', + are_you_sure: 'oletko varma?', + yes: 'kyllä', + no: 'ei', + powered_by: 'Vauhdittajana', + landing_0: + "Lemmy on <1>linkinkerääjä / Reddit-vaihtoehto, tarkoitettu toimimaan <2>fediversessä.<3>Sitä voi isännöidä itse, siinä on automaattisesti päivittyvät kommenttiketjut, ja se on pieni (<4>~80kB). Federointi ActivityPub-verkkoon on suunnittelun alla. <5>Tämä on <6>hyvin varhainen betaversio, ja monet ominaisuudet ovat toistaiseksi rikki tai poissa. <7>Ehdota uusia ominaisuuksia tai raportoi bugeja <8>tänne.<9>Tehty teknologioilla <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.", + not_logged_in: 'Ei kirjautunut sisään.', + logged_in: 'Kirjautunut sisään.', + community_ban: 'Sinulle on asetettu porttikielto tähän yhteisöön.', + site_ban: 'Sinut on asetettu porttikieltoon tältä sivustolta', + couldnt_create_comment: "Kommenttia ei pystytty luomaan.", + couldnt_like_comment: "Kommentista ei voitu tykätä.", + couldnt_update_comment: "Kommenttia ei voitu päivittää.", + couldnt_save_comment: "Kommenttia ei voitu tallentaa.", + no_comment_edit_allowed: 'Et ole sallittu muokkaamaan kommenttia.', + no_post_edit_allowed: 'Et ole sallittu muokkaamaan viestiä.', + no_community_edit_allowed: 'Et ole sallittu muokkaamaan yhteisöä.', + couldnt_find_community: "Yhteisöä ei voitu löytää.", + couldnt_update_community: "Yhteisöä ei voitu päivittää.", + community_already_exists: 'Yhteisö on jo olemassa.', + community_moderator_already_exists: 'Yhteisön moderaattori on jo olemassa.', + community_follower_already_exists: 'Yhteisön seuraaja on jo olemassa.', + community_user_already_banned: 'Yhteisön käyttäjä on jo porttikiellossa.', + couldnt_create_post: "Ei voitu luoda viestiä.", + couldnt_like_post: "Viestistä ei voitu tykätä.", + couldnt_find_post: "Viestiä ei löytynyt.", + couldnt_get_posts: "Viestejä ei saatu", + couldnt_update_post: "Viestiä ei voitu päivittää", + couldnt_save_post: "Viestiä ei voitu tallentaa.", + no_slurs: 'Ei herjoja.', + not_an_admin: 'Ei ole ylläpitäjä.', + site_already_exists: 'Sivusto on jo olemassa.', + couldnt_update_site: "Sivustoa ei voitu päivittää.", + couldnt_find_that_username_or_email: + "Käyttäjänimeä tai sähköpostia ei onnistuttu löytämään.", + password_incorrect: 'Salasana on väärin.', + passwords_dont_match: 'Salasanat eivät täsmää.', + admin_already_created: "Anteeksi, mutta täällä on jo ylläpitäjä.", + user_already_exists: 'Käyttäjä on jo olemassa.', + email_already_exists: 'Sähköposti on jo olemassa.', + couldnt_update_user: "Käyttäjää ei voitu päivittää.", + system_err_login: 'Järjestelmävirhe. Yritä kirjautua ulos ja takaisin sisään.', + couldnt_create_private_message: "Yksityisviestiä ei voitu luoda.", + no_private_message_edit_allowed: 'Et ole sallittu muokkaamaan yksityisviestiä.', + couldnt_update_private_message: "Yksityisviestiä ei voitu päivittää.", + }, +}; From 75554df998aeb15482ba8472a9283d1d8531047d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 26 Jan 2020 12:35:47 -0500 Subject: [PATCH 02/31] Adding finnish to moment, dropdown. --- README.md | 2 +- ui/src/i18next.ts | 2 ++ ui/src/utils.ts | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a2a6ef0..b35c5b8c 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ Lemmy is free, open-source software, meaning no advertising, monetizing, or vent If you'd like to add translations, take a look a look at the [English translation file](ui/src/translations/en.ts). -- Languages supported: English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). +- Languages supported: English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index aaaecd04..2da3dfbe 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -10,6 +10,7 @@ import { ru } from './translations/ru'; import { zh } from './translations/zh'; import { nl } from './translations/nl'; import { it } from './translations/it'; +import { fi } from './translations/fi'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -23,6 +24,7 @@ const resources = { ru, nl, it, + fi, }; function format(value: any, format: any, lng: any) { diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 7803ee4e..6c22e25b 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -7,6 +7,7 @@ import 'moment/locale/sv'; import 'moment/locale/ru'; import 'moment/locale/nl'; import 'moment/locale/it'; +import 'moment/locale/fi'; import { UserOperation, @@ -256,6 +257,7 @@ export const languages = [ { code: 'es', name: 'Español' }, { code: 'de', name: 'Deutsch' }, { code: 'zh', name: '中文' }, + { code: 'fi', name: 'Suomi' }, { code: 'fr', name: 'Français' }, { code: 'sv', name: 'Svenska' }, { code: 'ru', name: 'Русский' }, @@ -298,6 +300,8 @@ export function getMomentLanguage(): string { lang = 'nl'; } else if (lang.startsWith('it')) { lang = 'it'; + } else if (lang.startsWith('fi')) { + lang = 'fi'; } else { lang = 'en'; } From 8f9db655ec9f190742bf86afa443e8ffbbd05fe0 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 26 Jan 2020 12:37:07 -0500 Subject: [PATCH 03/31] Adding finnish to translation report. --- README.md | 1 + ui/translation_report.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index b35c5b8c..9728e0a0 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ lang | done | missing de | 88% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message eo | 76% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message es | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +fi | 100% | fr | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message it | 84% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message nl | 93% | create_private_message,send_secure_message,send_message,message,message_sent,messages,matrix_user_id,private_message_disclaimer,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message diff --git a/ui/translation_report.ts b/ui/translation_report.ts index 71a09559..19718c7d 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -8,6 +8,7 @@ import { sv } from './src/translations/sv'; import { ru } from './src/translations/ru'; import { nl } from './src/translations/nl'; import { it } from './src/translations/it'; +import { fi } from './src/translations/fi'; import fs from 'fs'; let readmePath = '../README.md'; @@ -31,6 +32,7 @@ function buildReport(): string { { t: de, n: 'de' }, { t: eo, n: 'eo' }, { t: es, n: 'es' }, + { t: fi, n: 'fi' }, { t: fr, n: 'fr' }, { t: it, n: 'it' }, { t: nl, n: 'nl' }, From 8ff637a57e1e6544e6df62b9dcc4d10530d3c1f6 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 26 Jan 2020 19:53:57 +0100 Subject: [PATCH 04/31] TS func refactoring --- ui/src/env.ts | 11 +++++----- ui/src/i18next.ts | 9 ++------- ui/src/version.ts | 2 +- ui/translation_report.ts | 43 +++++++++++++++++++--------------------- 4 files changed, 28 insertions(+), 37 deletions(-) diff --git a/ui/src/env.ts b/ui/src/env.ts index 82377415..af9aad5d 100644 --- a/ui/src/env.ts +++ b/ui/src/env.ts @@ -1,6 +1,5 @@ -let host = `${window.location.hostname}`; -let port = `${window.location.port == '4444' ? '8536' : window.location.port}`; -let endpoint = `${host}:${port}`; -export let wsUri = `${ - window.location.protocol == 'https:' ? 'wss://' : 'ws://' -}${endpoint}/api/v1/ws`; +const host = `${window.location.hostname}`; +const port = `${window.location.port == '4444' ? '8536' : window.location.port}`; +const endpoint = `${host}:${port}`; + +export const wsUri = `${window.location.protocol == 'https:' ? 'wss://' : 'ws://'}${endpoint}/api/v1/ws`; diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index 2da3dfbe..a1fda907 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -27,10 +27,7 @@ const resources = { fi, }; -function format(value: any, format: any, lng: any) { - if (format === 'uppercase') return value.toUpperCase(); - return value; -} +const format = (value, format, lng) => format === 'uppercase' ? value.toUpperCase() : value; i18next.init({ debug: false, @@ -40,9 +37,7 @@ i18next.init({ lng: getLanguage(), fallbackLng: 'en', resources, - interpolation: { - format: format, - }, + interpolation: { format }, }); export { i18next as i18n, resources }; diff --git a/ui/src/version.ts b/ui/src/version.ts index 81ff581b..2e0add0f 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export let version: string = 'v0.6.5'; +export const version: string = 'v0.6.5'; diff --git a/ui/translation_report.ts b/ui/translation_report.ts index 19718c7d..fae0359f 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -11,24 +11,26 @@ import { it } from './src/translations/it'; import { fi } from './src/translations/fi'; import fs from 'fs'; -let readmePath = '../README.md'; +const readmePath = '../README.md'; -let open = ''; -let close = ''; +const open = ''; +const close = ''; -let readmeTxt = fs.readFileSync(readmePath, { encoding: 'utf8' }); +const readmeTxt = fs.readFileSync(readmePath, { encoding: 'utf8' }); -let before = readmeTxt.split(open)[0]; -let after = readmeTxt.split(close)[1]; +const before = readmeTxt.split(open)[0]; +const after = readmeTxt.split(close)[1]; -let report = buildReport(); +const report = buildReport(); -let alteredReadmeTxt = `${before}${open}\n\n${report}\n${close}${after}`; +const alteredReadmeTxt = `${before}${open}\n\n${report}\n${close}${after}`; fs.writeFileSync(readmePath, alteredReadmeTxt); +const difference = (a: Array, b: Array): Array => a.filter(x => !b.includes(x)); + function buildReport(): string { - let files = [ + const files = [ { t: de, n: 'de' }, { t: eo, n: 'eo' }, { t: es, n: 'es' }, @@ -40,21 +42,16 @@ function buildReport(): string { { t: sv, n: 'sv' }, { t: zh, n: 'zh' }, ]; - let masterKeys = Object.keys(en.translation); + const masterKeys = Object.keys(en.translation); - let report = 'lang | done | missing\n'; - report += '--- | --- | ---\n'; - - for (let file of files) { - let keys = Object.keys(file.t.translation); - let pct: number = (keys.length / masterKeys.length) * 100; - let missing = difference(masterKeys, keys); - report += `${file.n} | ${pct.toFixed(0)}% | ${missing} \n`; - } + const report = 'lang | done | missing\n' + + '--- | --- | ---\n' + + files.map(file => { + const keys = Object.keys(file.t.translation); + const pct: number = (keys.length / masterKeys.length) * 100; + const missing = difference(masterKeys, keys); + return `${file.n} | ${pct.toFixed(0)}% | ${missing}`; + }).join("\n"); return report; } - -function difference(a: Array, b: Array): Array { - return a.filter(x => !b.includes(x)); -} From f3ece78f83fcf90f9854adf72f48f117dd1b2e24 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 26 Jan 2020 20:31:34 +0100 Subject: [PATCH 05/31] ES translation completed & some fixes --- README.md | 23 ++++++----- ui/src/i18next.ts | 2 +- ui/src/translations/es.ts | 82 +++++++++++++++++++++++++++------------ ui/translation_report.ts | 55 ++++++++++++-------------- 4 files changed, 95 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 9728e0a0..af5d433e 100644 --- a/README.md +++ b/README.md @@ -166,18 +166,17 @@ If you'd like to add translations, take a look a look at the [English translatio lang | done | missing ---- | --- | --- -de | 88% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -eo | 76% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -es | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -fi | 100% | -fr | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -it | 84% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -nl | 93% | create_private_message,send_secure_message,send_message,message,message_sent,messages,matrix_user_id,private_message_disclaimer,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message - +---- | ---- | ------- +de | 88% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +eo | 76% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +es | 100% | +fi | 100% | +fr | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +it | 84% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +nl | 93% | create_private_message,send_secure_message,send_message,message,message_sent,messages,matrix_user_id,private_message_disclaimer,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message If you'd like to update this report, run: diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index a1fda907..065d63c8 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -27,7 +27,7 @@ const resources = { fi, }; -const format = (value, format, lng) => format === 'uppercase' ? value.toUpperCase() : value; +const format = (value: any, format: any, lng: any) => format === 'uppercase' ? value.toUpperCase() : value; i18next.init({ debug: false, diff --git a/ui/src/translations/es.ts b/ui/src/translations/es.ts index 6e1faefe..e8bdc3d0 100644 --- a/ui/src/translations/es.ts +++ b/ui/src/translations/es.ts @@ -1,7 +1,7 @@ export const es = { translation: { post: 'Publicar', - remove_post: 'Remover publicación', + remove_post: 'Eliminar publicación', no_posts: 'Sin publicaciones.', create_a_post: 'Crear una publicación', create_post: 'Crear Publicación', @@ -12,22 +12,29 @@ export const es = { cross_post: 'cross-post', comments: 'Comentarios', number_of_comments: '{{count}} Comentarios', - remove_comment: 'Remover Comentarios', + remove_comment: 'Eliminar Comentarios', communities: 'Comunidades', users: 'Usuarios', create_a_community: 'Crear una comunidad', create_community: 'Crear Comunidad', - remove_community: 'Remover Comunidad', + remove_community: 'Eliminar Comunidad', subscribed_to_communities: 'Suscrito a <1>comunidades', trending_communities: '<1>Comunidades en tendencia', list_of_communities: 'Lista de comunidades', number_of_communities: '{{count}} Comunidades', community_reqs: 'minúsculas, guión bajo, y sin espacios.', + create_private_message: 'Crear Mensaje Privado', + send_secure_message: 'Enviar Mensaje Seguro', + send_message: 'Enviar Mensaje', + message: 'Mensaje', edit: 'editar', reply: 'responder', cancel: 'Cancelar', preview: 'Previsualizar', - upload_image: 'Subir imagen', + upload_image: 'subir imagen', + avatar: 'Avatar', + upload_avatar: 'Subir Avatar', + show_avatars: 'Ver Avatares', formatting_help: 'Ayuda de formato', view_source: 'ver fuente', unlock: 'desbloquear', @@ -35,18 +42,19 @@ export const es = { sticky: 'fijado', unsticky: 'no fijado', link: 'link', - mod: 'Moderador', - mods: 'Moderadores', + archive_link: 'archivar link', + mod: 'moderador', + mods: 'moderadores', moderates: 'Modera', settings: 'Configuración', - remove_as_mod: 'remover como moderador', + remove_as_mod: 'eliminar como moderador', appoint_as_mod: 'designar como moderador', modlog: 'Historial de moderación', admin: 'administrador', admins: 'administradores', - remove_as_admin: 'remover como administrador', + remove_as_admin: 'eliminar como administrador', appoint_as_admin: 'designar como administrador', - remove: 'remover', + remove: 'eliminar', removed: 'removido', locked: 'bloqueado', stickied: 'fijado', @@ -57,19 +65,19 @@ export const es = { deleted: 'eliminado', delete_account: 'Eliminar Cuenta', delete_account_confirm: - 'Peligro: esta acción eliminará permanentemente tu información. ¿Estás seguro?', + 'Aviso: esta acción eliminará permanentemente tu información. Introduce tu contraseña para continuar', restore: 'restaurar', ban: 'expulsar', ban_from_site: 'expulsar del sitio', unban: 'admitir', - unban_from_site: 'admitir al sitio', + unban_from_site: 'admitir en el sitio', banned: 'expulsado', save: 'guardar', unsave: 'descartar', create: 'crear', creator: 'creador', username: 'Nombre de Usuario', - email_or_username: 'Correo electrónico o Nombre de Usuario', + email_or_username: 'Correo o Usuario', number_of_users: '{{count}} Usuarios', number_of_subscribers: '{{count}} Suscriptores', number_of_points: '{{count}} Puntos', @@ -80,8 +88,8 @@ export const es = { subscribers: 'Suscriptores', both: 'Ambos', saved: 'Guardado', - unsubscribe: 'Abandonar comunidad', - subscribe: 'Suscribir', + unsubscribe: 'Desuscribirse', + subscribe: 'Suscribirse', subscribed: 'Suscrito', prev: 'Anterior', next: 'Siguiente', @@ -96,12 +104,16 @@ export const es = { all: 'Todo', top: 'Mejor', api: 'API', + docs: 'Docs', inbox: 'Buzón de entrada', inbox_for: 'Buzón de entrada para <1>{{user}}', mark_all_as_read: 'marcar todo como leído', type: 'Tipo', unread: 'No leído', + replies: 'Respuestas', + mentions: 'Menciones', reply_sent: 'Respuesta enviada', + message_sent: 'Mensaje enviado', search: 'Buscar', overview: 'Resumen', view: 'Vista', @@ -112,11 +124,29 @@ export const es = { notifications_error: 'Notificaciones de escritorio no disponibles en tu navegador. Prueba Firefox o Chrome.', unread_messages: 'Mensajes no leídos', + messages: 'Mensajes', password: 'Contraseña', verify_password: 'Verificar contraseña', + old_password: 'Antigua Password', + forgot_password: 'olvidé mi password', + reset_password_mail_sent: 'Enviar correo para reestablecer la contraseña.', + password_change: 'Cambio de Contraseña', + new_password: 'Nueva Contraseña', + no_email_setup: "Este servidor no ha activado correctamente el correo.", email: 'Correo electrónico', + matrix_user_id: 'Usuario Matricial', + private_message_disclaimer: + 'Aviso: Los mensajes privados en Lemmy no son seguros. Por favor cree una cuenta en <1>Riot.im para mensajeria segura.', + send_notifications_to_email: 'Enviar notificaciones al correo', optional: 'Opcional', expires: 'Expira', + language: 'Idioma', + browser_default: 'Por defecto del navegador', + downvotes_disabled: 'Votos negativos deshabilitados', + enable_downvotes: 'Habilitar votos negativos', + open_registration: 'Abrir registro', + registration_closed: 'Registro cerrado', + enable_nsfw: 'Habilitar NSFW', url: 'URL', body: 'Descripción', copy_suggested_title: 'Copiar el título sugerido: {{title}}', @@ -139,8 +169,10 @@ export const es = { sponsor_message: 'Lemmy es software libre y de <1>código abierto, lo que significa que no tendrá publicidades, monetización, ni capitales emprendedores, nunca. Tus donaciones apoyan directamente el desarrollo a tiempo completo del proyecto. Muchas gracias a las siguientes personas:', support_on_patreon: 'Apoyo en Patreon', + donate_to_lemmy: 'Donar a Lemmy', + donate: 'Donar', general_sponsors: - 'Patrocinadores Generales son aquellos que señaron entre $10 y $39 a Lemmy.', + 'Los Patrocinadores Generales son aquellos que señaron entre $10 y $39 a Lemmy.', crypto: 'Crypto', bitcoin: 'Bitcoin', ethereum: 'Ethereum', @@ -148,7 +180,8 @@ export const es = { code: 'Código', joined: 'Se unió', by: 'por', - to: 'en', + to: 'a', + from: 'desde', transfer_community: 'transferir comunidad', transfer_site: 'transferir sitio', are_you_sure: '¿Estás seguro?', @@ -158,6 +191,7 @@ export const es = { landing_0: 'Lemmy es un <1>agregador de links / alternativa a reddit, con la intención de funcionar en el <2>fediverso.<3>Es alojable por uno mismo (sin necesidad de grandes compañías), tiene actualización en vivo de cadenas de comentarios, y es pequeño (<4>~80kB). Federar con el sistema de redes ActivityPub forma parte de los objetivos del proyecto. <5>Esta es una <6>version beta muy prematura, y actualmente muchas de las características están rotas o faltan. <7>Sugiere nuevas características o reporta errores <8>aquí.<9>Hecho con <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', not_logged_in: 'No has iniciado sesión.', + logged_in: 'Has iniciado sesión.', community_ban: 'Has sido expulsado de esta comunidad.', site_ban: 'Has sido expulsado del sitio', couldnt_create_comment: 'No se pudo crear el comentario.', @@ -170,12 +204,9 @@ export const es = { couldnt_find_community: 'No se pudo encontrar la comunidad.', couldnt_update_community: 'No se pudo actualizar la comunidad.', community_already_exists: 'Esta comunidad ya existe.', - community_moderator_already_exists: - 'Este moderador de la comunidad ya existe.', - community_follower_already_exists: - 'Este seguidor de la comunidad ya existe.', - community_user_already_banned: - 'Este usuario de la comunidad ya fue expulsado.', + community_moderator_already_exists: 'Este moderador de la comunidad ya existe.', + community_follower_already_exists: 'Este seguidor de la comunidad ya existe.', + community_user_already_banned: 'Este usuario de la comunidad ya fue expulsado.', couldnt_create_post: 'No se pudo crear la publicación.', couldnt_like_post: 'No se pudo gustar la publicación.', couldnt_find_post: 'No se pudo encontrar la publicación.', @@ -192,8 +223,11 @@ export const es = { passwords_dont_match: 'Las contraseñas no coinciden.', admin_already_created: 'Lo sentimos, ya hay un adminisitrador.', user_already_exists: 'El usuario ya existe.', + email_already_exists: 'El correo ya está en uso.', couldnt_update_user: 'No se pudo actualizar el usuario.', - system_err_login: - 'Error del sistema. Intente cerrar sesión e ingresar de nuevo.', + system_err_login: 'Error del sistema. Intente cerrar sesión e ingresar de nuevo.', + couldnt_create_private_message: "No se pudo crear el mensaje privado.", + no_private_message_edit_allowed: 'Sin permisos para editar el mensaje privado.', + couldnt_update_private_message: "No se pudo actualizar el mensaje privado.", }, }; diff --git a/ui/translation_report.ts b/ui/translation_report.ts index fae0359f..73e03dbb 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -11,6 +11,20 @@ import { it } from './src/translations/it'; import { fi } from './src/translations/fi'; import fs from 'fs'; +const files = [ + { t: de, n: 'de' }, + { t: eo, n: 'eo' }, + { t: es, n: 'es' }, + { t: fi, n: 'fi' }, + { t: fr, n: 'fr' }, + { t: it, n: 'it' }, + { t: nl, n: 'nl' }, + { t: ru, n: 'ru' }, + { t: sv, n: 'sv' }, + { t: zh, n: 'zh' }, +]; +const masterKeys = Object.keys(en.translation); + const readmePath = '../README.md'; const open = ''; @@ -21,37 +35,18 @@ const readmeTxt = fs.readFileSync(readmePath, { encoding: 'utf8' }); const before = readmeTxt.split(open)[0]; const after = readmeTxt.split(close)[1]; -const report = buildReport(); +const difference = (a: Array, b: Array): Array => a.filter(x => !b.includes(x)); + +const report = + 'lang | done | missing\n' + + '---- | ---- | -------\n' + + files.map(file => { + const keys = Object.keys(file.t.translation); + const pct: number = (keys.length / masterKeys.length) * 100; + const missing = difference(masterKeys, keys); + return `${file.n} | ${pct.toFixed(0)}% | ${missing}`; + }).join("\n"); const alteredReadmeTxt = `${before}${open}\n\n${report}\n${close}${after}`; fs.writeFileSync(readmePath, alteredReadmeTxt); - -const difference = (a: Array, b: Array): Array => a.filter(x => !b.includes(x)); - -function buildReport(): string { - const files = [ - { t: de, n: 'de' }, - { t: eo, n: 'eo' }, - { t: es, n: 'es' }, - { t: fi, n: 'fi' }, - { t: fr, n: 'fr' }, - { t: it, n: 'it' }, - { t: nl, n: 'nl' }, - { t: ru, n: 'ru' }, - { t: sv, n: 'sv' }, - { t: zh, n: 'zh' }, - ]; - const masterKeys = Object.keys(en.translation); - - const report = 'lang | done | missing\n' + - '--- | --- | ---\n' + - files.map(file => { - const keys = Object.keys(file.t.translation); - const pct: number = (keys.length / masterKeys.length) * 100; - const missing = difference(masterKeys, keys); - return `${file.n} | ${pct.toFixed(0)}% | ${missing}`; - }).join("\n"); - - return report; -} From 88b798bb6b5dcebc1c410f89cd3151e99e1cf1e7 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 26 Jan 2020 21:20:25 +0100 Subject: [PATCH 06/31] Added and completed CA translation --- README.md | 1 + ui/src/i18next.ts | 2 + ui/src/translations/ca.ts | 234 ++++++++++++++++++++++++++++++++++++++ ui/src/translations/es.ts | 14 +-- ui/translation_report.ts | 2 + 5 files changed, 246 insertions(+), 7 deletions(-) create mode 100644 ui/src/translations/ca.ts diff --git a/README.md b/README.md index af5d433e..7fd3b2ce 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ nl | 93% | create_private_message,send_secure_message,send_message,message,messa ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +ca | 100% | If you'd like to update this report, run: diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index 065d63c8..f1288baa 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -11,6 +11,7 @@ import { zh } from './translations/zh'; import { nl } from './translations/nl'; import { it } from './translations/it'; import { fi } from './translations/fi'; +import { ca } from './translations/ca'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -25,6 +26,7 @@ const resources = { nl, it, fi, + ca, }; const format = (value: any, format: any, lng: any) => format === 'uppercase' ? value.toUpperCase() : value; diff --git a/ui/src/translations/ca.ts b/ui/src/translations/ca.ts new file mode 100644 index 00000000..086037e9 --- /dev/null +++ b/ui/src/translations/ca.ts @@ -0,0 +1,234 @@ +export const ca = { + translation: { + post: 'Publicar', + remove_post: 'Eliminar publicació', + no_posts: 'Sense publicacions.', + create_a_post: 'Crear una publicació', + create_post: 'Crear Publicació', + number_of_posts: '{{count}} Publicacions', + posts: 'Publicacions', + related_posts: 'Aquestes publicacions podrien estar relacionades', + cross_posts: 'Aquest link també ha sigut publicat en:', + cross_post: 'cross-post', + comments: 'Comentaris', + number_of_comments: '{{count}} Comentaris', + remove_comment: 'Eliminar Comentaris', + communities: 'Comunitats', + users: 'Usuaris', + create_a_community: 'Crear una comunitat', + create_community: 'Crear Comunitat', + remove_community: 'Eliminar Comunitat', + subscribed_to_communities: 'Subscrit a <1>comunitats', + trending_communities: '<1>Comunitats en tendència', + list_of_communities: 'Llista de comunitats', + number_of_communities: '{{count}} Comunitats', + community_reqs: 'minúscules, guió baix, i sense espais.', + create_private_message: 'Crear Missatge Privat', + send_secure_message: 'Enviar Missatge Segur', + send_message: 'Enviar Missatge', + message: 'Missatge', + edit: 'editar', + reply: 'respondre', + cancel: 'Cancelar', + preview: 'Previsualitzar', + upload_image: 'pujar imatge', + avatar: 'Avatar', + upload_avatar: 'Pujar Avatar', + show_avatars: 'Veure Avatares', + formatting_help: 'Ajuda de format', + view_source: 'veure font', + unlock: 'desbloquejar', + lock: 'bloquejar', + sticky: 'fijat', + unsticky: 'no fijat', + link: 'link', + archive_link: 'arxivar link', + mod: 'moderador', + mods: 'moderadores', + moderates: 'Modera', + settings: 'Configuració', + remove_as_mod: 'eliminar com moderador', + appoint_as_mod: 'designar com moderador', + modlog: 'Historial de moderació', + admin: 'administrador', + admins: 'administradors', + remove_as_admin: 'eliminar com administrador', + appoint_as_admin: 'designar com administrador', + remove: 'eliminar', + removed: 'eliminat', + locked: 'bloquejat', + stickied: 'fijat', + reason: 'Raó', + mark_as_read: 'marcar com llegit', + mark_as_unread: 'marcar com no llegit', + delete: 'eliminar', + deleted: 'eliminat', + delete_account: 'Eliminar Compte', + delete_account_confirm: + 'Avís: aquesta acció eliminarà permanentment la teva informació. Introdueix la teva contrasenya per a continuar', + restore: 'restaurar', + ban: 'expulsar', + ban_from_site: 'expulsar del lloc', + unban: 'admetre', + unban_from_site: 'admetre al lloc', + banned: 'expulsat', + save: 'guardar', + unsave: 'descartar', + create: 'crear', + creator: 'creador', + username: "Nom d'Usuari", + email_or_username: 'Correu o Usuari', + number_of_users: '{{count}} Usuaris', + number_of_subscribers: '{{count}} Subscriptors', + number_of_points: '{{count}} Punts', + number_online: '{{count}} Usauris En Línia', + name: 'Nom', + title: 'Titol', + category: 'Categoria', + subscribers: 'Suscriptors', + both: 'Ambdos', + saved: 'Guardat', + unsubscribe: "Desubscriure's", + subscribe: "Subscriure's", + subscribed: 'Subscrit', + prev: 'Anterior', + next: 'Següent', + sidebar: 'Descripció de la comunitat', + sort_type: "Tipus d'orden", + hot: 'Popular', + new: 'Nou', + top_day: 'El millor del dia', + week: 'Setmana', + month: 'Mes', + year: 'Any', + all: 'Tot', + top: 'Millor', + api: 'API', + docs: 'Docs', + inbox: "Bústia d'entrada", + inbox_for: "Bústia d'entrada per a <1>{{user}}", + mark_all_as_read: 'marcar tot com llegit', + type: 'Tipus', + unread: 'No llegit', + replies: 'Respostes', + mentions: 'Menciones', + reply_sent: 'Resposta enviada', + message_sent: 'Missatge enviado', + search: 'Buscar', + overview: 'Resum', + view: 'Vista', + logout: 'Tancar sessió', + login_sign_up: 'Iniciar sessió / Crear compte', + login: 'Iniciar sessió', + sign_up: 'Crear compte', + notifications_error: + "Notificacions d'escriptori no disponibles al teu navegador. Prova amb Firefox o Chrome.", + unread_messages: 'Missatges no llegits', + messages: 'Missatges', + password: 'Contrasenya', + verify_password: 'Verificar Contrasenya', + old_password: 'Antiga Contrasenya', + forgot_password: 'oblidí la meva contrasenya', + reset_password_mail_sent: 'Enviar correu per a restablir la contrasenya.', + password_change: 'Canvi de Contrasenya', + new_password: 'Nueva Contrasenya', + no_email_setup: "Aquest servidor no ha activat correctament el correu.", + email: 'Correu electrònic', + matrix_user_id: 'Usuari Matricial', + private_message_disclaimer: + 'Avís: Els missatges privats en Lemmy no són segurs. Sisplau creu un compte en <1>Riot.im per a mensajeria segura.', + send_notifications_to_email: 'Enviar notificacions al correu', + optional: 'Opcional', + expires: 'Expira', + language: 'Llenguatge', + browser_default: 'Per defecte del navegador', + downvotes_disabled: 'Vots negatius deshabilitats', + enable_downvotes: 'Habilitar vots negatius', + open_registration: 'Obrir registre', + registration_closed: 'Registre tancat', + enable_nsfw: 'Habilitar NSFW', + url: 'URL', + body: 'Descripció', + copy_suggested_title: 'Copiar el títol sugerido: {{title}}', + community: 'Comunitat', + expand_here: 'Expandir ací', + subscribe_to_communities: "Subscriure's a algunes <1>comunitats.", + chat: 'Chat', + recent_comments: 'Comentaris recients', + no_results: 'Sense resultats.', + setup: 'Configurar', + lemmy_instance_setup: "Configuració d'instancia de Lemmy", + setup_admin: 'Configurar administrador del Lloc', + your_site: 'el teu lloc', + modified: 'modificat', + nsfw: 'NSFW', + show_nsfw: 'Mostrar contingut NSFW', + theme: 'Tema', + sponsors: 'Patrocinadors', + sponsors_of_lemmy: 'Patrocinadors de Lemmy', + sponsor_message: + 'Lemmy és programari lliure i de <1>codi obert, la qual cosa significa que no tindrà publicitats, monetització, ni capitals emprenedors, mai. Les teves donacions secunden directament el desenvolupament a temps complet del projecte. Moltes gràcies a les següents persones:', + support_on_patreon: 'Suport a Patreon', + donate_to_lemmy: 'Donar a Lemmy', + donate: 'Donar', + general_sponsors: + 'Los Patrocinadores Generales son aquellos que señaron entre $10 y $39 a Lemmy.', + crypto: 'Crypto', + bitcoin: 'Bitcoin', + ethereum: 'Ethereum', + monero: 'Monero', + code: 'Codi', + joined: 'Es va unir', + by: 'per', + to: 'a', + from: 'des de', + transfer_community: 'transferir comunitat', + transfer_site: 'transferir lloc', + are_you_sure: 'Ets segur?', + yes: 'sí', + no: 'no', + powered_by: 'Impulsat per', + landing_0: + 'Lemmy és un <1>agregador de links / alternativa a reddit, amb la intenció de funcionar al <2>fedivers.<3>És allotjable per un mateix (sense necessitat de grans companyies), té actualització en directe de cadenes de comentaris, i és petit (<4>~80kB). Federar amb el sistema de xarxes ActivityPub forma part dels objectius del projecte. <5>Aquesta és una <6>versió beta molt prematura, i actualment moltes de les característiques són trencades o falten. <7>Suggereix noves característiques o reporta errors <8>aquí.<9>Fet amb <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', + not_logged_in: 'No has iniciat sessió.', + logged_in: 'Has iniciat sessió.', + community_ban: "Has sigut expulsat d'aquesta comunitat.", + site_ban: "Has sigut expulsat d'aquest lloc.", + couldnt_create_comment: "No s'ha pogut crear el comentari.", + couldnt_like_comment: "No s'ha pogut donar m'agrada al comentari.", + couldnt_update_comment: "No s'ha pogut actualitzar el comentari.", + couldnt_save_comment: "No s'ha pogut guardar el comentari.", + no_comment_edit_allowed: "No tens permisos per a editar el comentari.", + no_post_edit_allowed: "No tens permisos per a editar la publicació.", + no_community_edit_allowed: "No tens permisos per a editar la comunitat.", + couldnt_find_community: "No s'ha pogut trobar la comunitat.", + couldnt_update_community: "No s'ha pogut actualitzar la comunitat.", + community_already_exists: 'Aquesta comunitat ja existeix.', + community_moderator_already_exists: 'Aquest moderador de la comunitat ja existeix.', + community_follower_already_exists: 'Aquest seguidor de la comunitat ja existeix.', + community_user_already_banned: 'Aquest usuari de la comunitat ja fou expulsat.', + couldnt_create_post: "No s'ha pogut crear la publicació.", + couldnt_like_post: "No s'ha pogut donar m'agrada a la publicació.", + couldnt_find_post: "No s'ha pogut trobar la publicació.", + couldnt_get_posts: "No s'han pogut obtindre les publicacions.", + couldnt_update_post: "No s'ha pogut actualitzar la publicació.", + couldnt_save_post: "No s'ha pogut guardar la publicació.", + no_slurs: 'Prohibit insultar.', + not_an_admin: 'No és un administrador.', + site_already_exists: 'El lloc ja existeix.', + couldnt_update_site: "No s'ha pogut actualitzar el lloc.", + couldnt_find_that_username_or_email: + "No s'ha pogut trobar aquest nom de usuari o correu electrònic.", + password_incorrect: 'Contrasenya incorrecta.', + passwords_dont_match: 'Les contrasenyes no coincideixen.', + admin_already_created: 'Ho sentim, ja hi ha un adminisitrador.', + user_already_exists: "L'usuari ja existeix.", + email_already_exists: 'El correu ja és en ús.', + couldnt_update_user: "No s'ha pogut actualitzar l'usuari.", + system_err_login: 'Error del sistema. Intenti tancar sessió i ingressar de nou.', + couldnt_create_private_message: "No s'ha pogut crear el missatge privat.", + no_private_message_edit_allowed: 'Sense permisos per a editar el missatge privat.', + couldnt_update_private_message: "No s'ha pogut actualitzar el missatge privat.", + }, + }; + \ No newline at end of file diff --git a/ui/src/translations/es.ts b/ui/src/translations/es.ts index e8bdc3d0..6fb49482 100644 --- a/ui/src/translations/es.ts +++ b/ui/src/translations/es.ts @@ -55,7 +55,7 @@ export const es = { remove_as_admin: 'eliminar como administrador', appoint_as_admin: 'designar como administrador', remove: 'eliminar', - removed: 'removido', + removed: 'eliminado', locked: 'bloqueado', stickied: 'fijado', reason: 'Razón', @@ -127,8 +127,8 @@ export const es = { messages: 'Mensajes', password: 'Contraseña', verify_password: 'Verificar contraseña', - old_password: 'Antigua Password', - forgot_password: 'olvidé mi password', + old_password: 'Antigua Contraseña', + forgot_password: 'olvidé mi contraseña', reset_password_mail_sent: 'Enviar correo para reestablecer la contraseña.', password_change: 'Cambio de Contraseña', new_password: 'Nueva Contraseña', @@ -195,12 +195,12 @@ export const es = { community_ban: 'Has sido expulsado de esta comunidad.', site_ban: 'Has sido expulsado del sitio', couldnt_create_comment: 'No se pudo crear el comentario.', - couldnt_like_comment: 'No se pudo gustar el comentario.', + couldnt_like_comment: 'No se pudo dar me gusta al comentario.', couldnt_update_comment: 'No se pudo actualizar el comentario.', couldnt_save_comment: 'No se pudo guardar el comentario.', - no_comment_edit_allowed: 'No tiene permitido editar el comentario.', - no_post_edit_allowed: 'No tiene permitido editar la publicación.', - no_community_edit_allowed: 'No tiene permitido editar la comunidad.', + no_comment_edit_allowed: 'No tiene permisos para editar el comentario.', + no_post_edit_allowed: 'No tiene permisos para editar la publicación.', + no_community_edit_allowed: 'No tiene permisos para editar la comunidad.', couldnt_find_community: 'No se pudo encontrar la comunidad.', couldnt_update_community: 'No se pudo actualizar la comunidad.', community_already_exists: 'Esta comunidad ya existe.', diff --git a/ui/translation_report.ts b/ui/translation_report.ts index 73e03dbb..3ac4e0b1 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -9,6 +9,7 @@ import { ru } from './src/translations/ru'; import { nl } from './src/translations/nl'; import { it } from './src/translations/it'; import { fi } from './src/translations/fi'; +import { ca } from './src/translations/ca'; import fs from 'fs'; const files = [ @@ -22,6 +23,7 @@ const files = [ { t: ru, n: 'ru' }, { t: sv, n: 'sv' }, { t: zh, n: 'zh' }, + { t: ca, n: 'ca' }, ]; const masterKeys = Object.keys(en.translation); From e160438a902114ba9336a91e256409c63da5e2aa Mon Sep 17 00:00:00 2001 From: David Date: Sun, 26 Jan 2020 21:49:47 +0100 Subject: [PATCH 07/31] Lambdas reverted --- ui/src/i18next.ts | 4 +++- ui/translation_report.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index f1288baa..51e7e3a3 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -29,7 +29,9 @@ const resources = { ca, }; -const format = (value: any, format: any, lng: any) => format === 'uppercase' ? value.toUpperCase() : value; +function format(value: any, format: any, lng: any): any { + return format === 'uppercase' ? value.toUpperCase() : value; +} i18next.init({ debug: false, diff --git a/ui/translation_report.ts b/ui/translation_report.ts index 3ac4e0b1..797a8f65 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -37,7 +37,9 @@ const readmeTxt = fs.readFileSync(readmePath, { encoding: 'utf8' }); const before = readmeTxt.split(open)[0]; const after = readmeTxt.split(close)[1]; -const difference = (a: Array, b: Array): Array => a.filter(x => !b.includes(x)); +function difference(a: Array, b: Array): Array { + return a.filter(x => !b.includes(x)); +} const report = 'lang | done | missing\n' + From f044459fdafe634c4f05a994ae5007542e1575f5 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 26 Jan 2020 16:32:35 -0500 Subject: [PATCH 08/31] Adding Catalan to user pref dropdown, moment.js. --- ui/src/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 6c22e25b..0aec7624 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -8,6 +8,7 @@ import 'moment/locale/ru'; import 'moment/locale/nl'; import 'moment/locale/it'; import 'moment/locale/fi'; +import 'moment/locale/ca'; import { UserOperation, @@ -252,6 +253,7 @@ export function debounce( } export const languages = [ + { code: 'ca', name: 'Català' }, { code: 'en', name: 'English' }, { code: 'eo', name: 'Esperanto' }, { code: 'es', name: 'Español' }, @@ -302,6 +304,8 @@ export function getMomentLanguage(): string { lang = 'it'; } else if (lang.startsWith('fi')) { lang = 'fi'; + } else if (lang.startsWith('ca')) { + lang = 'ca'; } else { lang = 'en'; } From 318049174833ab221a60b13708f1ce7e36ceeb54 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 26 Jan 2020 16:38:08 -0500 Subject: [PATCH 09/31] Formatting translation file, changing deploy script to const. --- README.md | 4 +- docker/dev/deploy.sh | 2 +- ui/src/translations/ca.ts | 471 +++++++++++++++++++------------------- ui/translation_report.ts | 18 +- 4 files changed, 251 insertions(+), 244 deletions(-) diff --git a/README.md b/README.md index 7fd3b2ce..7b645c14 100644 --- a/README.md +++ b/README.md @@ -161,12 +161,13 @@ Lemmy is free, open-source software, meaning no advertising, monetizing, or vent If you'd like to add translations, take a look a look at the [English translation file](ui/src/translations/en.ts). -- Languages supported: English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). +- Languages supported: Catalan, (`ca`), English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). lang | done | missing ---- | ---- | ------- +ca | 100% | de | 88% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message eo | 76% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message es | 100% | @@ -177,7 +178,6 @@ nl | 93% | create_private_message,send_secure_message,send_message,message,messa ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -ca | 100% | If you'd like to update this report, run: diff --git a/docker/dev/deploy.sh b/docker/dev/deploy.sh index 6b79f8f2..beaa0768 100755 --- a/docker/dev/deploy.sh +++ b/docker/dev/deploy.sh @@ -9,7 +9,7 @@ third_semver=$(echo $new_tag | cut -d "." -f 3) # Setting the version on the front end cd ../../ -echo "export let version: string = '$(git describe --tags)';" > "ui/src/version.ts" +echo "export const version: string = '$(git describe --tags)';" > "ui/src/version.ts" git add "ui/src/version.ts" # Setting the version on the backend echo "pub const VERSION: &str = \"$(git describe --tags)\";" > "server/src/version.rs" diff --git a/ui/src/translations/ca.ts b/ui/src/translations/ca.ts index 086037e9..790a3f9d 100644 --- a/ui/src/translations/ca.ts +++ b/ui/src/translations/ca.ts @@ -1,234 +1,239 @@ export const ca = { - translation: { - post: 'Publicar', - remove_post: 'Eliminar publicació', - no_posts: 'Sense publicacions.', - create_a_post: 'Crear una publicació', - create_post: 'Crear Publicació', - number_of_posts: '{{count}} Publicacions', - posts: 'Publicacions', - related_posts: 'Aquestes publicacions podrien estar relacionades', - cross_posts: 'Aquest link també ha sigut publicat en:', - cross_post: 'cross-post', - comments: 'Comentaris', - number_of_comments: '{{count}} Comentaris', - remove_comment: 'Eliminar Comentaris', - communities: 'Comunitats', - users: 'Usuaris', - create_a_community: 'Crear una comunitat', - create_community: 'Crear Comunitat', - remove_community: 'Eliminar Comunitat', - subscribed_to_communities: 'Subscrit a <1>comunitats', - trending_communities: '<1>Comunitats en tendència', - list_of_communities: 'Llista de comunitats', - number_of_communities: '{{count}} Comunitats', - community_reqs: 'minúscules, guió baix, i sense espais.', - create_private_message: 'Crear Missatge Privat', - send_secure_message: 'Enviar Missatge Segur', - send_message: 'Enviar Missatge', - message: 'Missatge', - edit: 'editar', - reply: 'respondre', - cancel: 'Cancelar', - preview: 'Previsualitzar', - upload_image: 'pujar imatge', - avatar: 'Avatar', - upload_avatar: 'Pujar Avatar', - show_avatars: 'Veure Avatares', - formatting_help: 'Ajuda de format', - view_source: 'veure font', - unlock: 'desbloquejar', - lock: 'bloquejar', - sticky: 'fijat', - unsticky: 'no fijat', - link: 'link', - archive_link: 'arxivar link', - mod: 'moderador', - mods: 'moderadores', - moderates: 'Modera', - settings: 'Configuració', - remove_as_mod: 'eliminar com moderador', - appoint_as_mod: 'designar com moderador', - modlog: 'Historial de moderació', - admin: 'administrador', - admins: 'administradors', - remove_as_admin: 'eliminar com administrador', - appoint_as_admin: 'designar com administrador', - remove: 'eliminar', - removed: 'eliminat', - locked: 'bloquejat', - stickied: 'fijat', - reason: 'Raó', - mark_as_read: 'marcar com llegit', - mark_as_unread: 'marcar com no llegit', - delete: 'eliminar', - deleted: 'eliminat', - delete_account: 'Eliminar Compte', - delete_account_confirm: - 'Avís: aquesta acció eliminarà permanentment la teva informació. Introdueix la teva contrasenya per a continuar', - restore: 'restaurar', - ban: 'expulsar', - ban_from_site: 'expulsar del lloc', - unban: 'admetre', - unban_from_site: 'admetre al lloc', - banned: 'expulsat', - save: 'guardar', - unsave: 'descartar', - create: 'crear', - creator: 'creador', - username: "Nom d'Usuari", - email_or_username: 'Correu o Usuari', - number_of_users: '{{count}} Usuaris', - number_of_subscribers: '{{count}} Subscriptors', - number_of_points: '{{count}} Punts', - number_online: '{{count}} Usauris En Línia', - name: 'Nom', - title: 'Titol', - category: 'Categoria', - subscribers: 'Suscriptors', - both: 'Ambdos', - saved: 'Guardat', - unsubscribe: "Desubscriure's", - subscribe: "Subscriure's", - subscribed: 'Subscrit', - prev: 'Anterior', - next: 'Següent', - sidebar: 'Descripció de la comunitat', - sort_type: "Tipus d'orden", - hot: 'Popular', - new: 'Nou', - top_day: 'El millor del dia', - week: 'Setmana', - month: 'Mes', - year: 'Any', - all: 'Tot', - top: 'Millor', - api: 'API', - docs: 'Docs', - inbox: "Bústia d'entrada", - inbox_for: "Bústia d'entrada per a <1>{{user}}", - mark_all_as_read: 'marcar tot com llegit', - type: 'Tipus', - unread: 'No llegit', - replies: 'Respostes', - mentions: 'Menciones', - reply_sent: 'Resposta enviada', - message_sent: 'Missatge enviado', - search: 'Buscar', - overview: 'Resum', - view: 'Vista', - logout: 'Tancar sessió', - login_sign_up: 'Iniciar sessió / Crear compte', - login: 'Iniciar sessió', - sign_up: 'Crear compte', - notifications_error: - "Notificacions d'escriptori no disponibles al teu navegador. Prova amb Firefox o Chrome.", - unread_messages: 'Missatges no llegits', - messages: 'Missatges', - password: 'Contrasenya', - verify_password: 'Verificar Contrasenya', - old_password: 'Antiga Contrasenya', - forgot_password: 'oblidí la meva contrasenya', - reset_password_mail_sent: 'Enviar correu per a restablir la contrasenya.', - password_change: 'Canvi de Contrasenya', - new_password: 'Nueva Contrasenya', - no_email_setup: "Aquest servidor no ha activat correctament el correu.", - email: 'Correu electrònic', - matrix_user_id: 'Usuari Matricial', - private_message_disclaimer: - 'Avís: Els missatges privats en Lemmy no són segurs. Sisplau creu un compte en <1>Riot.im per a mensajeria segura.', - send_notifications_to_email: 'Enviar notificacions al correu', - optional: 'Opcional', - expires: 'Expira', - language: 'Llenguatge', - browser_default: 'Per defecte del navegador', - downvotes_disabled: 'Vots negatius deshabilitats', - enable_downvotes: 'Habilitar vots negatius', - open_registration: 'Obrir registre', - registration_closed: 'Registre tancat', - enable_nsfw: 'Habilitar NSFW', - url: 'URL', - body: 'Descripció', - copy_suggested_title: 'Copiar el títol sugerido: {{title}}', - community: 'Comunitat', - expand_here: 'Expandir ací', - subscribe_to_communities: "Subscriure's a algunes <1>comunitats.", - chat: 'Chat', - recent_comments: 'Comentaris recients', - no_results: 'Sense resultats.', - setup: 'Configurar', - lemmy_instance_setup: "Configuració d'instancia de Lemmy", - setup_admin: 'Configurar administrador del Lloc', - your_site: 'el teu lloc', - modified: 'modificat', - nsfw: 'NSFW', - show_nsfw: 'Mostrar contingut NSFW', - theme: 'Tema', - sponsors: 'Patrocinadors', - sponsors_of_lemmy: 'Patrocinadors de Lemmy', - sponsor_message: - 'Lemmy és programari lliure i de <1>codi obert, la qual cosa significa que no tindrà publicitats, monetització, ni capitals emprenedors, mai. Les teves donacions secunden directament el desenvolupament a temps complet del projecte. Moltes gràcies a les següents persones:', - support_on_patreon: 'Suport a Patreon', - donate_to_lemmy: 'Donar a Lemmy', - donate: 'Donar', - general_sponsors: - 'Los Patrocinadores Generales son aquellos que señaron entre $10 y $39 a Lemmy.', - crypto: 'Crypto', - bitcoin: 'Bitcoin', - ethereum: 'Ethereum', - monero: 'Monero', - code: 'Codi', - joined: 'Es va unir', - by: 'per', - to: 'a', - from: 'des de', - transfer_community: 'transferir comunitat', - transfer_site: 'transferir lloc', - are_you_sure: 'Ets segur?', - yes: 'sí', - no: 'no', - powered_by: 'Impulsat per', - landing_0: - 'Lemmy és un <1>agregador de links / alternativa a reddit, amb la intenció de funcionar al <2>fedivers.<3>És allotjable per un mateix (sense necessitat de grans companyies), té actualització en directe de cadenes de comentaris, i és petit (<4>~80kB). Federar amb el sistema de xarxes ActivityPub forma part dels objectius del projecte. <5>Aquesta és una <6>versió beta molt prematura, i actualment moltes de les característiques són trencades o falten. <7>Suggereix noves característiques o reporta errors <8>aquí.<9>Fet amb <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', - not_logged_in: 'No has iniciat sessió.', - logged_in: 'Has iniciat sessió.', - community_ban: "Has sigut expulsat d'aquesta comunitat.", - site_ban: "Has sigut expulsat d'aquest lloc.", - couldnt_create_comment: "No s'ha pogut crear el comentari.", - couldnt_like_comment: "No s'ha pogut donar m'agrada al comentari.", - couldnt_update_comment: "No s'ha pogut actualitzar el comentari.", - couldnt_save_comment: "No s'ha pogut guardar el comentari.", - no_comment_edit_allowed: "No tens permisos per a editar el comentari.", - no_post_edit_allowed: "No tens permisos per a editar la publicació.", - no_community_edit_allowed: "No tens permisos per a editar la comunitat.", - couldnt_find_community: "No s'ha pogut trobar la comunitat.", - couldnt_update_community: "No s'ha pogut actualitzar la comunitat.", - community_already_exists: 'Aquesta comunitat ja existeix.', - community_moderator_already_exists: 'Aquest moderador de la comunitat ja existeix.', - community_follower_already_exists: 'Aquest seguidor de la comunitat ja existeix.', - community_user_already_banned: 'Aquest usuari de la comunitat ja fou expulsat.', - couldnt_create_post: "No s'ha pogut crear la publicació.", - couldnt_like_post: "No s'ha pogut donar m'agrada a la publicació.", - couldnt_find_post: "No s'ha pogut trobar la publicació.", - couldnt_get_posts: "No s'han pogut obtindre les publicacions.", - couldnt_update_post: "No s'ha pogut actualitzar la publicació.", - couldnt_save_post: "No s'ha pogut guardar la publicació.", - no_slurs: 'Prohibit insultar.', - not_an_admin: 'No és un administrador.', - site_already_exists: 'El lloc ja existeix.', - couldnt_update_site: "No s'ha pogut actualitzar el lloc.", - couldnt_find_that_username_or_email: - "No s'ha pogut trobar aquest nom de usuari o correu electrònic.", - password_incorrect: 'Contrasenya incorrecta.', - passwords_dont_match: 'Les contrasenyes no coincideixen.', - admin_already_created: 'Ho sentim, ja hi ha un adminisitrador.', - user_already_exists: "L'usuari ja existeix.", - email_already_exists: 'El correu ja és en ús.', - couldnt_update_user: "No s'ha pogut actualitzar l'usuari.", - system_err_login: 'Error del sistema. Intenti tancar sessió i ingressar de nou.', - couldnt_create_private_message: "No s'ha pogut crear el missatge privat.", - no_private_message_edit_allowed: 'Sense permisos per a editar el missatge privat.', - couldnt_update_private_message: "No s'ha pogut actualitzar el missatge privat.", - }, - }; - \ No newline at end of file + translation: { + post: 'Publicar', + remove_post: 'Eliminar publicació', + no_posts: 'Sense publicacions.', + create_a_post: 'Crear una publicació', + create_post: 'Crear Publicació', + number_of_posts: '{{count}} Publicacions', + posts: 'Publicacions', + related_posts: 'Aquestes publicacions podrien estar relacionades', + cross_posts: 'Aquest link també ha sigut publicat en:', + cross_post: 'cross-post', + comments: 'Comentaris', + number_of_comments: '{{count}} Comentaris', + remove_comment: 'Eliminar Comentaris', + communities: 'Comunitats', + users: 'Usuaris', + create_a_community: 'Crear una comunitat', + create_community: 'Crear Comunitat', + remove_community: 'Eliminar Comunitat', + subscribed_to_communities: 'Subscrit a <1>comunitats', + trending_communities: '<1>Comunitats en tendència', + list_of_communities: 'Llista de comunitats', + number_of_communities: '{{count}} Comunitats', + community_reqs: 'minúscules, guió baix, i sense espais.', + create_private_message: 'Crear Missatge Privat', + send_secure_message: 'Enviar Missatge Segur', + send_message: 'Enviar Missatge', + message: 'Missatge', + edit: 'editar', + reply: 'respondre', + cancel: 'Cancelar', + preview: 'Previsualitzar', + upload_image: 'pujar imatge', + avatar: 'Avatar', + upload_avatar: 'Pujar Avatar', + show_avatars: 'Veure Avatares', + formatting_help: 'Ajuda de format', + view_source: 'veure font', + unlock: 'desbloquejar', + lock: 'bloquejar', + sticky: 'fijat', + unsticky: 'no fijat', + link: 'link', + archive_link: 'arxivar link', + mod: 'moderador', + mods: 'moderadores', + moderates: 'Modera', + settings: 'Configuració', + remove_as_mod: 'eliminar com moderador', + appoint_as_mod: 'designar com moderador', + modlog: 'Historial de moderació', + admin: 'administrador', + admins: 'administradors', + remove_as_admin: 'eliminar com administrador', + appoint_as_admin: 'designar com administrador', + remove: 'eliminar', + removed: 'eliminat', + locked: 'bloquejat', + stickied: 'fijat', + reason: 'Raó', + mark_as_read: 'marcar com llegit', + mark_as_unread: 'marcar com no llegit', + delete: 'eliminar', + deleted: 'eliminat', + delete_account: 'Eliminar Compte', + delete_account_confirm: + 'Avís: aquesta acció eliminarà permanentment la teva informació. Introdueix la teva contrasenya per a continuar', + restore: 'restaurar', + ban: 'expulsar', + ban_from_site: 'expulsar del lloc', + unban: 'admetre', + unban_from_site: 'admetre al lloc', + banned: 'expulsat', + save: 'guardar', + unsave: 'descartar', + create: 'crear', + creator: 'creador', + username: "Nom d'Usuari", + email_or_username: 'Correu o Usuari', + number_of_users: '{{count}} Usuaris', + number_of_subscribers: '{{count}} Subscriptors', + number_of_points: '{{count}} Punts', + number_online: '{{count}} Usauris En Línia', + name: 'Nom', + title: 'Titol', + category: 'Categoria', + subscribers: 'Suscriptors', + both: 'Ambdos', + saved: 'Guardat', + unsubscribe: "Desubscriure's", + subscribe: "Subscriure's", + subscribed: 'Subscrit', + prev: 'Anterior', + next: 'Següent', + sidebar: 'Descripció de la comunitat', + sort_type: "Tipus d'orden", + hot: 'Popular', + new: 'Nou', + top_day: 'El millor del dia', + week: 'Setmana', + month: 'Mes', + year: 'Any', + all: 'Tot', + top: 'Millor', + api: 'API', + docs: 'Docs', + inbox: "Bústia d'entrada", + inbox_for: "Bústia d'entrada per a <1>{{user}}", + mark_all_as_read: 'marcar tot com llegit', + type: 'Tipus', + unread: 'No llegit', + replies: 'Respostes', + mentions: 'Menciones', + reply_sent: 'Resposta enviada', + message_sent: 'Missatge enviado', + search: 'Buscar', + overview: 'Resum', + view: 'Vista', + logout: 'Tancar sessió', + login_sign_up: 'Iniciar sessió / Crear compte', + login: 'Iniciar sessió', + sign_up: 'Crear compte', + notifications_error: + "Notificacions d'escriptori no disponibles al teu navegador. Prova amb Firefox o Chrome.", + unread_messages: 'Missatges no llegits', + messages: 'Missatges', + password: 'Contrasenya', + verify_password: 'Verificar Contrasenya', + old_password: 'Antiga Contrasenya', + forgot_password: 'oblidí la meva contrasenya', + reset_password_mail_sent: 'Enviar correu per a restablir la contrasenya.', + password_change: 'Canvi de Contrasenya', + new_password: 'Nueva Contrasenya', + no_email_setup: 'Aquest servidor no ha activat correctament el correu.', + email: 'Correu electrònic', + matrix_user_id: 'Usuari Matricial', + private_message_disclaimer: + 'Avís: Els missatges privats en Lemmy no són segurs. Sisplau creu un compte en <1>Riot.im per a mensajeria segura.', + send_notifications_to_email: 'Enviar notificacions al correu', + optional: 'Opcional', + expires: 'Expira', + language: 'Llenguatge', + browser_default: 'Per defecte del navegador', + downvotes_disabled: 'Vots negatius deshabilitats', + enable_downvotes: 'Habilitar vots negatius', + open_registration: 'Obrir registre', + registration_closed: 'Registre tancat', + enable_nsfw: 'Habilitar NSFW', + url: 'URL', + body: 'Descripció', + copy_suggested_title: 'Copiar el títol sugerido: {{title}}', + community: 'Comunitat', + expand_here: 'Expandir ací', + subscribe_to_communities: "Subscriure's a algunes <1>comunitats.", + chat: 'Chat', + recent_comments: 'Comentaris recients', + no_results: 'Sense resultats.', + setup: 'Configurar', + lemmy_instance_setup: "Configuració d'instancia de Lemmy", + setup_admin: 'Configurar administrador del Lloc', + your_site: 'el teu lloc', + modified: 'modificat', + nsfw: 'NSFW', + show_nsfw: 'Mostrar contingut NSFW', + theme: 'Tema', + sponsors: 'Patrocinadors', + sponsors_of_lemmy: 'Patrocinadors de Lemmy', + sponsor_message: + 'Lemmy és programari lliure i de <1>codi obert, la qual cosa significa que no tindrà publicitats, monetització, ni capitals emprenedors, mai. Les teves donacions secunden directament el desenvolupament a temps complet del projecte. Moltes gràcies a les següents persones:', + support_on_patreon: 'Suport a Patreon', + donate_to_lemmy: 'Donar a Lemmy', + donate: 'Donar', + general_sponsors: + 'Los Patrocinadores Generales son aquellos que señaron entre $10 y $39 a Lemmy.', + crypto: 'Crypto', + bitcoin: 'Bitcoin', + ethereum: 'Ethereum', + monero: 'Monero', + code: 'Codi', + joined: 'Es va unir', + by: 'per', + to: 'a', + from: 'des de', + transfer_community: 'transferir comunitat', + transfer_site: 'transferir lloc', + are_you_sure: 'Ets segur?', + yes: 'sí', + no: 'no', + powered_by: 'Impulsat per', + landing_0: + 'Lemmy és un <1>agregador de links / alternativa a reddit, amb la intenció de funcionar al <2>fedivers.<3>És allotjable per un mateix (sense necessitat de grans companyies), té actualització en directe de cadenes de comentaris, i és petit (<4>~80kB). Federar amb el sistema de xarxes ActivityPub forma part dels objectius del projecte. <5>Aquesta és una <6>versió beta molt prematura, i actualment moltes de les característiques són trencades o falten. <7>Suggereix noves característiques o reporta errors <8>aquí.<9>Fet amb <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', + not_logged_in: 'No has iniciat sessió.', + logged_in: 'Has iniciat sessió.', + community_ban: "Has sigut expulsat d'aquesta comunitat.", + site_ban: "Has sigut expulsat d'aquest lloc.", + couldnt_create_comment: "No s'ha pogut crear el comentari.", + couldnt_like_comment: "No s'ha pogut donar m'agrada al comentari.", + couldnt_update_comment: "No s'ha pogut actualitzar el comentari.", + couldnt_save_comment: "No s'ha pogut guardar el comentari.", + no_comment_edit_allowed: 'No tens permisos per a editar el comentari.', + no_post_edit_allowed: 'No tens permisos per a editar la publicació.', + no_community_edit_allowed: 'No tens permisos per a editar la comunitat.', + couldnt_find_community: "No s'ha pogut trobar la comunitat.", + couldnt_update_community: "No s'ha pogut actualitzar la comunitat.", + community_already_exists: 'Aquesta comunitat ja existeix.', + community_moderator_already_exists: + 'Aquest moderador de la comunitat ja existeix.', + community_follower_already_exists: + 'Aquest seguidor de la comunitat ja existeix.', + community_user_already_banned: + 'Aquest usuari de la comunitat ja fou expulsat.', + couldnt_create_post: "No s'ha pogut crear la publicació.", + couldnt_like_post: "No s'ha pogut donar m'agrada a la publicació.", + couldnt_find_post: "No s'ha pogut trobar la publicació.", + couldnt_get_posts: "No s'han pogut obtindre les publicacions.", + couldnt_update_post: "No s'ha pogut actualitzar la publicació.", + couldnt_save_post: "No s'ha pogut guardar la publicació.", + no_slurs: 'Prohibit insultar.', + not_an_admin: 'No és un administrador.', + site_already_exists: 'El lloc ja existeix.', + couldnt_update_site: "No s'ha pogut actualitzar el lloc.", + couldnt_find_that_username_or_email: + "No s'ha pogut trobar aquest nom de usuari o correu electrònic.", + password_incorrect: 'Contrasenya incorrecta.', + passwords_dont_match: 'Les contrasenyes no coincideixen.', + admin_already_created: 'Ho sentim, ja hi ha un adminisitrador.', + user_already_exists: "L'usuari ja existeix.", + email_already_exists: 'El correu ja és en ús.', + couldnt_update_user: "No s'ha pogut actualitzar l'usuari.", + system_err_login: + 'Error del sistema. Intenti tancar sessió i ingressar de nou.', + couldnt_create_private_message: "No s'ha pogut crear el missatge privat.", + no_private_message_edit_allowed: + 'Sense permisos per a editar el missatge privat.', + couldnt_update_private_message: + "No s'ha pogut actualitzar el missatge privat.", + }, +}; diff --git a/ui/translation_report.ts b/ui/translation_report.ts index 797a8f65..56c09c96 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -13,6 +13,7 @@ import { ca } from './src/translations/ca'; import fs from 'fs'; const files = [ + { t: ca, n: 'ca' }, { t: de, n: 'de' }, { t: eo, n: 'eo' }, { t: es, n: 'es' }, @@ -23,7 +24,6 @@ const files = [ { t: ru, n: 'ru' }, { t: sv, n: 'sv' }, { t: zh, n: 'zh' }, - { t: ca, n: 'ca' }, ]; const masterKeys = Object.keys(en.translation); @@ -41,15 +41,17 @@ function difference(a: Array, b: Array): Array { return a.filter(x => !b.includes(x)); } -const report = +const report = 'lang | done | missing\n' + '---- | ---- | -------\n' + - files.map(file => { - const keys = Object.keys(file.t.translation); - const pct: number = (keys.length / masterKeys.length) * 100; - const missing = difference(masterKeys, keys); - return `${file.n} | ${pct.toFixed(0)}% | ${missing}`; - }).join("\n"); + files + .map(file => { + const keys = Object.keys(file.t.translation); + const pct: number = (keys.length / masterKeys.length) * 100; + const missing = difference(masterKeys, keys); + return `${file.n} | ${pct.toFixed(0)}% | ${missing}`; + }) + .join('\n'); const alteredReadmeTxt = `${before}${open}\n\n${report}\n${close}${after}`; From 8ef3abca0e8ba05932bb6b72002f387402c97483 Mon Sep 17 00:00:00 2001 From: Rynach Date: Mon, 27 Jan 2020 00:24:50 +0200 Subject: [PATCH 10/31] Improve the Finnish translation Changed and made the wording in a couple lines more context-appropriate. --- ui/src/translations/fi.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ui/src/translations/fi.ts b/ui/src/translations/fi.ts index 2bc1f6a0..42d99e3e 100644 --- a/ui/src/translations/fi.ts +++ b/ui/src/translations/fi.ts @@ -4,7 +4,7 @@ export const fi = { remove_post: 'Poista viesti', no_posts: 'Ei viestjä.', create_a_post: 'Luo viesti', - create_post: 'Luo viestit', + create_post: 'Luo viesti', number_of_posts: '{{count}} viestiä', posts: 'Viestit', related_posts: 'Nämä viestit voivat liittyä toisiinsa', @@ -18,7 +18,7 @@ export const fi = { create_a_community: 'Luo yhteisö', create_community: 'Luo yhteisö', remove_community: 'Poista yhteisö', - subscribed_to_communities: 'Tilannut seuraavat <1>yhteisöt', + subscribed_to_communities: 'Tilatut <1>yhteisöt', trending_communities: 'Nousevat <1>yhteisöt', list_of_communities: 'Lista yhteisöistä', number_of_communities: '{{count}} yhteisöä', @@ -47,13 +47,13 @@ export const fi = { mods: 'moderaattorit', moderates: 'Moderoi', settings: 'Asetukset', - remove_as_mod: 'Poista moderaattorin asemassa', + remove_as_mod: 'Poista moderaattorina', appoint_as_mod: 'Nimitä moderaattoriksi', modlog: 'Moderoinnin loki', admin: 'Ylläpitäjä', admins: 'ylläpitäjät', - remove_as_admin: 'poista adminin asemassa', - appoint_as_admin: 'nimitä adminiksi', + remove_as_admin: 'poista ylläpitäjänä', + appoint_as_admin: 'nimitä ylläpitäjäksi', remove: 'poista', removed: 'poistettu', locked: 'lukittu', @@ -79,11 +79,11 @@ export const fi = { username: 'Käyttäjänimi', email_or_username: 'Sähköposti tai käyttäjätunnus', number_of_users: '{{count}} käyttäjää', - number_of_subscribers: '{{count}} tilaajaaa', + number_of_subscribers: '{{count}} tilaajaa', number_of_points: '{{count}} pistettä', - number_online: '{{count}} käyttäjää kirjautuneena', + number_online: '{{count}} käyttäjää aktiivisena', name: 'Nimi', - title: 'Titteli', + title: 'Kuvaus', category: 'Luokka', subscribers: 'Tilaajat', both: 'Molemmat', @@ -136,7 +136,7 @@ export const fi = { email: 'Sähköposti', matrix_user_id: ' Matrix-käyttäjä', private_message_disclaimer: - 'Varoitus: Yksityisviestit Lemmyssä eivät ole turvallisia. Luo tili <1>Riot.im-palveluun turvallista viestintää varten.', + 'Varoitus: Yksityisviestit Lemmyssä eivät ole turvallisia. Luo tili <1>Riot.im -palveluun turvallista viestintää varten.', send_notifications_to_email: 'Lähetä ilmoitukset sähköpostiin', optional: 'Valinnainen', expires: 'Umpeutuu', @@ -152,7 +152,7 @@ export const fi = { copy_suggested_title: 'kopioi ehdotettu otsikko: {{title}}', community: 'Yhteisö', expand_here: 'Laajenna tässä', - subscribe_to_communities: 'Tilaa joitakin <1>communities.', + subscribe_to_communities: 'Tilaa joitakin <1>yhteisöjä.', chat: 'Chat', recent_comments: 'Viimeaikaiset kommentit', no_results: 'Ei tuloksia.', @@ -167,7 +167,7 @@ export const fi = { sponsors: 'Sponsorit', sponsors_of_lemmy: 'Lemmy-sponsorit', sponsor_message: - 'Lemmy on vapaa, <1>avoimen lähdekoodin -ohjelmisto, eli mainontaa, rahantekemistä, tai pääomasijoitusta täällä ei tule ikinä olemaan. Lahjoituksesi tukevat suoraaan projektin täysipäiväistä kehitystä. Kiitokset seuraaville ihmisille:', + 'Lemmy on vapaa, <1>avoimen lähdekoodin -ohjelmisto, eli mainontaa, rahantekemistä, tai pääomasijoitusta täällä ei tule ikinä olemaan. Lahjoituksesi tukevat suoraan projektin täysipäiväistä kehitystä. Kiitokset seuraaville ihmisille:', support_on_patreon: 'Tue Patreonissa', donate_to_lemmy: 'Lahjoita Lemmylle', donate: 'Lahjoita', @@ -179,8 +179,8 @@ export const fi = { monero: 'Monero', code: 'Code', joined: 'Liittyi', - by: 'lahjoittajalta', - to: 'kohteelle', + by: 'käyttäjältä', + to: 'yhteisössä', from: 'paikasta', transfer_community: 'siirron yhteisö', transfer_site: 'siirron määrä', @@ -189,7 +189,7 @@ export const fi = { no: 'ei', powered_by: 'Vauhdittajana', landing_0: - "Lemmy on <1>linkinkerääjä / Reddit-vaihtoehto, tarkoitettu toimimaan <2>fediversessä.<3>Sitä voi isännöidä itse, siinä on automaattisesti päivittyvät kommenttiketjut, ja se on pieni (<4>~80kB). Federointi ActivityPub-verkkoon on suunnittelun alla. <5>Tämä on <6>hyvin varhainen betaversio, ja monet ominaisuudet ovat toistaiseksi rikki tai poissa. <7>Ehdota uusia ominaisuuksia tai raportoi bugeja <8>tänne.<9>Tehty teknologioilla <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.", + "Lemmy on <1>linkinkerääjä / Reddit-vaihtoehto, tarkoitettu toimimaan <2>fediversessä.<3>Sitä voi isännöidä itse, siinä on tosiaikaisesti päivittyvät kommenttiketjut, ja se on pieni (<4>~80 kilotavua). Federointi ActivityPub-verkkoon on suunnittelun alla. <5>Tämä on <6>hyvin varhainen betaversio, ja monet ominaisuudet ovat toistaiseksi rikki tai poissa. <7>Ehdota uusia ominaisuuksia tai raportoi bugeja <8>tänne.<9>Tehty teknologioilla <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.", not_logged_in: 'Ei kirjautunut sisään.', logged_in: 'Kirjautunut sisään.', community_ban: 'Sinulle on asetettu porttikielto tähän yhteisöön.', @@ -213,7 +213,7 @@ export const fi = { couldnt_get_posts: "Viestejä ei saatu", couldnt_update_post: "Viestiä ei voitu päivittää", couldnt_save_post: "Viestiä ei voitu tallentaa.", - no_slurs: 'Ei herjoja.', + no_slurs: 'Ei loukkauksia.', not_an_admin: 'Ei ole ylläpitäjä.', site_already_exists: 'Sivusto on jo olemassa.', couldnt_update_site: "Sivustoa ei voitu päivittää.", @@ -225,7 +225,7 @@ export const fi = { user_already_exists: 'Käyttäjä on jo olemassa.', email_already_exists: 'Sähköposti on jo olemassa.', couldnt_update_user: "Käyttäjää ei voitu päivittää.", - system_err_login: 'Järjestelmävirhe. Yritä kirjautua ulos ja takaisin sisään.', + system_err_login: 'Järjestelmävirhe. Yritä kirjautua ulos ja kirjautua uudestaan sisään.', couldnt_create_private_message: "Yksityisviestiä ei voitu luoda.", no_private_message_edit_allowed: 'Et ole sallittu muokkaamaan yksityisviestiä.', couldnt_update_private_message: "Yksityisviestiä ei voitu päivittää.", From 866df99c4f99e9e77f761c1fd74f5969f844021d Mon Sep 17 00:00:00 2001 From: D Anzorge Date: Mon, 27 Jan 2020 01:45:02 +0100 Subject: [PATCH 11/31] Use correct database env variable in docs see server/src/settings.rs --- docs/src/contributing_local_development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/contributing_local_development.md b/docs/src/contributing_local_development.md index a681eeb0..c19bcba8 100644 --- a/docs/src/contributing_local_development.md +++ b/docs/src/contributing_local_development.md @@ -9,7 +9,7 @@ ```bash psql -c "create user lemmy with password 'password' superuser;" -U postgres psql -c 'create database lemmy with owner lemmy;' -U postgres - export DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy + export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy ``` #### Running From 44b08ecc6179faa2a62afeae13af5a0a6a34d3da Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 26 Jan 2020 20:44:00 -0500 Subject: [PATCH 12/31] Fixing install.sh db export. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index bbed1c9b..168a1f6b 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -export DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy +export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy export JWT_SECRET=changeme export HOSTNAME=rrr From e7c90bee01ed93f21b5bf025ed1f4b5c767b5f48 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 27 Jan 2020 21:04:30 -0500 Subject: [PATCH 13/31] Strictly typing websocket forms. --- ui/src/components/community.tsx | 11 +++--- ui/src/components/inbox.tsx | 4 ++- ui/src/components/post.tsx | 6 +++- ui/src/interfaces.ts | 54 +++++++++++++++++++++++++++++ ui/src/services/WebSocketService.ts | 27 +++++++-------- 5 files changed, 81 insertions(+), 21 deletions(-) diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx index 221c9211..3c5f6890 100644 --- a/ui/src/components/community.tsx +++ b/ui/src/components/community.tsx @@ -11,6 +11,7 @@ import { SortType, Post, GetPostsForm, + GetCommunityForm, ListingType, GetPostsResponse, CreatePostLikeResponse, @@ -98,11 +99,11 @@ export class Community extends Component { () => console.log('complete') ); - if (this.state.communityId) { - WebSocketService.Instance.getCommunity(this.state.communityId); - } else if (this.state.communityName) { - WebSocketService.Instance.getCommunityByName(this.state.communityName); - } + let form: GetCommunityForm = { + id: this.state.communityId ? this.state.communityId : null, + name: this.state.communityName ? this.state.communityName : null, + }; + WebSocketService.Instance.getCommunity(form); } componentWillUnmount() { diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx index ba5cc6ad..41c1ce60 100644 --- a/ui/src/components/inbox.tsx +++ b/ui/src/components/inbox.tsx @@ -38,6 +38,8 @@ enum UnreadType { Messages, } +type ReplyType = Comment | PrivateMessageI; + interface InboxState { unreadOrAll: UnreadOrAll; unreadType: UnreadType; @@ -186,7 +188,7 @@ export class Inbox extends Component { } all() { - let combined: Array = []; + let combined: Array = []; combined.push(...this.state.replies); combined.push(...this.state.mentions); diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index f57d8913..9ea275ce 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -23,6 +23,7 @@ import { SearchType, SortType, SearchForm, + GetPostForm, SearchResponse, GetSiteResponse, GetCommunityResponse, @@ -84,7 +85,10 @@ export class Post extends Component { () => console.log('complete') ); - WebSocketService.Instance.getPost(postId); + let form: GetPostForm = { + id: postId, + }; + WebSocketService.Instance.getPost(form); } componentWillUnmount() { diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts index cd3961b5..b0594e8d 100644 --- a/ui/src/interfaces.ts +++ b/ui/src/interfaces.ts @@ -248,6 +248,10 @@ export interface FollowCommunityForm { auth?: string; } +export interface GetFollowedCommunitiesForm { + auth: string; +} + export interface GetFollowedCommunitiesResponse { communities: Array; } @@ -523,6 +527,12 @@ export interface CommunityForm { auth?: string; } +export interface GetCommunityForm { + id?: number; + name?: string; + auth?: string; +} + export interface GetCommunityResponse { community: Community; moderators: Array; @@ -572,6 +582,11 @@ export interface PostFormParams { community?: string; } +export interface GetPostForm { + id: number; + auth?: string; +} + export interface GetPostResponse { post: Post; comments: Array; @@ -759,6 +774,45 @@ export interface PrivateMessageResponse { message: PrivateMessage; } +export type MessageType = + | EditPrivateMessageForm + | LoginForm + | RegisterForm + | CommunityForm + | FollowCommunityForm + | ListCommunitiesForm + | GetFollowedCommunitiesForm + | PostForm + | GetPostForm + | GetPostsForm + | GetCommunityForm + | CommentForm + | CommentLikeForm + | SaveCommentForm + | CreatePostLikeForm + | BanFromCommunityForm + | AddAdminForm + | AddModToCommunityForm + | TransferCommunityForm + | TransferSiteForm + | SaveCommentForm + | BanUserForm + | AddAdminForm + | GetUserDetailsForm + | GetRepliesForm + | GetUserMentionsForm + | EditUserMentionForm + | GetModlogForm + | SiteForm + | SearchForm + | UserSettingsForm + | DeleteAccountForm + | PasswordResetForm + | PasswordChangeForm + | PrivateMessageForm + | EditPrivateMessageForm + | GetPrivateMessagesForm; + type ResponseType = | SiteResponse | GetFollowedCommunitiesResponse diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts index e72a2871..9f09e56a 100644 --- a/ui/src/services/WebSocketService.ts +++ b/ui/src/services/WebSocketService.ts @@ -9,9 +9,12 @@ import { CommentForm, SaveCommentForm, CommentLikeForm, + GetPostForm, GetPostsForm, CreatePostLikeForm, + GetCommunityForm, FollowCommunityForm, + GetFollowedCommunitiesForm, GetUserDetailsForm, ListCommunitiesForm, GetModlogForm, @@ -35,6 +38,7 @@ import { PrivateMessageForm, EditPrivateMessageForm, GetPrivateMessagesForm, + MessageType, } from '../interfaces'; import { webSocket } from 'rxjs/webSocket'; import { Subject } from 'rxjs'; @@ -108,9 +112,9 @@ export class WebSocketService { } public getFollowedCommunities() { - let data = { auth: UserService.Instance.auth }; + let form: GetFollowedCommunitiesForm = { auth: UserService.Instance.auth }; this.subject.next( - this.wsSendWrapper(UserOperation.GetFollowedCommunities, data) + this.wsSendWrapper(UserOperation.GetFollowedCommunities, form) ); } @@ -125,19 +129,14 @@ export class WebSocketService { this.subject.next(this.wsSendWrapper(UserOperation.CreatePost, postForm)); } - public getPost(postId: number) { - let data = { id: postId, auth: UserService.Instance.auth }; - this.subject.next(this.wsSendWrapper(UserOperation.GetPost, data)); + public getPost(form: GetPostForm) { + this.setAuth(form); + this.subject.next(this.wsSendWrapper(UserOperation.GetPost, form)); } - public getCommunity(communityId: number) { - let data = { id: communityId, auth: UserService.Instance.auth }; - this.subject.next(this.wsSendWrapper(UserOperation.GetCommunity, data)); - } - - public getCommunityByName(name: string) { - let data = { name: name, auth: UserService.Instance.auth }; - this.subject.next(this.wsSendWrapper(UserOperation.GetCommunity, data)); + public getCommunity(form: GetCommunityForm) { + this.setAuth(form); + this.subject.next(this.wsSendWrapper(UserOperation.GetCommunity, form)); } public createComment(commentForm: CommentForm) { @@ -310,7 +309,7 @@ export class WebSocketService { ); } - private wsSendWrapper(op: UserOperation, data: any) { + private wsSendWrapper(op: UserOperation, data: MessageType) { let send = { op: UserOperation[op], data: data }; console.log(send); return send; From beb55a471f2dfbebe79cf2f79d8582bc04929a8d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 27 Jan 2020 21:59:38 -0500 Subject: [PATCH 14/31] Allow pasting images into comment boxes and post url box. Fixes #472 --- ui/src/components/comment-form.tsx | 18 ++++++++++++++++-- ui/src/components/post-form.tsx | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index e4543d66..7eb30f50 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -96,6 +96,7 @@ export class CommentForm extends Component { className={`form-control ${this.state.previewMode && 'd-none'}`} value={this.state.commentForm.content} onInput={linkEvent(this, this.handleCommentContentChange)} + onPaste={linkEvent(this, this.handleImageUploadPaste)} required disabled={this.props.disabled} rows={2} @@ -208,9 +209,22 @@ export class CommentForm extends Component { i.props.onReplyCancel(); } + handleImageUploadPaste(i: CommentForm, event: any) { + let image = event.clipboardData.files[0]; + if (image) { + i.handleImageUpload(i, image); + } + } + handleImageUpload(i: CommentForm, event: any) { - event.preventDefault(); - let file = event.target.files[0]; + let file: any; + if (event.target) { + event.preventDefault(); + file = event.target.files[0]; + } else { + file = event; + } + const imageUploadUrl = `/pictshare/api/upload.php`; const formData = new FormData(); formData.append('file', file); diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index ebc7d7b7..57d9a964 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -160,6 +160,7 @@ export class PostForm extends Component { class="form-control" value={this.state.postForm.url} onInput={linkEvent(this, this.handlePostUrlChange)} + onPaste={linkEvent(this, this.handleImageUploadPaste)} /> {this.state.suggestedTitle && (
{ i.setState(i.state); } + handleImageUploadPaste(i: PostForm, event: any) { + let image = event.clipboardData.files[0]; + if (image) { + i.handleImageUpload(i, image); + } + } + handleImageUpload(i: PostForm, event: any) { - event.preventDefault(); - let file = event.target.files[0]; + let file: any; + if (event.target) { + event.preventDefault(); + file = event.target.files[0]; + } else { + file = event; + } + const imageUploadUrl = `/pictshare/api/upload.php`; const formData = new FormData(); formData.append('file', file); From d639f85a304c5645010884cf546ba67727cdf789 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 27 Jan 2020 22:02:53 -0500 Subject: [PATCH 15/31] Version v0.6.6 --- docker/prod/docker-compose.yml | 2 +- server/src/version.rs | 2 +- ui/src/version.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 3d4cd949..209009ff 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -11,7 +11,7 @@ services: - lemmy_db:/var/lib/postgresql/data restart: always lemmy: - image: dessalines/lemmy:v0.6.5 + image: dessalines/lemmy:v0.6.6 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/server/src/version.rs b/server/src/version.rs index f2428229..5b449621 100644 --- a/server/src/version.rs +++ b/server/src/version.rs @@ -1 +1 @@ -pub const VERSION: &str = "v0.6.5"; +pub const VERSION: &str = "v0.6.6"; diff --git a/ui/src/version.ts b/ui/src/version.ts index 2e0add0f..caa012eb 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.6.5'; +export const version: string = 'v0.6.6'; From 9431f93e5f3e30da3a0e1aab99b667a8e5873409 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 28 Jan 2020 08:47:37 -0500 Subject: [PATCH 16/31] Add not throwing error on auth check for getPost and getCommunity. Fixes #475 --- ui/src/services/WebSocketService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts index 9f09e56a..83e9ef1e 100644 --- a/ui/src/services/WebSocketService.ts +++ b/ui/src/services/WebSocketService.ts @@ -130,12 +130,12 @@ export class WebSocketService { } public getPost(form: GetPostForm) { - this.setAuth(form); + this.setAuth(form, false); this.subject.next(this.wsSendWrapper(UserOperation.GetPost, form)); } public getCommunity(form: GetCommunityForm) { - this.setAuth(form); + this.setAuth(form, false); this.subject.next(this.wsSendWrapper(UserOperation.GetCommunity, form)); } From 628d6729c13a1693705e5b3e3b8476465f22dc78 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 28 Jan 2020 08:50:58 -0500 Subject: [PATCH 17/31] Version v0.6.7 --- docker/prod/docker-compose.yml | 2 +- server/src/version.rs | 2 +- ui/src/version.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 209009ff..646627bd 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -11,7 +11,7 @@ services: - lemmy_db:/var/lib/postgresql/data restart: always lemmy: - image: dessalines/lemmy:v0.6.6 + image: dessalines/lemmy:v0.6.7 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/server/src/version.rs b/server/src/version.rs index 5b449621..c6b30c76 100644 --- a/server/src/version.rs +++ b/server/src/version.rs @@ -1 +1 @@ -pub const VERSION: &str = "v0.6.6"; +pub const VERSION: &str = "v0.6.7"; diff --git a/ui/src/version.ts b/ui/src/version.ts index caa012eb..549688c7 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.6.6'; +export const version: string = 'v0.6.7'; From a1a11e0ce7875155ca55be34ea109f1c36afb22a Mon Sep 17 00:00:00 2001 From: D Anzorge Date: Tue, 28 Jan 2020 19:52:28 +0100 Subject: [PATCH 18/31] Add sorting by old (date, ascending) to comment frontend --- ui/src/components/post.tsx | 19 +++++++++++++++++++ ui/src/interfaces.ts | 1 + ui/src/translations/en.ts | 1 + 3 files changed, 21 insertions(+) diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index 9ea275ce..36621248 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -235,6 +235,18 @@ export class Post extends Component { onChange={linkEvent(this, this.handleCommentSortChange)} /> +
); } @@ -317,6 +329,13 @@ export class Post extends Component { +a.comment.deleted - +b.comment.deleted || b.comment.published.localeCompare(a.comment.published) ); + } else if (this.state.commentSort == CommentSortType.Old) { + tree.sort( + (a, b) => + +a.comment.removed - +b.comment.removed || + +a.comment.deleted - +b.comment.deleted || + a.comment.published.localeCompare(b.comment.published) + ); } else if (this.state.commentSort == CommentSortType.Hot) { tree.sort( (a, b) => diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts index b0594e8d..f83595d7 100644 --- a/ui/src/interfaces.ts +++ b/ui/src/interfaces.ts @@ -47,6 +47,7 @@ export enum CommentSortType { Hot, Top, New, + Old, } export enum ListingType { diff --git a/ui/src/translations/en.ts b/ui/src/translations/en.ts index c932014f..90aff0b9 100644 --- a/ui/src/translations/en.ts +++ b/ui/src/translations/en.ts @@ -97,6 +97,7 @@ export const en = { sort_type: 'Sort type', hot: 'Hot', new: 'New', + old: 'Old', top_day: 'Top day', week: 'Week', month: 'Month', From 045f6e80d1c149a601e952948e489f3bc3f594af Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 28 Jan 2020 20:08:33 -0500 Subject: [PATCH 19/31] Adding yarn run ts-node to husky pre-commit. --- README.md | 22 +++++++++++----------- ui/package.json | 3 ++- ui/yarn.lock | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7b645c14..0e52f0d3 100644 --- a/README.md +++ b/README.md @@ -167,17 +167,17 @@ If you'd like to add translations, take a look a look at the [English translatio lang | done | missing ---- | ---- | ------- -ca | 100% | -de | 88% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -eo | 76% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -es | 100% | -fi | 100% | -fr | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -it | 84% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -nl | 93% | create_private_message,send_secure_message,send_message,message,message_sent,messages,matrix_user_id,private_message_disclaimer,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message -zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +ca | 100% | old +de | 87% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,old,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +eo | 75% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +es | 100% | old +fi | 100% | old +fr | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +it | 84% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +nl | 92% | create_private_message,send_secure_message,send_message,message,old,message_sent,messages,matrix_user_id,private_message_disclaimer,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message If you'd like to update this report, run: diff --git a/ui/package.json b/ui/package.json index d3085650..7e75052b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -49,6 +49,7 @@ "fuse-box": "^3.1.3", "lint-staged": "^10.0.2", "sortpack": "^2.0.1", + "ts-node": "^8.6.2", "ts-transform-classcat": "^0.0.2", "ts-transform-inferno": "^4.0.2", "typescript": "^3.7.5" @@ -59,7 +60,7 @@ "engineStrict": true, "husky": { "hooks": { - "pre-commit": "ts-node translation_report.ts && git add ../README.md && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && lint-staged" + "pre-commit": "yarn run ts-node translation_report.ts && git add ../README.md && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && lint-staged" } }, "lint-staged": { diff --git a/ui/yarn.lock b/ui/yarn.lock index 6c83dd88..4d09380b 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -382,6 +382,11 @@ app-root-path@^2.0.1: resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.2.1.tgz#d0df4a682ee408273583d43f6f79e9892624bc9a" integrity sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA== +arg@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" + integrity sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1036,6 +1041,11 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -2910,6 +2920,11 @@ loose-envify@^1.2.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +make-error@^1.1.1: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -4123,7 +4138,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@~0.5.12: +source-map-support@^0.5.6, source-map-support@~0.5.12: version "0.5.16" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== @@ -4477,6 +4492,17 @@ tributejs@^4.1.1: resolved "https://registry.yarnpkg.com/tributejs/-/tributejs-4.1.1.tgz#f169a4ad12e485241140ec1ab987b460950c974c" integrity sha512-jc+PcaiNzMjCn2LAQb3i4ic94EsSfLW8Jlk1sK2cb6hLcZFalU9ThcF8rxuKkTUKv1GIvTwN8XseLzCXLxB4lw== +ts-node@^8.6.2: + version "8.6.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.6.2.tgz#7419a01391a818fbafa6f826a33c1a13e9464e35" + integrity sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.6" + yn "3.1.1" + ts-transform-classcat@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/ts-transform-classcat/-/ts-transform-classcat-0.0.2.tgz#2386c9418f3a7c1f03261ff51225b70d0a7664fb" @@ -4769,3 +4795,8 @@ yaml@^1.7.2: integrity sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw== dependencies: "@babel/runtime" "^7.6.3" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From 0751ed0e3c6adc7d7a0fb8b712c913e4db91f882 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 28 Jan 2020 20:10:22 -0500 Subject: [PATCH 20/31] Fixing coffee cup offset. Fixes #479 --- ui/src/components/navbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index 18ba98c9..1828fce9 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -138,7 +138,7 @@ export class Navbar extends Component {
  • From 0d64f20b68c2d5e31e80d3831757e229b3c56e54 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 28 Jan 2020 22:07:17 -0500 Subject: [PATCH 21/31] Adding a materialized view for reply_view. Fixes #466 --- .../down.sql | 25 +++++++ .../up.sql | 27 ++++++++ .../down.sql | 1 + .../up.sql | 67 +++++++++++++++++++ .../query_testing/generate_explain_reports.sh | 9 +++ server/src/db/user_mention_view.rs | 37 ++++++++-- 6 files changed, 161 insertions(+), 5 deletions(-) create mode 100644 server/migrations/2020-01-29-011901_create_reply_materialized_view/down.sql create mode 100644 server/migrations/2020-01-29-011901_create_reply_materialized_view/up.sql create mode 100644 server/migrations/2020-01-29-030825_create_user_mention_materialized_view/down.sql create mode 100644 server/migrations/2020-01-29-030825_create_user_mention_materialized_view/up.sql diff --git a/server/migrations/2020-01-29-011901_create_reply_materialized_view/down.sql b/server/migrations/2020-01-29-011901_create_reply_materialized_view/down.sql new file mode 100644 index 00000000..06ec5971 --- /dev/null +++ b/server/migrations/2020-01-29-011901_create_reply_materialized_view/down.sql @@ -0,0 +1,25 @@ +-- Drop the materialized / built views +drop view reply_view; +create view reply_view as +with closereply as ( + select + c2.id, + c2.creator_id as sender_id, + c.creator_id as recipient_id + from comment c + inner join comment c2 on c.id = c2.parent_id + where c2.creator_id != c.creator_id + -- Do union where post is null + union + select + c.id, + c.creator_id as sender_id, + p.creator_id as recipient_id + from comment c, post p + where c.post_id = p.id and c.parent_id is null and c.creator_id != p.creator_id +) +select cv.*, +closereply.recipient_id +from comment_view cv, closereply +where closereply.id = cv.id +; diff --git a/server/migrations/2020-01-29-011901_create_reply_materialized_view/up.sql b/server/migrations/2020-01-29-011901_create_reply_materialized_view/up.sql new file mode 100644 index 00000000..ebbb1dff --- /dev/null +++ b/server/migrations/2020-01-29-011901_create_reply_materialized_view/up.sql @@ -0,0 +1,27 @@ +-- https://github.com/dessalines/lemmy/issues/197 +drop view reply_view; + +-- Do the reply_view referencing the comment_mview +create view reply_view as +with closereply as ( + select + c2.id, + c2.creator_id as sender_id, + c.creator_id as recipient_id + from comment c + inner join comment c2 on c.id = c2.parent_id + where c2.creator_id != c.creator_id + -- Do union where post is null + union + select + c.id, + c.creator_id as sender_id, + p.creator_id as recipient_id + from comment c, post p + where c.post_id = p.id and c.parent_id is null and c.creator_id != p.creator_id +) +select cv.*, +closereply.recipient_id +from comment_mview cv, closereply +where closereply.id = cv.id +; diff --git a/server/migrations/2020-01-29-030825_create_user_mention_materialized_view/down.sql b/server/migrations/2020-01-29-030825_create_user_mention_materialized_view/down.sql new file mode 100644 index 00000000..d93ebc2e --- /dev/null +++ b/server/migrations/2020-01-29-030825_create_user_mention_materialized_view/down.sql @@ -0,0 +1 @@ +drop view user_mention_mview; diff --git a/server/migrations/2020-01-29-030825_create_user_mention_materialized_view/up.sql b/server/migrations/2020-01-29-030825_create_user_mention_materialized_view/up.sql new file mode 100644 index 00000000..b0ae4e9d --- /dev/null +++ b/server/migrations/2020-01-29-030825_create_user_mention_materialized_view/up.sql @@ -0,0 +1,67 @@ +create view user_mention_mview as +with all_comment as +( + select + ca.* + from comment_aggregates_mview ca +) + +select + ac.id, + um.id as user_mention_id, + ac.creator_id, + ac.post_id, + ac.parent_id, + ac.content, + ac.removed, + um.read, + ac.published, + ac.updated, + ac.deleted, + ac.community_id, + ac.banned, + ac.banned_from_community, + ac.creator_name, + ac.creator_avatar, + ac.score, + ac.upvotes, + ac.downvotes, + u.id as user_id, + coalesce(cl.score, 0) as my_vote, + (select cs.id::bool from comment_saved cs where u.id = cs.user_id and cs.comment_id = ac.id) as saved, + um.recipient_id +from user_ u +cross join all_comment ac +left join comment_like cl on u.id = cl.user_id and ac.id = cl.comment_id +left join user_mention um on um.comment_id = ac.id + +union all + +select + ac.id, + um.id as user_mention_id, + ac.creator_id, + ac.post_id, + ac.parent_id, + ac.content, + ac.removed, + um.read, + ac.published, + ac.updated, + ac.deleted, + ac.community_id, + ac.banned, + ac.banned_from_community, + ac.creator_name, + ac.creator_avatar, + ac.score, + ac.upvotes, + ac.downvotes, + null as user_id, + null as my_vote, + null as saved, + um.recipient_id +from all_comment ac +left join user_mention um on um.comment_id = ac.id +; + diff --git a/server/query_testing/generate_explain_reports.sh b/server/query_testing/generate_explain_reports.sh index 9ba91036..994a9627 100755 --- a/server/query_testing/generate_explain_reports.sh +++ b/server/query_testing/generate_explain_reports.sh @@ -17,6 +17,15 @@ psql -qAt -U lemmy -f explain.sql > community_view.json echo "explain (analyze, format json) select * from site_view limit 1" > explain.sql psql -qAt -U lemmy -f explain.sql > site_view.json +echo "explain (analyze, format json) select * from reply_view where user_id = 34 and recipient_id = 34" > explain.sql +psql -qAt -U lemmy -f explain.sql > reply_view.json + +echo "explain (analyze, format json) select * from user_mention_view where user_id = 34 and recipient_id = 34" > explain.sql +psql -qAt -U lemmy -f explain.sql > user_mention_view.json + +echo "explain (analyze, format json) select * from user_mention_mview where user_id = 34 and recipient_id = 34" > explain.sql +psql -qAt -U lemmy -f explain.sql > user_mention_mview.json + grep "Execution Time" *.json rm explain.sql diff --git a/server/src/db/user_mention_view.rs b/server/src/db/user_mention_view.rs index 7a45d222..1cf43984 100644 --- a/server/src/db/user_mention_view.rs +++ b/server/src/db/user_mention_view.rs @@ -1,4 +1,3 @@ -use super::user_mention_view::user_mention_view::BoxedQuery; use super::*; use diesel::pg::Pg; @@ -31,6 +30,34 @@ table! { } } +table! { + user_mention_mview (id) { + id -> Int4, + user_mention_id -> Int4, + creator_id -> Int4, + post_id -> Int4, + parent_id -> Nullable, + content -> Text, + removed -> Bool, + read -> Bool, + published -> Timestamp, + updated -> Nullable, + deleted -> Bool, + community_id -> Int4, + banned -> Bool, + banned_from_community -> Bool, + creator_name -> Varchar, + creator_avatar -> Nullable, + score -> BigInt, + upvotes -> BigInt, + downvotes -> BigInt, + user_id -> Nullable, + my_vote -> Nullable, + saved -> Nullable, + recipient_id -> Int4, + } +} + #[derive( Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize, QueryableByName, Clone, )] @@ -63,7 +90,7 @@ pub struct UserMentionView { pub struct UserMentionQueryBuilder<'a> { conn: &'a PgConnection, - query: BoxedQuery<'a, Pg>, + query: super::user_mention_view::user_mention_mview::BoxedQuery<'a, Pg>, for_user_id: i32, sort: &'a SortType, unread_only: bool, @@ -73,9 +100,9 @@ pub struct UserMentionQueryBuilder<'a> { impl<'a> UserMentionQueryBuilder<'a> { pub fn create(conn: &'a PgConnection, for_user_id: i32) -> Self { - use super::user_mention_view::user_mention_view::dsl::*; + use super::user_mention_view::user_mention_mview::dsl::*; - let query = user_mention_view.into_boxed(); + let query = user_mention_mview.into_boxed(); UserMentionQueryBuilder { conn, @@ -109,7 +136,7 @@ impl<'a> UserMentionQueryBuilder<'a> { } pub fn list(self) -> Result, Error> { - use super::user_mention_view::user_mention_view::dsl::*; + use super::user_mention_view::user_mention_mview::dsl::*; let mut query = self.query; From c09ea38af66e3f3ced9f4872b887258329bb96d0 Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Tue, 28 Jan 2020 21:55:37 -0800 Subject: [PATCH 22/31] Add minor German translations --- ui/src/translations/de.ts | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/ui/src/translations/de.ts b/ui/src/translations/de.ts index 1ecaadaf..8dcf6a85 100644 --- a/ui/src/translations/de.ts +++ b/ui/src/translations/de.ts @@ -15,9 +15,9 @@ export const de = { remove_comment: 'Kommentar löschen', communities: 'Communities', users: 'Benutzer', - create_a_community: 'Eine community anlegen', - create_community: 'Community anlegen', - remove_community: 'Community entfernen', + create_a_community: 'Eine Gemeinschaft anlegen', + create_community: 'Gemeinschaft anlegen', + remove_community: 'Gemeinschaft entfernen', subscribed_to_communities: 'Abonnierte <1>communities', trending_communities: 'Trending <1>communities', list_of_communities: 'Liste von communities', @@ -36,15 +36,15 @@ export const de = { unsticky: 'nicht haftend', link: 'link', archive_link: 'Archiv-Link', - mod: 'mod', - mods: 'mods', + mod: 'Moderatorin', + mods: 'Moderatoren', moderates: 'Moderiert', settings: 'Einstellungen', remove_as_mod: 'Als mod entfernen', appoint_as_mod: 'Zum mod ernennen', modlog: 'Modlog', - admin: 'admin', - admins: 'admins', + admin: 'Administrator', + admins: 'Administratoren', remove_as_admin: 'Als admin entfernen', appoint_as_admin: 'Zum admin ernennen', remove: 'entfernen', @@ -66,10 +66,10 @@ export const de = { unban_from_site: 'Von der Seite entbannen', banned: 'gesperrt', save: 'speichern', - unsave: 'unsave', + unsave: 'nicht schonen', create: 'anlegen', creator: 'Ersteller', - username: 'Username', + username: 'Benutzername', email_or_username: 'Email oder Username', number_of_users: '{{count}} Benutzer', number_of_subscribers: '{{count}} Abonnenten', @@ -86,7 +86,7 @@ export const de = { subscribed: 'Abonniert', prev: 'Zurück', next: 'Weiter', - sidebar: 'Sidebar', + sidebar: 'Seitenleiste', sort_type: 'Sortieren nach', hot: 'Hot', new: 'Neu', @@ -122,22 +122,22 @@ export const de = { no_email_setup: "Dieser Server hat E-Mails nicht korrekt eingerichtet.", login: 'Einloggen', sign_up: 'Registrieren', - email: 'Email', - optional: 'Optional', + email: 'E-Mail', + optional: 'Fakultativ', expires: 'Ablaufdatum', language: 'Sprache', browser_default: 'Standard-Browser', url: 'URL', body: 'Text', copy_suggested_title: 'Vorgeschlagenen Titel übernehmen: {{title}}', - community: 'Community', - expand_here: 'Expand here', + community: 'Gemeinschaft', + expand_here: 'Erweitern hier', subscribe_to_communities: 'Abonniere ein paar <1>communities.', chat: 'Chat', recent_comments: 'Neueste Kommentare', no_results: 'Keine Ergebnisse.', - setup: 'Setup', - lemmy_instance_setup: 'Lemmy Instanz Setup', + setup: 'Einrichten', + lemmy_instance_setup: 'Lemmy Instanz Einrichten', setup_admin: 'Seiten Administrator konfigurieren', your_site: 'deine Seite', modified: 'verändert', @@ -151,7 +151,7 @@ export const de = { support_on_patreon: 'Auf Patreon unterstützen', general_sponsors: 'Allgemeine Sponsoren sind die, die zwischen $10 und $39 zu Lemmy beitragen.', - crypto: 'Crypto', + crypto: 'Kryptographie', bitcoin: 'Bitcoin', ethereum: 'Ethereum', monero: 'Monero', @@ -159,16 +159,16 @@ export const de = { joined: 'beigetreten', by: 'von', to: 'bis', - transfer_community: 'Transfer-Community', + transfer_community: 'übertragen-Gemeinschaft', transfer_site: 'Transferseite', are_you_sure: 'Bist du sicher?', yes: 'Ja', no: 'Nein', powered_by: 'Bereitgestellt durch', landing_0: - 'Lemmy ist ein <1>Link Aggregator / Reddit Alternative im <2>Fediverse.<3>Es ist selbst-hostbar, hat live-updates von Kommentar-threads und ist winzig (<4>~80kB). Federation in das ActivityPub Netzwerk ist geplant. <5>Dies ist eine <6>sehr frühe Beta Version, und viele Features funktionieren zurzeit nicht richtig oder fehlen. <7>Schlage neue Features vor oder melde Bugs <8>hier.<9>Gebaut mit <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', + 'Lemmy ist ein <1>Link-Aggregator / Reddit Alternative im <2>Fediverse.<3>Es ist selbst-hostbar, hat live-updates von Kommentar-threads und ist winzig (<4>~80kB). Federation in das ActivityPub Netzwerk ist geplant. <5>Dies ist eine <6>sehr frühe Beta Version, und viele Features funktionieren zurzeit nicht richtig oder fehlen. <7>Schlage neue Features vor oder melde Bugs <8>hier.<9>Gebaut mit <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', not_logged_in: 'Nicht eingeloggt.', - community_ban: 'Du wurdest von dieser Community gebannt.', + community_ban: 'Du wurdest von dieser Gemeinschaft gebannt.', site_ban: 'Du wurdest von dieser Seite gebannt', couldnt_create_comment: 'Konnte Kommentar nicht anlegen.', couldnt_like_comment: 'Konnte nicht liken.', @@ -176,14 +176,14 @@ export const de = { couldnt_save_comment: 'Konnte Kommentar nicht speichern.', no_comment_edit_allowed: 'Keine Erlaubnis Kommentar zu editieren.', no_post_edit_allowed: 'Keine Erlaubnis Beitrag zu editieren.', - no_community_edit_allowed: 'Keine Erlaubnis Community zu editieren.', - couldnt_find_community: 'Konnte Community nicht finden.', - couldnt_update_community: 'Konnte Community nicht aktualisieren.', - community_already_exists: 'Community existiert bereits.', + no_community_edit_allowed: 'Keine Erlaubnis Gemeinschaft zu editieren.', + couldnt_find_community: 'Konnte Gemeinschaft nicht finden.', + couldnt_update_community: 'Konnte Gemeinschaft nicht aktualisieren.', + community_already_exists: 'Gemeinschaft existiert bereits.', community_moderator_already_exists: - 'Community Moderator existiert bereits.', - community_follower_already_exists: 'Community Follower existiert bereits.', - community_user_already_banned: 'Community Nutzer schon gebannt.', + 'Gemeinschaft Moderator existiert bereits.', + community_follower_already_exists: 'Gemeinschaft Follower existiert bereits.', + community_user_already_banned: 'Gemeinschaft Nutzer schon gebannt.', couldnt_create_post: 'Konnte Beitrag nicht anlegen.', couldnt_like_post: 'Konnte Beitrag nicht liken.', couldnt_find_post: 'Konnte Beitrag nicht finden.', From 3e36fcff984c1f3c56dff91f3c46b574d4569baf Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Tue, 28 Jan 2020 22:06:37 -0800 Subject: [PATCH 23/31] Add minor Chinese translations --- ui/src/translations/zh.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ui/src/translations/zh.ts b/ui/src/translations/zh.ts index 7beaf83e..52fdfabf 100644 --- a/ui/src/translations/zh.ts +++ b/ui/src/translations/zh.ts @@ -25,14 +25,14 @@ export const zh = { unlock: '解锁', lock: '加锁', link: '链接', - mod: 'mod', - mods: 'mods', - moderates: 'Moderates', - remove_as_mod: 'remove as mod', - appoint_as_mod: 'appoint as mod', - modlog: 'Modlog', - admin: 'admin', - admins: 'admins', + mod: '监管人', + mods: '监管人', + moderates: '监管', + remove_as_mod: '添加监管人', + appoint_as_mod: '移除监管人', + modlog: '监管记录', + admin: '管理权限', + admins: '管理权限', remove_as_admin: '移除管理权限', appoint_as_admin: '添加管理权限', remove: '移除', @@ -77,7 +77,7 @@ export const zh = { year: '年', all: '所有', top: '最热', - api: 'API', + api: '应用程式介面', inbox: '收件箱', inbox_for: '<1>{{user}} 收件箱', mark_all_as_read: '标记所有已读', @@ -98,7 +98,7 @@ export const zh = { email: '邮箱', optional: '选项', expires: '过期', - url: 'URL', + url: '网址', body: '内容', copy_suggested_title: '复制建议的标题: {{title}}', community: '节点', @@ -111,11 +111,11 @@ export const zh = { setup_admin: '设置管理员', your_site: '你的站点', modified: '修改', - sponsors: 'Sponsors', - sponsors_of_lemmy: 'Sponsors of Lemmy', + sponsors: '发起人', + sponsors_of_lemmy: 'Lemmy 的发起人', sponsor_message: 'Lemmy is free, <1>open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project. Thank you to the following people:', - support_on_patreon: 'Support on Patreon', + support_on_patreon: '在 Patreon 赞助', general_sponsors: 'General Sponsors are those that pledged $10 to $39 to Lemmy.', crypto: '加密', @@ -139,8 +139,8 @@ export const zh = { couldnt_find_community: '不能找到节点.', couldnt_update_community: '不能更新节点.', community_already_exists: '节点已存在.', - community_moderator_already_exists: '节点 moderator 已存在.', - community_follower_already_exists: '节点 follower 已存在.', + community_moderator_already_exists: '节点监管人已存在.', + community_follower_already_exists: '节点追随者已存在.', community_user_already_banned: '节点用户已禁止.', couldnt_create_post: '不能创建帖子.', couldnt_like_post: '不能收藏帖子.', From 68496128c591ca8102f648a6422fdee66895c283 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Wed, 29 Jan 2020 20:37:59 +0430 Subject: [PATCH 24/31] Remove word repeattion --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e52f0d3..4cc00c13 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Lemmy is free, open-source software, meaning no advertising, monetizing, or vent ## Translations -If you'd like to add translations, take a look a look at the [English translation file](ui/src/translations/en.ts). +If you'd like to add translations, take a look at the [English translation file](ui/src/translations/en.ts). - Languages supported: Catalan, (`ca`), English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). From 2aab6f02e7c3e2ceb0d0b758d0bb0fb0f9502ea1 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Wed, 29 Jan 2020 21:25:34 +0430 Subject: [PATCH 25/31] initial Persian translation --- ui/src/translations/fa.ts | 219 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 ui/src/translations/fa.ts diff --git a/ui/src/translations/fa.ts b/ui/src/translations/fa.ts new file mode 100644 index 00000000..434f7b51 --- /dev/null +++ b/ui/src/translations/fa.ts @@ -0,0 +1,219 @@ +export const fa = { + translation: { + post: 'مطلب', + remove_post: 'حذف مطلب', + no_posts: 'بدون مطلب.', + create_a_post: 'ایجاد یک مطلب', + create_post: 'ایجاد مطلب', + number_of_posts: '{{count}} مطلب', + posts: 'مطالب', + related_posts: 'این مطالب ممکن است مرتبط باشند', + cross_posts: 'این پیوند در اینجا هم منتشر شده:', + cross_post: 'cross-post', + comments: 'نظرات', + number_of_comments: '{{count}} نظر', + remove_comment: 'حذف نظر', + communities: 'جوامع', + users: 'کاربران', + create_a_community: 'ایجاد یک جامعه جدید', + create_community: 'ایجاد جامعه', + remove_community: 'حذف جامعه', + subscribed_to_communities: 'Subscribed to <1>communities', + trending_communities: 'Trending <1>communities', + list_of_communities: 'فهرست جوامع', + number_of_communities: '{{count}} جامعه', + community_reqs: 'حروف کوچک, زیرخط, و بدون فاصله.', + edit: 'ویرایش', + reply: 'پاسخ', + cancel: 'لغو', + preview: 'پیش‌نمایش', + upload_image: 'بارگذاری تصویر', + avatar: 'آواتار', + upload_avatar: 'بارگذاری آواتار', + show_avatars: 'نمایش آواتارها', + formatting_help: 'راهنمای قالب‌بندی', + view_source: 'نمایش منبع', + unlock: 'بازکردن قفل', + lock: 'قفل کردن', + sticky: 'چسبان', + unsticky: 'غیرچسبان', + link: 'پیوند', + archive_link: 'بایگاهی پیوند', + mod: 'mod', + mods: 'mods', + moderates: 'Moderates', + settings: 'تنظیمات', + remove_as_mod: 'remove as mod', + appoint_as_mod: 'appoint as mod', + modlog: 'Modlog', + admin: 'مدیر', + admins: 'مدیران', + remove_as_admin: 'حذف به عنوان مدیر', + appoint_as_admin: 'انتصاب به عنوان مدیر', + remove: 'حذف', + removed: 'حذف شد', + locked: 'قفل شد', + stickied: 'stickied', + reason: 'دلیل', + mark_as_read: 'علامت‌گذاری به عنوان خوانده شده', + mark_as_unread: 'علامت‌گذاری به عنوان خوانده نشده', + delete: 'پاک کردن', + deleted: 'پاک شد', + delete_account: 'پاک کردن حساب', + delete_account_confirm: + 'هشدار: این کنش، تمام اطلاعات شما را برای همیشه پاک می‌کند. برای تایید، گذرواژه خود را وارد کنید.', + restore: 'بازگردانی', + ban: 'ban', + ban_from_site: 'ban from site', + unban: 'unban', + unban_from_site: 'unban from site', + banned: 'banned', + save: 'ذخیره', + unsave: 'عدم ذخیره', + create: 'ایجاد', + creator: 'سازنده', + username: 'نام‌کاربری', + email_or_username: 'رایانامه یا نام‌کاربری', + number_of_users: '{{count}} کاربر', + number_of_subscribers: '{{count}} Subscribers', + number_of_points: '{{count}} امتیاز', + number_online: '{{count}} کاربر برخط', + name: 'نام', + title: 'عنوان', + category: 'دسته‌بندی', + subscribers: 'Subscribers', + both: 'Both', + saved: 'Saved', + unsubscribe: 'Unsubscribe', + subscribe: 'Subscribe', + subscribed: 'Subscribed', + prev: 'پیش', + next: 'بعد', + sidebar: 'نوار کناری', + sort_type: 'نوع ترتیب', + hot: 'داغ', + new: 'تازه', + top_day: 'بهترین‌های روز', + week: 'هفته', + month: 'ماه', + year: 'سال', + all: 'همه', + top: 'بالاترین', + api: 'API', + docs: 'Docs', + inbox: 'Inbox', + inbox_for: 'Inbox for <1>{{user}}', + mark_all_as_read: 'علامت زدن همه به عنوان خوانده شده', + type: 'نوع', + unread: 'خوانده‌نشده', + replies: 'پاسخ‌ها', + mentions: 'اشاره‌ها', + reply_sent: 'پاسخ فرستاده شد', + search: 'جستجو', + overview: 'دید کلی', + view: 'نما', + logout: 'خروج', + login_sign_up: 'ورود / نام‌نویسی', + login: 'ورود', + sign_up: 'نام‌نویسی', + notifications_error: + 'Desktop notifications not available in your browser. Try Firefox or Chrome.', + unread_messages: 'پیام‌های خوانده نشده', + password: 'گذرواژه', + verify_password: 'تایید گذرواژه', + old_password: 'پسورد پیشین', + forgot_password: 'گذرواژه را فراموش کرده‌ام', + reset_password_mail_sent: 'رایانامه‌ای برای بازنشانی گذرواژه فرستاده شد.', + password_change: 'تغییر گذرواژه', + new_password: 'گذرواژه جدید', + no_email_setup: "This server hasn't correctly set up email.", + email: 'رایانامه', + send_notifications_to_email: 'فرستادن اعلانات به رایانامه', + optional: 'انتخابی', + expires: 'منقضی شود', + language: 'زبان', + browser_default: 'پیش‌فرض مرورگر', + downvotes_disabled: 'رای پایین غیرفعال است', + enable_downvotes: 'فعال‌سازی رای پایین', + open_registration: 'باز کردن نام‌نویسی', + registration_closed: 'نام‌نویسی بسته است', + enable_nsfw: 'فعال‌سازی NSFW', + url: 'URL', + body: 'Body', + copy_suggested_title: 'copy suggested title: {{title}}', + community: 'Community', + expand_here: 'Expand here', + subscribe_to_communities: 'Subscribe to some <1>communities.', + chat: 'گپ', + recent_comments: 'نظرات اخیر', + no_results: 'بدون نتیجه.', + setup: 'نصب', + lemmy_instance_setup: 'نصب نمونهٔ لمی', + setup_admin: 'نصب مدیریت پایگاه', + your_site: 'پایگاه شما', + modified: 'تغییر یافت', + nsfw: 'NSFW', + show_nsfw: 'نمایش محتوای NSFW', + theme: 'Theme', + sponsors: 'حامیان', + sponsors_of_lemmy: 'حامیان لمی', + sponsor_message: + 'Lemmy is free, <1>open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project. Thank you to the following people:', + support_on_patreon: 'حمایت روی Patreon', + donate_to_lemmy: 'اعطای اعانه به لمی', + donate: 'اعانه', + general_sponsors: + 'General Sponsors are those that pledged $10 to $39 to Lemmy.', + crypto: 'رمزارز', + bitcoin: 'بیت‌کوین', + ethereum: 'اتریوم', + monero: 'مونرو', + code: 'کد', + joined: 'Joined', + by: 'by', + to: 'to', + transfer_community: 'انتقال جامعه', + transfer_site: 'انتقال پایگاه', + are_you_sure: 'مطمئنید؟', + yes: 'بله', + no: 'خیر', + powered_by: 'نیرو گرفته از', + landing_0: + "Lemmy is a <1>link aggregator / reddit alternative, intended to work in the <2>fediverse.<3>It's self-hostable, has live-updating comment threads, and is tiny (<4>~80kB). Federation into the ActivityPub network is on the roadmap. <5>This is a <6>very early beta version, and a lot of features are currently broken or missing. <7>Suggest new features or report bugs <8>here.<9>Made with <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.", + not_logged_in: 'وارد نشده‌اید.', + community_ban: 'فعالیت شما در این جامعه ممنوع شده است.', + site_ban: 'فعالیت شما در این پایگاه ممنوع شده است', + couldnt_create_comment: "ناتوانی در ایجاد نظر.", + couldnt_like_comment: "ناتوانی در پسنیدن نظر.", + couldnt_update_comment: "ناتوانی در به‌روزرسانی نظر.", + couldnt_save_comment: "ناتوانی در ذخیره نظر.", + no_comment_edit_allowed: 'مجاز به ویرایش نظر نیستید.', + no_post_edit_allowed: 'مجاز به ویرایش مطلب نیستید.', + no_community_edit_allowed: 'مجاز به ویرایش جامعه نیستید.', + couldnt_find_community: "ناتوانی در یافتن جامعه.", + couldnt_update_community: "ناتوانی در به‌روزرسانی جامعه.", + community_already_exists: 'این جامعه از قبل وجود داشته است.', + community_moderator_already_exists: 'Community moderator already exists.', + community_follower_already_exists: 'Community follower already exists.', + community_user_already_banned: 'Community user already banned.', + couldnt_create_post: "ناتوانی در ایجاد مطلب.", + couldnt_like_post: "ناتوانی در پسندیدن مطلب.", + couldnt_find_post: "ناتوانی در یافتن مطلب.", + couldnt_get_posts: "ناتوانی در دریافت مطالب", + couldnt_update_post: "ناتوای در به‌روزرسانی مطلب", + couldnt_save_post: "ناتوانی در ذخیره مطلب.", + no_slurs: 'No slurs.', + not_an_admin: 'مدیر نیستید.', + site_already_exists: 'این پایگاه از قبل وجود داشته است.', + couldnt_update_site: "ناتوانی در به‌روزرسانی پایگاه.", + couldnt_find_that_username_or_email: + "ناتوانی در یافتن این نام کاربری یا رایانامه.", + password_incorrect: 'گذرواژه نادرست.', + passwords_dont_match: 'گذرواژه‌ها با هم منطبق نیستند.', + admin_already_created: "Sorry, there's already an admin.", + user_already_exists: 'این کاربر از قبل وجود دارد.', + email_already_exists: 'این رایانامه از قبل وجود دارد.', + couldnt_update_user: "ناتوانی در به‌روزرسانی کاربر.", + system_err_login: 'خطای سامانه. سعی کنید خارج شده و دوباره وارد شوید.', + }, +}; From ca9eaade7d5fe433d42114c9f79ed905a89f018f Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Wed, 29 Jan 2020 12:29:05 -0800 Subject: [PATCH 26/31] Fix minor German translations --- ui/src/translations/de.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/src/translations/de.ts b/ui/src/translations/de.ts index 8dcf6a85..1a6dee4c 100644 --- a/ui/src/translations/de.ts +++ b/ui/src/translations/de.ts @@ -36,17 +36,17 @@ export const de = { unsticky: 'nicht haftend', link: 'link', archive_link: 'Archiv-Link', - mod: 'Moderatorin', + mod: 'Moderator', mods: 'Moderatoren', moderates: 'Moderiert', settings: 'Einstellungen', - remove_as_mod: 'Als mod entfernen', - appoint_as_mod: 'Zum mod ernennen', + remove_as_mod: 'Als Moderator entfernen', + appoint_as_mod: 'Zum Moderator ernennen', modlog: 'Modlog', admin: 'Administrator', admins: 'Administratoren', - remove_as_admin: 'Als admin entfernen', - appoint_as_admin: 'Zum admin ernennen', + remove_as_admin: 'Als Administrator entfernen', + appoint_as_admin: 'Zum Administrator ernennen', remove: 'entfernen', removed: 'entfernt', locked: 'gesperrt', @@ -66,11 +66,11 @@ export const de = { unban_from_site: 'Von der Seite entbannen', banned: 'gesperrt', save: 'speichern', - unsave: 'nicht schonen', + unsave: 'rückgängig schonen', create: 'anlegen', creator: 'Ersteller', username: 'Benutzername', - email_or_username: 'Email oder Username', + email_or_username: 'E-mail oder Username', number_of_users: '{{count}} Benutzer', number_of_subscribers: '{{count}} Abonnenten', number_of_points: '{{count}} Punkte', @@ -123,7 +123,7 @@ export const de = { login: 'Einloggen', sign_up: 'Registrieren', email: 'E-Mail', - optional: 'Fakultativ', + optional: 'optional', expires: 'Ablaufdatum', language: 'Sprache', browser_default: 'Standard-Browser', @@ -131,7 +131,7 @@ export const de = { body: 'Text', copy_suggested_title: 'Vorgeschlagenen Titel übernehmen: {{title}}', community: 'Gemeinschaft', - expand_here: 'Erweitern hier', + expand_here: 'hier erweitern', subscribe_to_communities: 'Abonniere ein paar <1>communities.', chat: 'Chat', recent_comments: 'Neueste Kommentare', @@ -159,7 +159,7 @@ export const de = { joined: 'beigetreten', by: 'von', to: 'bis', - transfer_community: 'übertragen-Gemeinschaft', + transfer_community: 'Gemeinschaft übertragen', transfer_site: 'Transferseite', are_you_sure: 'Bist du sicher?', yes: 'Ja', From 5060542a01e02ae1021ee3615bc5c125288a014c Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Wed, 29 Jan 2020 12:57:40 -0800 Subject: [PATCH 27/31] Fix the German translation for "unsave" --- ui/src/translations/de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/translations/de.ts b/ui/src/translations/de.ts index 1a6dee4c..ec55394c 100644 --- a/ui/src/translations/de.ts +++ b/ui/src/translations/de.ts @@ -66,7 +66,7 @@ export const de = { unban_from_site: 'Von der Seite entbannen', banned: 'gesperrt', save: 'speichern', - unsave: 'rückgängig schonen', + unsave: 'rückgängig speichern', create: 'anlegen', creator: 'Ersteller', username: 'Benutzername', From e370475f50c89a41a2d976f77f56569efd5f35bb Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Wed, 29 Jan 2020 13:25:19 -0800 Subject: [PATCH 28/31] =?UTF-8?q?Use=20translation=20"r=C3=BCckg=C3=A4ngig?= =?UTF-8?q?=20machen=20speichern"=20for=20"unsave"=20in=20German.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/translations/de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/translations/de.ts b/ui/src/translations/de.ts index ec55394c..9b2b6fb1 100644 --- a/ui/src/translations/de.ts +++ b/ui/src/translations/de.ts @@ -66,7 +66,7 @@ export const de = { unban_from_site: 'Von der Seite entbannen', banned: 'gesperrt', save: 'speichern', - unsave: 'rückgängig speichern', + unsave: 'rückgängig machen speichern', create: 'anlegen', creator: 'Ersteller', username: 'Benutzername', From 213ed9b4b30789e353b66fe015d465a404955f61 Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Wed, 29 Jan 2020 15:57:32 -0800 Subject: [PATCH 29/31] Use "nicht speichern" for "unsave" in German. --- ui/src/translations/de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/translations/de.ts b/ui/src/translations/de.ts index 9b2b6fb1..30b53c79 100644 --- a/ui/src/translations/de.ts +++ b/ui/src/translations/de.ts @@ -66,7 +66,7 @@ export const de = { unban_from_site: 'Von der Seite entbannen', banned: 'gesperrt', save: 'speichern', - unsave: 'rückgängig machen speichern', + unsave: 'nicht speichern', create: 'anlegen', creator: 'Ersteller', username: 'Benutzername', From dd4f96673f13f252fc640999c508ee705144f0e8 Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Wed, 29 Jan 2020 16:30:48 -0800 Subject: [PATCH 30/31] =?UTF-8?q?Use=20"Kryptow=C3=A4hrung"=20for=20"crypt?= =?UTF-8?q?o"=20in=20German.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/translations/de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/translations/de.ts b/ui/src/translations/de.ts index 30b53c79..fafec579 100644 --- a/ui/src/translations/de.ts +++ b/ui/src/translations/de.ts @@ -151,7 +151,7 @@ export const de = { support_on_patreon: 'Auf Patreon unterstützen', general_sponsors: 'Allgemeine Sponsoren sind die, die zwischen $10 und $39 zu Lemmy beitragen.', - crypto: 'Kryptographie', + crypto: 'Kryptowährung', bitcoin: 'Bitcoin', ethereum: 'Ethereum', monero: 'Monero', From a313e7fb1b7ba40c366a0dda9da0febc8a973d03 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 29 Jan 2020 20:35:41 -0500 Subject: [PATCH 31/31] Removing english placeholders for Farsi. --- README.md | 3 +- ui/src/i18next.ts | 2 + ui/src/translations/fa.ts | 80 ++++++++------------------------------- ui/src/utils.ts | 4 ++ ui/translation_report.ts | 2 + 5 files changed, 25 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 0e52f0d3..e85171e0 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ Lemmy is free, open-source software, meaning no advertising, monetizing, or vent If you'd like to add translations, take a look a look at the [English translation file](ui/src/translations/en.ts). -- Languages supported: Catalan, (`ca`), English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). +- Languages supported: Catalan, (`ca`), Farsi (`fa`), English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). @@ -169,6 +169,7 @@ lang | done | missing ---- | ---- | ------- ca | 100% | old de | 87% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,old,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message +fa | 73% | cross_post,subscribed_to_communities,trending_communities,create_private_message,send_secure_message,send_message,message,mod,mods,moderates,remove_as_mod,appoint_as_mod,modlog,stickied,ban,ban_from_site,unban,unban_from_site,banned,number_of_subscribers,subscribers,both,saved,unsubscribe,subscribe,subscribed,old,api,docs,inbox,inbox_for,message_sent,notifications_error,messages,no_email_setup,matrix_user_id,private_message_disclaimer,url,body,copy_suggested_title,community,expand_here,subscribe_to_communities,theme,sponsor_message,general_sponsors,joined,by,to,from,landing_0,logged_in,community_moderator_already_exists,community_follower_already_exists,community_user_already_banned,no_slurs,admin_already_created,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message eo | 75% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message es | 100% | old fi | 100% | old diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index 51e7e3a3..0d3ab177 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -12,6 +12,7 @@ import { nl } from './translations/nl'; import { it } from './translations/it'; import { fi } from './translations/fi'; import { ca } from './translations/ca'; +import { fa } from './translations/fa'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -27,6 +28,7 @@ const resources = { it, fi, ca, + fa, }; function format(value: any, format: any, lng: any): any { diff --git a/ui/src/translations/fa.ts b/ui/src/translations/fa.ts index 434f7b51..c06045c6 100644 --- a/ui/src/translations/fa.ts +++ b/ui/src/translations/fa.ts @@ -9,7 +9,6 @@ export const fa = { posts: 'مطالب', related_posts: 'این مطالب ممکن است مرتبط باشند', cross_posts: 'این پیوند در اینجا هم منتشر شده:', - cross_post: 'cross-post', comments: 'نظرات', number_of_comments: '{{count}} نظر', remove_comment: 'حذف نظر', @@ -18,8 +17,6 @@ export const fa = { create_a_community: 'ایجاد یک جامعه جدید', create_community: 'ایجاد جامعه', remove_community: 'حذف جامعه', - subscribed_to_communities: 'Subscribed to <1>communities', - trending_communities: 'Trending <1>communities', list_of_communities: 'فهرست جوامع', number_of_communities: '{{count}} جامعه', community_reqs: 'حروف کوچک, زیرخط, و بدون فاصله.', @@ -39,13 +36,7 @@ export const fa = { unsticky: 'غیرچسبان', link: 'پیوند', archive_link: 'بایگاهی پیوند', - mod: 'mod', - mods: 'mods', - moderates: 'Moderates', settings: 'تنظیمات', - remove_as_mod: 'remove as mod', - appoint_as_mod: 'appoint as mod', - modlog: 'Modlog', admin: 'مدیر', admins: 'مدیران', remove_as_admin: 'حذف به عنوان مدیر', @@ -53,7 +44,6 @@ export const fa = { remove: 'حذف', removed: 'حذف شد', locked: 'قفل شد', - stickied: 'stickied', reason: 'دلیل', mark_as_read: 'علامت‌گذاری به عنوان خوانده شده', mark_as_unread: 'علامت‌گذاری به عنوان خوانده نشده', @@ -63,11 +53,6 @@ export const fa = { delete_account_confirm: 'هشدار: این کنش، تمام اطلاعات شما را برای همیشه پاک می‌کند. برای تایید، گذرواژه خود را وارد کنید.', restore: 'بازگردانی', - ban: 'ban', - ban_from_site: 'ban from site', - unban: 'unban', - unban_from_site: 'unban from site', - banned: 'banned', save: 'ذخیره', unsave: 'عدم ذخیره', create: 'ایجاد', @@ -75,18 +60,11 @@ export const fa = { username: 'نام‌کاربری', email_or_username: 'رایانامه یا نام‌کاربری', number_of_users: '{{count}} کاربر', - number_of_subscribers: '{{count}} Subscribers', number_of_points: '{{count}} امتیاز', number_online: '{{count}} کاربر برخط', name: 'نام', title: 'عنوان', category: 'دسته‌بندی', - subscribers: 'Subscribers', - both: 'Both', - saved: 'Saved', - unsubscribe: 'Unsubscribe', - subscribe: 'Subscribe', - subscribed: 'Subscribed', prev: 'پیش', next: 'بعد', sidebar: 'نوار کناری', @@ -99,10 +77,6 @@ export const fa = { year: 'سال', all: 'همه', top: 'بالاترین', - api: 'API', - docs: 'Docs', - inbox: 'Inbox', - inbox_for: 'Inbox for <1>{{user}}', mark_all_as_read: 'علامت زدن همه به عنوان خوانده شده', type: 'نوع', unread: 'خوانده‌نشده', @@ -116,8 +90,6 @@ export const fa = { login_sign_up: 'ورود / نام‌نویسی', login: 'ورود', sign_up: 'نام‌نویسی', - notifications_error: - 'Desktop notifications not available in your browser. Try Firefox or Chrome.', unread_messages: 'پیام‌های خوانده نشده', password: 'گذرواژه', verify_password: 'تایید گذرواژه', @@ -126,7 +98,6 @@ export const fa = { reset_password_mail_sent: 'رایانامه‌ای برای بازنشانی گذرواژه فرستاده شد.', password_change: 'تغییر گذرواژه', new_password: 'گذرواژه جدید', - no_email_setup: "This server hasn't correctly set up email.", email: 'رایانامه', send_notifications_to_email: 'فرستادن اعلانات به رایانامه', optional: 'انتخابی', @@ -138,12 +109,6 @@ export const fa = { open_registration: 'باز کردن نام‌نویسی', registration_closed: 'نام‌نویسی بسته است', enable_nsfw: 'فعال‌سازی NSFW', - url: 'URL', - body: 'Body', - copy_suggested_title: 'copy suggested title: {{title}}', - community: 'Community', - expand_here: 'Expand here', - subscribe_to_communities: 'Subscribe to some <1>communities.', chat: 'گپ', recent_comments: 'نظرات اخیر', no_results: 'بدون نتیجه.', @@ -154,66 +119,51 @@ export const fa = { modified: 'تغییر یافت', nsfw: 'NSFW', show_nsfw: 'نمایش محتوای NSFW', - theme: 'Theme', sponsors: 'حامیان', sponsors_of_lemmy: 'حامیان لمی', - sponsor_message: - 'Lemmy is free, <1>open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project. Thank you to the following people:', support_on_patreon: 'حمایت روی Patreon', donate_to_lemmy: 'اعطای اعانه به لمی', donate: 'اعانه', - general_sponsors: - 'General Sponsors are those that pledged $10 to $39 to Lemmy.', crypto: 'رمزارز', bitcoin: 'بیت‌کوین', ethereum: 'اتریوم', monero: 'مونرو', code: 'کد', - joined: 'Joined', - by: 'by', - to: 'to', transfer_community: 'انتقال جامعه', transfer_site: 'انتقال پایگاه', are_you_sure: 'مطمئنید؟', yes: 'بله', no: 'خیر', powered_by: 'نیرو گرفته از', - landing_0: - "Lemmy is a <1>link aggregator / reddit alternative, intended to work in the <2>fediverse.<3>It's self-hostable, has live-updating comment threads, and is tiny (<4>~80kB). Federation into the ActivityPub network is on the roadmap. <5>This is a <6>very early beta version, and a lot of features are currently broken or missing. <7>Suggest new features or report bugs <8>here.<9>Made with <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.", not_logged_in: 'وارد نشده‌اید.', community_ban: 'فعالیت شما در این جامعه ممنوع شده است.', site_ban: 'فعالیت شما در این پایگاه ممنوع شده است', - couldnt_create_comment: "ناتوانی در ایجاد نظر.", - couldnt_like_comment: "ناتوانی در پسنیدن نظر.", - couldnt_update_comment: "ناتوانی در به‌روزرسانی نظر.", - couldnt_save_comment: "ناتوانی در ذخیره نظر.", + couldnt_create_comment: 'ناتوانی در ایجاد نظر.', + couldnt_like_comment: 'ناتوانی در پسنیدن نظر.', + couldnt_update_comment: 'ناتوانی در به‌روزرسانی نظر.', + couldnt_save_comment: 'ناتوانی در ذخیره نظر.', no_comment_edit_allowed: 'مجاز به ویرایش نظر نیستید.', no_post_edit_allowed: 'مجاز به ویرایش مطلب نیستید.', no_community_edit_allowed: 'مجاز به ویرایش جامعه نیستید.', - couldnt_find_community: "ناتوانی در یافتن جامعه.", - couldnt_update_community: "ناتوانی در به‌روزرسانی جامعه.", + couldnt_find_community: 'ناتوانی در یافتن جامعه.', + couldnt_update_community: 'ناتوانی در به‌روزرسانی جامعه.', community_already_exists: 'این جامعه از قبل وجود داشته است.', - community_moderator_already_exists: 'Community moderator already exists.', - community_follower_already_exists: 'Community follower already exists.', - community_user_already_banned: 'Community user already banned.', - couldnt_create_post: "ناتوانی در ایجاد مطلب.", - couldnt_like_post: "ناتوانی در پسندیدن مطلب.", - couldnt_find_post: "ناتوانی در یافتن مطلب.", - couldnt_get_posts: "ناتوانی در دریافت مطالب", - couldnt_update_post: "ناتوای در به‌روزرسانی مطلب", - couldnt_save_post: "ناتوانی در ذخیره مطلب.", - no_slurs: 'No slurs.', + couldnt_create_post: 'ناتوانی در ایجاد مطلب.', + couldnt_like_post: 'ناتوانی در پسندیدن مطلب.', + couldnt_find_post: 'ناتوانی در یافتن مطلب.', + couldnt_get_posts: 'ناتوانی در دریافت مطالب', + couldnt_update_post: 'ناتوای در به‌روزرسانی مطلب', + couldnt_save_post: 'ناتوانی در ذخیره مطلب.', not_an_admin: 'مدیر نیستید.', site_already_exists: 'این پایگاه از قبل وجود داشته است.', - couldnt_update_site: "ناتوانی در به‌روزرسانی پایگاه.", + couldnt_update_site: 'ناتوانی در به‌روزرسانی پایگاه.', couldnt_find_that_username_or_email: - "ناتوانی در یافتن این نام کاربری یا رایانامه.", + 'ناتوانی در یافتن این نام کاربری یا رایانامه.', password_incorrect: 'گذرواژه نادرست.', passwords_dont_match: 'گذرواژه‌ها با هم منطبق نیستند.', - admin_already_created: "Sorry, there's already an admin.", user_already_exists: 'این کاربر از قبل وجود دارد.', email_already_exists: 'این رایانامه از قبل وجود دارد.', - couldnt_update_user: "ناتوانی در به‌روزرسانی کاربر.", + couldnt_update_user: 'ناتوانی در به‌روزرسانی کاربر.', system_err_login: 'خطای سامانه. سعی کنید خارج شده و دوباره وارد شوید.', }, }; diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 0aec7624..0ec29114 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -9,6 +9,7 @@ import 'moment/locale/nl'; import 'moment/locale/it'; import 'moment/locale/fi'; import 'moment/locale/ca'; +import 'moment/locale/fa'; import { UserOperation, @@ -258,6 +259,7 @@ export const languages = [ { code: 'eo', name: 'Esperanto' }, { code: 'es', name: 'Español' }, { code: 'de', name: 'Deutsch' }, + { code: 'fa', name: 'فارسی' }, { code: 'zh', name: '中文' }, { code: 'fi', name: 'Suomi' }, { code: 'fr', name: 'Français' }, @@ -306,6 +308,8 @@ export function getMomentLanguage(): string { lang = 'fi'; } else if (lang.startsWith('ca')) { lang = 'ca'; + } else if (lang.startsWith('fa')) { + lang = 'fa'; } else { lang = 'en'; } diff --git a/ui/translation_report.ts b/ui/translation_report.ts index 56c09c96..1956b792 100644 --- a/ui/translation_report.ts +++ b/ui/translation_report.ts @@ -2,6 +2,7 @@ import { en } from './src/translations/en'; import { eo } from './src/translations/eo'; import { es } from './src/translations/es'; import { de } from './src/translations/de'; +import { fa } from './src/translations/fa'; import { zh } from './src/translations/zh'; import { fr } from './src/translations/fr'; import { sv } from './src/translations/sv'; @@ -15,6 +16,7 @@ import fs from 'fs'; const files = [ { t: ca, n: 'ca' }, { t: de, n: 'de' }, + { t: fa, n: 'fa' }, { t: eo, n: 'eo' }, { t: es, n: 'es' }, { t: fi, n: 'fi' },