Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Finished the upgrade to lingui 5

Matt Roberts0d2a268352f2
diff --git a/lingui.config.js b/lingui.config.js
index 393b6bf1f..33711b96d 100644
--- a/lingui.config.js
+++ b/lingui.config.js
@@ -4,13 +4,14 @@ module.exports = {
catalogs: [
{
path: "<rootDir>/locale/{locale}/client",
- include: ["<rootDir>"],
+ include: ["<rootDir>/public/**/*.{ts,tsx}"],
},
],
+ orderBy: "messageId",
fallbackLocales: {
default: "en",
},
sourceLocale: "en",
- format: formatter({ style: "minimal" }),
+ format: formatter({ style: "minimal", explicitIdAsDefault: true, sort: true }),
locales: ["pt-BR", "es-ES", "nl", "sv-SE", "fr", "de", "en", "pl", "ru", "sk", "tr", "el"],
}
diff --git a/locale/de/client.json b/locale/de/client.json
index d7e268fcc..22418626d 100644
--- a/locale/de/client.json
+++ b/locale/de/client.json
@@ -12,6 +12,7 @@
"action.save": "Sichern",
"action.signin": "Anmelden",
"action.submit": "Absenden",
+ "d41FkJ": "",
"enum.poststatus.completed": "Erledigt",
"enum.poststatus.declined": "Abgelehnt",
"enum.poststatus.deleted": "Gelöscht",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Verboten",
"error.internalerror.text": "Ein Fehler ist aufgetreten und wir arbeiten daran, das Problem zu beheben! Wir werden in Kürze wieder online sein.",
"error.internalerror.title": "Oh! Nun, das kam unerwartet…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Vielleicht war der Link fehlerhaft oder die Seite existiert nicht mehr.",
"error.pagenotfound.title": "Die Seite wurde nicht gefunden",
"error.unauthorized.text": "Du bist nicht berechtigt diese Seite anzuschauen.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Diskussion",
"mysettings.notification.event.discussion.staff": "kommentare zu allen Beiträgen, es sei denn, sie werden individuell deabonniert",
"mysettings.notification.event.discussion.visitors": "Kommentare zu Beiträgen, die Sie abonniert haben",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Neuer Beitrag",
"mysettings.notification.event.newpost.staff": "neue Beiträge auf dieser Seite",
"mysettings.notification.event.newpost.visitors": "neue Beiträge auf dieser Seite",
diff --git a/locale/el/client.json b/locale/el/client.json
index a9984349a..24f9ed6f3 100644
--- a/locale/el/client.json
+++ b/locale/el/client.json
@@ -12,6 +12,7 @@
"action.save": "Αποθήκευση",
"action.signin": "Είσοδος",
"action.submit": "Υποβολή",
+ "d41FkJ": "",
"enum.poststatus.completed": "Ολοκληρωμένο",
"enum.poststatus.declined": "Απορρίφθηκε",
"enum.poststatus.deleted": "Διαγραμμένο",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Απαγορευμένο",
"error.internalerror.text": "Προέκυψε ένα σφάλμα και εργαζόμαστε για να διορθώσουμε το πρόβλημα! Θα είμαστε έτοιμοι να λειτουργήσουμε σύντομα.",
"error.internalerror.title": "Λοιπόν, αυτό είναι απροσδόκητο…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Ο σύνδεσμος που κάνατε κλικ μπορεί να είναι χαλασμένος ή η σελίδα μπορεί να έχει αφαιρεθεί.",
"error.pagenotfound.title": "Η σελίδα δεν βρέθηκε",
"error.unauthorized.text": "Δεν έχετε δικαίωμα πρόσβασης σε αυτή τη σελίδα.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Συζήτηση",
"mysettings.notification.event.discussion.staff": "σχόλια σε όλες τις δημοσιεύσεις εκτός αν διαγραφούν μεμονωμένα",
"mysettings.notification.event.discussion.visitors": "σχόλια σχετικά με δημοσιεύσεις στις οποίες έχετε εγγραφεί",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Νέα Δημοσίευση",
"mysettings.notification.event.newpost.staff": "νέες δημοσιεύσεις σε αυτήν την ιστοσελίδα",
"mysettings.notification.event.newpost.visitors": "νέες δημοσιεύσεις σε αυτήν την ιστοσελίδα",
diff --git a/locale/en/client.json b/locale/en/client.json
index 4fd1b1ec6..9e1255a77 100644
--- a/locale/en/client.json
+++ b/locale/en/client.json
@@ -12,6 +12,7 @@
"action.save": "Save",
"action.signin": "Sign in",
"action.submit": "Submit",
+ "d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"enum.poststatus.completed": "Completed",
"enum.poststatus.declined": "Declined",
"enum.poststatus.deleted": "Deleted",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Forbidden",
"error.internalerror.text": "An error has occurred and we're working to fix the problem! We’ll be up and running shortly.",
"error.internalerror.title": "Shoot! Well, this is unexpected…",
+ "error.notinvited.text": "We could not find an account for your email address.",
+ "error.notinvited.title": "Not Invited",
"error.pagenotfound.text": "The link you clicked may be broken or the page may have been removed.",
"error.pagenotfound.title": "Page not found",
"error.unauthorized.text": "You are not authorized to view this page.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Discussion",
"mysettings.notification.event.discussion.staff": "comments on all posts unless individually unsubscribed",
"mysettings.notification.event.discussion.visitors": "comments on posts you've subscribed to",
+ "mysettings.notification.event.mention": "Mentions",
"mysettings.notification.event.newpost": "New Post",
"mysettings.notification.event.newpost.staff": "new posts on this site",
"mysettings.notification.event.newpost.visitors": "new posts on this site",
diff --git a/locale/es-ES/client.json b/locale/es-ES/client.json
index a3d595c88..421618048 100644
--- a/locale/es-ES/client.json
+++ b/locale/es-ES/client.json
@@ -12,6 +12,7 @@
"action.save": "Guardar",
"action.signin": "Iniciar sesión",
"action.submit": "Enviar",
+ "d41FkJ": "",
"enum.poststatus.completed": "Completado",
"enum.poststatus.declined": "Rechazado",
"enum.poststatus.deleted": "Eliminado",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Prohibido",
"error.internalerror.text": "¡Ha ocurrido un error y estamos trabajando para solucionar el problema! Estaremos funcionando en breve.",
"error.internalerror.title": "¡Caracoles! Bueno, esto es inesperado…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "El hipervínculo que has seguido puede estar roto o quizás esta página ya no exista.",
"error.pagenotfound.title": "Página no encontrada",
"error.unauthorized.text": "No estás autorizado para ver esta página.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Discusión",
"mysettings.notification.event.discussion.staff": "comentarios en todas las publicaciones a menos que se cancele la suscripción individualmente",
"mysettings.notification.event.discussion.visitors": "comentarios en publicaciones a las que te has suscrito",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nueva Publicación",
"mysettings.notification.event.newpost.staff": "nuevas publicaciones en este sitio",
"mysettings.notification.event.newpost.visitors": "nuevas publicaciones en este sitio",
diff --git a/locale/fr/client.json b/locale/fr/client.json
index af64d6359..1a756caea 100644
--- a/locale/fr/client.json
+++ b/locale/fr/client.json
@@ -12,6 +12,7 @@
"action.save": "Enregistrer",
"action.signin": "Se connecter",
"action.submit": "Valider",
+ "d41FkJ": "",
"enum.poststatus.completed": "Terminé",
"enum.poststatus.declined": "Refusé",
"enum.poststatus.deleted": "Supprimé",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Interdit",
"error.internalerror.text": "Une erreur est survenue et nous travaillons à la résolution du problème ! Nous serons opérationnels sous peu.",
"error.internalerror.title": "Oops ! C'est inattendu…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Le lien que vous avez suivi est peut être brisé ou la page peut avoir été supprimée.",
"error.pagenotfound.title": "Page non trouvée",
"error.unauthorized.text": "Vous n'êtes pas autorisé à accéder à cette page.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Discussion",
"mysettings.notification.event.discussion.staff": "commentaires sur tous les messages sauf si désabonné individuellement",
"mysettings.notification.event.discussion.visitors": "commentaires sur les messages auxquels vous vous êtes abonné",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nouveau message",
"mysettings.notification.event.newpost.staff": "nouveaux messages sur ce site",
"mysettings.notification.event.newpost.visitors": "nouveaux messages sur ce site",
diff --git a/locale/nl/client.json b/locale/nl/client.json
index e881681b1..40595676c 100644
--- a/locale/nl/client.json
+++ b/locale/nl/client.json
@@ -12,6 +12,7 @@
"action.save": "Opslaan",
"action.signin": "Inloggen",
"action.submit": "Verzenden",
+ "d41FkJ": "",
"enum.poststatus.completed": "Voltooid",
"enum.poststatus.declined": "Afgewezen",
"enum.poststatus.deleted": "Verwijderd",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Verboden",
"error.internalerror.text": "Er is een fout opgetreden en we werken aan een oplossing! We zijn snel weer beschikbaar.",
"error.internalerror.title": "Ai! Nou, dit is onverwacht…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "De link waarop u heeft geklikt werkt niet of de pagina is mogelijk verwijderd.",
"error.pagenotfound.title": "Pagina niet gevonden",
"error.unauthorized.text": "Je bent niet gemachtigd om deze pagina te openen.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Discussie",
"mysettings.notification.event.discussion.staff": "reacties op alle berichten tenzij individueel uitgeschreven",
"mysettings.notification.event.discussion.visitors": "reacties op berichten waar je voor aangemeld bent",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nieuw Bericht",
"mysettings.notification.event.newpost.staff": "nieuwe berichten op deze site",
"mysettings.notification.event.newpost.visitors": "nieuwe berichten op deze site",
diff --git a/locale/pl/client.json b/locale/pl/client.json
index 5c5bc1c90..74bd32fa9 100644
--- a/locale/pl/client.json
+++ b/locale/pl/client.json
@@ -12,6 +12,7 @@
"action.save": "Zapisz",
"action.signin": "Zaloguj się",
"action.submit": "Prześlij",
+ "d41FkJ": "",
"enum.poststatus.completed": "Ukończone",
"enum.poststatus.declined": "Odrzucone",
"enum.poststatus.deleted": "Usunięte",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Zabroniony",
"error.internalerror.text": "Wystąpił błąd. Pracujemy nad jego rozwiązaniem. Wrócimy wkrótce.",
"error.internalerror.title": "Ups! Wystąpił niespodziewany błąd…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Link w który kliknąłeś wygasł lub strona została usunięta.",
"error.pagenotfound.title": "Nie odnaleziono strony",
"error.unauthorized.text": "Potwierdź swoją tożsamość aby wyświetlić tą stronę.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Dyskusja",
"mysettings.notification.event.discussion.staff": "komentarze do wszystkich postów, chyba że zostały indywidualnie odsubskrybowane",
"mysettings.notification.event.discussion.visitors": "komentarze postów które zasubskrybowałeś",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nowy post",
"mysettings.notification.event.newpost.staff": "nowe posty na tej stronie",
"mysettings.notification.event.newpost.visitors": "nowe posty na tej stronie",
diff --git a/locale/pt-BR/client.json b/locale/pt-BR/client.json
index a7439d8cf..e14f04ba6 100644
--- a/locale/pt-BR/client.json
+++ b/locale/pt-BR/client.json
@@ -12,6 +12,7 @@
"action.save": "Salvar",
"action.signin": "Iniciar sessão",
"action.submit": "Enviar",
+ "d41FkJ": "",
"enum.poststatus.completed": "Completado",
"enum.poststatus.declined": "Rejeitado",
"enum.poststatus.deleted": "Removido",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Proibido",
"error.internalerror.text": "Desculpe, algo deu errado. Estamos trabalhando nisso e vamos corrigi-lo o mais rápido possível.",
"error.internalerror.title": "Oops, isso não era esperado…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "O link que você acessou pode estar quebrado ou a página pode ter sido removida.",
"error.pagenotfound.title": "Página não encontrada",
"error.unauthorized.text": "Você não está autorizado a visualizar esta página.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Discussão",
"mysettings.notification.event.discussion.staff": "comentários em todas as postagens, a menos que individualmente desinscritas",
"mysettings.notification.event.discussion.visitors": "comentários em postagens que você se inscreveu",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nova postagem",
"mysettings.notification.event.newpost.staff": "novas postagens nesse site",
"mysettings.notification.event.newpost.visitors": "novas postagens nesse site",
diff --git a/locale/ru/client.json b/locale/ru/client.json
index a1cf12c62..62325c71e 100644
--- a/locale/ru/client.json
+++ b/locale/ru/client.json
@@ -12,6 +12,7 @@
"action.save": "Сохранить",
"action.signin": "Войти",
"action.submit": "Продолжить",
+ "d41FkJ": "",
"enum.poststatus.completed": "Выполнено",
"enum.poststatus.declined": "Отклонено",
"enum.poststatus.deleted": "Удалено",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Запрещено",
"error.internalerror.text": "Произошла ошибка, и мы уже работаем над её исправлением! В ближайшее время всё заработает.",
"error.internalerror.title": "Упс!",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Кажется, ссылка, по которой вы перешли, недействительна. Возможно, эта страница была удалена.",
"error.pagenotfound.title": "Страница не найдена",
"error.unauthorized.text": "Вы не можете просматривать эту страницу.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Обсуждения",
"mysettings.notification.event.discussion.staff": "комментариях всех постов, если вы не отпишитесь от них",
"mysettings.notification.event.discussion.visitors": "комментариях постов, на которые вы подписаны",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Новые посты",
"mysettings.notification.event.newpost.staff": "новых постах на этом сайте",
"mysettings.notification.event.newpost.visitors": "новых постах на этом сайте",
diff --git a/locale/sk/client.json b/locale/sk/client.json
index d60077174..e02435559 100644
--- a/locale/sk/client.json
+++ b/locale/sk/client.json
@@ -12,6 +12,7 @@
"action.save": "Uložiť",
"action.signin": "Prihlásiť sa",
"action.submit": "Potvrdiť",
+ "d41FkJ": "",
"enum.poststatus.completed": "Dokončené",
"enum.poststatus.declined": "Odmietnuté",
"enum.poststatus.deleted": "Vymazané",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Zakázané",
"error.internalerror.text": "Vyskytla sa chyba a pracujeme na odstránení problému! Čoskoro budeme v prevádzke.",
"error.internalerror.title": "Tak toto je nečakané…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Odkaz, na ktorý ste klikli, môže byť nefunkčný alebo bola stránka odstránená.",
"error.pagenotfound.title": "Stránka nenájdená",
"error.unauthorized.text": "Nemáte oprávnenie na zobrazenie tejto stránky.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Diskusia",
"mysettings.notification.event.discussion.staff": "komentáre k všetkým príspevkom, pokiaľ nie sú jednotlivo odhlásení",
"mysettings.notification.event.discussion.visitors": "komentáre k príspevkom, na ktorých odber ste sa prihlásili",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nový príspevok",
"mysettings.notification.event.newpost.staff": "nové príspevky na tomto webe",
"mysettings.notification.event.newpost.visitors": "nové príspevky na tomto webe",
diff --git a/locale/sv-SE/client.json b/locale/sv-SE/client.json
index 56ee466a3..5e7ff0286 100644
--- a/locale/sv-SE/client.json
+++ b/locale/sv-SE/client.json
@@ -12,6 +12,7 @@
"action.save": "Spara",
"action.signin": "Logga in",
"action.submit": "Skicka",
+ "d41FkJ": "",
"enum.poststatus.completed": "Avslutad",
"enum.poststatus.declined": "Nekad",
"enum.poststatus.deleted": "Borttagen",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Förbjuden",
"error.internalerror.text": "Ett fel har inträffat och vi arbetar för att åtgärda problemet! Vi kommer att vara igång igen inom kort.",
"error.internalerror.title": "Sjutton också! Detta här var oväntat…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Länken du klickade på kan vara trasig eller så kan sidan ha tagits bort.",
"error.pagenotfound.title": "Sidan kunde inte hittas",
"error.unauthorized.text": "Du har inte behörighet att se den här sidan.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Diskussion",
"mysettings.notification.event.discussion.staff": "kommentarer på alla inlägg om inte individuellt avanmält",
"mysettings.notification.event.discussion.visitors": "kommentarer på inlägg som du prenumererar på",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Nytt inlägg",
"mysettings.notification.event.newpost.staff": "nya inlägg på den här webbplatsen",
"mysettings.notification.event.newpost.visitors": "nya inlägg på den här webbplatsen",
diff --git a/locale/tr/client.json b/locale/tr/client.json
index 3d0083f41..959cd1394 100644
--- a/locale/tr/client.json
+++ b/locale/tr/client.json
@@ -12,6 +12,7 @@
"action.save": "Kaydet",
"action.signin": "Giriş Yap",
"action.submit": "Gönder",
+ "d41FkJ": "",
"enum.poststatus.completed": "Tamamlandı",
"enum.poststatus.declined": "Reddedildi",
"enum.poststatus.deleted": "Silindi",
@@ -25,6 +26,8 @@
"error.forbidden.title": "Yasaklı",
"error.internalerror.text": "Bir hata oluştu ama biz çözmek için üzerinde çalışıyoruz! Çok yakında tekrar hizmet vereceğiz.",
"error.internalerror.title": "Hay Allah! Bunu beklemiyorduk…",
+ "error.notinvited.text": "",
+ "error.notinvited.title": "",
"error.pagenotfound.text": "Tıkladığınız bağlantı bozuk veya sayfa kaldırılmış olabilir.",
"error.pagenotfound.title": "Sayfa bulunamadı",
"error.unauthorized.text": "Bu sayfayı görüntülemek için yetkiniz yok.",
@@ -112,6 +115,7 @@
"mysettings.notification.event.discussion": "Tartışma",
"mysettings.notification.event.discussion.staff": "teker teker iptal edilmedikçe tüm önerilerdeki yorumlar",
"mysettings.notification.event.discussion.visitors": "abone olduğunuz önerilerdeki yorumlar",
+ "mysettings.notification.event.mention": "",
"mysettings.notification.event.newpost": "Yeni Öneri",
"mysettings.notification.event.newpost.staff": "bu sayfaya ait yeni öneriler",
"mysettings.notification.event.newpost.visitors": "bu sayfaya ait yeni öneriler",
diff --git a/public/components/ShowPostStatus.tsx b/public/components/ShowPostStatus.tsx
index 60d73f247..b4a995368 100644
--- a/public/components/ShowPostStatus.tsx
+++ b/public/components/ShowPostStatus.tsx
@@ -2,7 +2,7 @@ import "./ShowPostStatus.scss"
import React from "react"
import { PostStatus } from "@fider/models"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
interface ShowPostStatusProps {
status: PostStatus
@@ -10,7 +10,7 @@ interface ShowPostStatusProps {
export const ShowPostStatus = (props: ShowPostStatusProps) => {
const id = `enum.poststatus.${props.status.value}`
- const title = t({ id: id, message: `${props.status.title}`, comment: "Title" })
+ const title = i18n._(id, {message: props.status.title })
return <span className={`c-status-label c-status-label--${props.status.value}`}>{title}</span>
}
diff --git a/public/pages/Error/NotInvited.page.tsx b/public/pages/Error/NotInvited.page.tsx
index a1a171068..55207d53a 100644
--- a/public/pages/Error/NotInvited.page.tsx
+++ b/public/pages/Error/NotInvited.page.tsx
@@ -6,10 +6,10 @@ const NotInvited = () => {
return (
<ErrorPageWrapper id="p-notinvited" showHomeLink={true}>
<h1 className="text-display">
- <Trans id="error.unauthorized.title">Not invited</Trans>
+ <Trans id="error.notinvited.title">Not Invited</Trans>
</h1>
<p>
- <Trans id="error.unauthorized.text">We could not find an account for your email address.</Trans>
+ <Trans id="error.notinvited.text">We could not find an account for your email address.</Trans>
</p>
</ErrorPageWrapper>
)
diff --git a/public/pages/Home/Home.page.tsx b/public/pages/Home/Home.page.tsx
index 8456ede2f..a8d245308 100644
--- a/public/pages/Home/Home.page.tsx
+++ b/public/pages/Home/Home.page.tsx
@@ -10,10 +10,9 @@ import { PostsContainer } from "./components/PostsContainer"
import { useFider } from "@fider/hooks"
import { VStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
export interface HomePageProps {
posts: Post[]
tags: Tag[]
@@ -49,15 +48,13 @@ const HomePage = (props: HomePageProps) => {
const fider = useFider()
const [title, setTitle] = useState("")
- const defaultWelcomeMessage = t({
- id: "home.form.defaultwelcomemessage",
+ const defaultWelcomeMessage = i18n._("home.form.defaultwelcomemessage", {
message: `We'd love to hear what you're thinking about.
What can we do better? This is the place for you to vote, discuss and share ideas.`,
})
- const defaultInvitation = t({
- id: "home.form.defaultinvitation",
+ const defaultInvitation = i18n._("home.form.defaultinvitation", {
message: "Enter your suggestion here...",
})
diff --git a/public/pages/Home/components/PostFilter.tsx b/public/pages/Home/components/PostFilter.tsx
index 9a1ae118e..be42f40d9 100644
--- a/public/pages/Home/components/PostFilter.tsx
+++ b/public/pages/Home/components/PostFilter.tsx
@@ -3,7 +3,7 @@ import { PostStatus } from "@fider/models"
import { Dropdown } from "@fider/components"
import { HStack } from "@fider/components/layout"
import { useFider } from "@fider/hooks"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
@@ -29,20 +29,20 @@ export const PostFilter = (props: PostFilterProps) => {
}
const options: OptionItem[] = [
- { value: "trending", label: t({ id: "home.postfilter.option.trending", message: "Trending" }) },
- { value: "recent", label: t({ id: "home.postfilter.option.recent", message: "Recent" }) },
- { value: "most-wanted", label: t({ id: "home.postfilter.option.mostwanted", message: "Most Wanted" }) },
- { value: "most-discussed", label: t({ id: "home.postfilter.option.mostdiscussed", message: "Most Discussed" }) },
+ { value: "trending", label: i18n._("home.postfilter.option.trending", {message: "Trending" }) },
+ { value: "recent", label: i18n._("home.postfilter.option.recent", {message: "Recent" }) },
+ { value: "most-wanted", label: i18n._("home.postfilter.option.mostwanted", {message: "Most Wanted" }) },
+ { value: "most-discussed", label: i18n._("home.postfilter.option.mostdiscussed", {message: "Most Discussed" }) },
]
if (fider.session.isAuthenticated) {
- options.push({ value: "my-votes", label: t({ id: "home.postfilter.option.myvotes", message: "My Votes" }) })
+ options.push({ value: "my-votes", label: i18n._("home.postfilter.option.myvotes", {message: "My Votes" }) })
}
PostStatus.All.filter((s) => s.filterable && props.countPerStatus[s.value]).forEach((s) => {
const id = `enum.poststatus.${s.value.toString()}`
options.push({
- label: t({ id, message: `${s.title}` }),
+ label: i18n._(id, {message: s.title }),
value: s.value,
count: props.countPerStatus[s.value],
})
diff --git a/public/pages/Home/components/PostInput.tsx b/public/pages/Home/components/PostInput.tsx
index 6c5f25aa9..b5b7a9313 100644
--- a/public/pages/Home/components/PostInput.tsx
+++ b/public/pages/Home/components/PostInput.tsx
@@ -4,10 +4,9 @@ import { SignInModal } from "@fider/components"
import { cache, actions, Failure } from "@fider/services"
import { ImageUpload } from "@fider/models"
import { useFider } from "@fider/hooks"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface PostInputProps {
placeholder: string
onTitleChanged: (title: string) => void
@@ -78,7 +77,7 @@ export const PostInput = (props: PostInputProps) => {
onChange={handleDescriptionChange}
value={description}
minRows={5}
- placeholder={t({ id: "home.postinput.description.placeholder", message: "Describe your suggestion (optional)" })}
+ placeholder={i18n._("home.postinput.description.placeholder", { message: "Describe your suggestion (optional)" })}
/>
<MultiImageUploader field="attachments" maxUploads={3} onChange={setAttachments} />
<Button type="submit" variant="primary" onClick={submit}>
diff --git a/public/pages/Home/components/PostsContainer.tsx b/public/pages/Home/components/PostsContainer.tsx
index 9d361cf32..9f2b4341f 100644
--- a/public/pages/Home/components/PostsContainer.tsx
+++ b/public/pages/Home/components/PostsContainer.tsx
@@ -10,10 +10,9 @@ import IconX from "@fider/assets/images/heroicons-x.svg"
import { PostFilter } from "./PostFilter"
import { ListPosts } from "./ListPosts"
import { TagsFilter } from "./TagsFilter"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface PostsContainerProps {
user?: CurrentUser
posts: Post[]
@@ -117,7 +116,7 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsCo
field="query"
icon={this.state.query ? IconX : IconSearch}
onIconClick={this.state.query ? this.clearSearch : undefined}
- placeholder={t({ id: "home.postscontainer.query.placeholder", message: "Search" })}
+ placeholder={i18n._("home.postscontainer.query.placeholder", { message: "Search" })}
value={this.state.query}
onChange={this.handleSearchFilterChanged}
/>
@@ -126,7 +125,7 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsCo
<ListPosts
posts={this.state.posts}
tags={this.props.tags}
- emptyText={t({ id: "home.postscontainer.label.noresults", message: "No results matched your search, try something different." })}
+ emptyText={i18n._("home.postscontainer.label.noresults", { message: "No results matched your search, try something different." })}
/>
{this.state.loading && <Loader />}
{showMoreLink && (
diff --git a/public/pages/Home/components/SimilarPosts.tsx b/public/pages/Home/components/SimilarPosts.tsx
index 49142e340..62e42572a 100644
--- a/public/pages/Home/components/SimilarPosts.tsx
+++ b/public/pages/Home/components/SimilarPosts.tsx
@@ -4,7 +4,7 @@ import { PageTitle, Loader } from "@fider/components"
import { ListPosts } from "./ListPosts"
import { actions } from "@fider/services"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
interface SimilarPostsProps {
title: string
@@ -58,8 +58,8 @@ export class SimilarPosts extends React.Component<SimilarPostsProps, SimilarPost
}
public render() {
- const title = t({ id: "home.similar.title", message: "Similar posts" })
- const subtitle = t({ id: "home.similar.subtitle", message: "Consider voting on existing posts instead." })
+ const title = i18n._("home.similar.title", { message: "Similar posts" })
+ const subtitle = i18n._("home.similar.subtitle", { message: "Consider voting on existing posts instead." })
return (
<>
diff --git a/public/pages/Home/components/TagsFilter.tsx b/public/pages/Home/components/TagsFilter.tsx
index 671f97f5e..2ecb1f9a3 100644
--- a/public/pages/Home/components/TagsFilter.tsx
+++ b/public/pages/Home/components/TagsFilter.tsx
@@ -4,9 +4,9 @@ import { Dropdown, Icon, ShowTag } from "@fider/components"
import IconCheck from "@fider/assets/images/heroicons-check.svg"
import { HStack } from "@fider/components/layout"
-import { t, plural } from "@lingui/core/macro"
+import { plural } from "@lingui/core/macro"
import { Trans } from "@lingui/react/macro"
-
+import { i18n } from "@lingui/core"
interface TagsFilterProps {
tags: Tag[]
@@ -31,7 +31,7 @@ export const TagsFilter = (props: TagsFilterProps) => {
one: `# tag`,
other: `# tags`,
})
- : t({ id: "home.tagsfilter.selected.none", message: "Any tag" })
+ : i18n._("home.tagsfilter.selected.none", {message: "Any tag" })
return (
<HStack>
diff --git a/public/pages/MyNotifications/MyNotifications.page.tsx b/public/pages/MyNotifications/MyNotifications.page.tsx
index 8377f2a04..88096026c 100644
--- a/public/pages/MyNotifications/MyNotifications.page.tsx
+++ b/public/pages/MyNotifications/MyNotifications.page.tsx
@@ -4,10 +4,9 @@ import { Notification } from "@fider/models"
import { Header, Markdown, Moment, PageTitle } from "@fider/components"
import { actions, Fider } from "@fider/services"
import { HStack, VStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface MyNotificationsPageProps {
notifications: Notification[]
}
@@ -65,8 +64,8 @@ export default class MyNotificationsPage extends React.Component<MyNotifications
<Header />
<div id="p-my-notifications" className="page container">
<PageTitle
- title={t({ id: "mynotifications.page.title", message: "Notifications" })}
- subtitle={t({ id: "mynotifications.page.subtitle", message: "Stay up to date with what's happening" })}
+ title={i18n._("mynotifications.page.title", { message: "Notifications" })}
+ subtitle={i18n._("mynotifications.page.subtitle", { message: "Stay up to date with what's happening" })}
/>
<HStack spacing={4} className="mt-8 mb-2">
diff --git a/public/pages/MySettings/MySettings.page.tsx b/public/pages/MySettings/MySettings.page.tsx
index a9a382317..b272de4c2 100644
--- a/public/pages/MySettings/MySettings.page.tsx
+++ b/public/pages/MySettings/MySettings.page.tsx
@@ -7,10 +7,9 @@ import { Failure, actions, Fider } from "@fider/services"
import { NotificationSettings } from "./components/NotificationSettings"
import { APIKeyForm } from "./components/APIKeyForm"
import { DangerZone } from "./components/DangerZone"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface MySettingsPageState {
showModal: boolean
name: string
@@ -136,14 +135,14 @@ export default class MySettingsPage extends React.Component<MySettingsPageProps,
</Modal.Window>
<PageTitle
- title={t({ id: "mysettings.page.title", message: "Settings" })}
- subtitle={t({ id: "mysettings.page.subtitle", message: "Manage your profile settings" })}
+ title={i18n._("mysettings.page.title", { message: "Settings" })}
+ subtitle={i18n._("mysettings.page.subtitle", { message: "Manage your profile settings" })}
/>
<div className="w-max-7xl">
<Form error={this.state.error}>
<Input
- label={t({ id: "label.email", message: "Email" })}
+ label={i18n._("label.email", { message: "Email" })}
field="email"
value={this.state.changingEmail ? this.state.newEmail : Fider.session.user.email}
maxLength={200}
@@ -170,16 +169,16 @@ export default class MySettingsPage extends React.Component<MySettingsPageProps,
)}
</Input>
- <Input label={t({ id: "label.name", message: "Name" })} field="name" value={this.state.name} maxLength={100} onChange={this.setName} />
+ <Input label={i18n._("label.name", { message: "Name" })} field="name" value={this.state.name} maxLength={100} onChange={this.setName} />
<Select
- label={t({ id: "label.avatar", message: "Avatar" })}
+ label={i18n._("label.avatar", { message: "Avatar" })}
field="avatarType"
defaultValue={this.state.avatarType}
options={[
- { label: t({ id: "label.letter", message: "Letter" }), value: UserAvatarType.Letter },
- { label: t({ id: "label.gravatar", message: "Gravatar" }), value: UserAvatarType.Gravatar },
- { label: t({ id: "label.custom", message: "Custom" }), value: UserAvatarType.Custom },
+ { label: i18n._("label.letter", { message: "Letter" }), value: UserAvatarType.Letter },
+ { label: i18n._("label.gravatar", { message: "Gravatar" }), value: UserAvatarType.Gravatar },
+ { label: i18n._("label.custom", { message: "Custom" }), value: UserAvatarType.Custom },
]}
onChange={this.avatarTypeChanged}
>
diff --git a/public/pages/MySettings/components/NotificationSettings.tsx b/public/pages/MySettings/components/NotificationSettings.tsx
index f54edca61..c31c9c2c6 100644
--- a/public/pages/MySettings/components/NotificationSettings.tsx
+++ b/public/pages/MySettings/components/NotificationSettings.tsx
@@ -3,10 +3,9 @@ import React, { useState } from "react"
import { UserSettings } from "@fider/models"
import { Toggle, Field } from "@fider/components"
import { HStack, VStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface NotificationSettingsProps {
userSettings: UserSettings
settingsChanged: (settings: UserSettings) => void
@@ -35,8 +34,8 @@ export const NotificationSettings = (props: NotificationSettingsProps) => {
props.settingsChanged(nextSettings)
}
- const labelWeb = t({ id: "mysettings.notification.channelweb", message: "Web" })
- const labelEmail = t({ id: "mysettings.notification.channelemail", message: "Email" })
+ const labelWeb = i18n._("mysettings.notification.channelweb", { message: "Web" })
+ const labelEmail = i18n._("mysettings.notification.channelemail", { message: "Email" })
const icon = (settingsKey: string, channel: Channel) => {
const active = isEnabled(settingsKey, channel)
@@ -45,10 +44,9 @@ export const NotificationSettings = (props: NotificationSettingsProps) => {
return <Toggle key={`${settingsKey}_${channel}`} active={active} label={label} onToggle={onToggle} />
}
-
return (
<>
- <Field label={t({ id: "label.notifications", message: "Notifications" })}>
+ <Field label={i18n._("label.notifications", { message: "Notifications" })}>
<p className="text-muted mb-6">
<Trans id="mysettings.notification.title">Choose the events to recieve a notification for.</Trans>
</p>
diff --git a/public/pages/ShowPost/components/CommentInput.tsx b/public/pages/ShowPost/components/CommentInput.tsx
index d20c8e2f3..a7c6b3195 100644
--- a/public/pages/ShowPost/components/CommentInput.tsx
+++ b/public/pages/ShowPost/components/CommentInput.tsx
@@ -6,10 +6,9 @@ import { SignInModal } from "@fider/components"
import { cache, actions, Failure, Fider } from "@fider/services"
import { HStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
import { CommentEditor } from "@fider/components"
import { useFider } from "@fider/hooks"
@@ -78,7 +77,7 @@ export const CommentInput = (props: CommentInputProps) => {
onChange={commentChanged}
onFocus={editorFocused}
disabled={!Fider.session.isAuthenticated}
- placeholder={t({ id: "showpost.commentinput.placeholder", message: "Leave a comment" })}
+ placeholder={i18n._("showpost.commentinput.placeholder", { message: "Leave a comment" })}
/>
{hasContent && (
<>
diff --git a/public/pages/ShowPost/components/ModerationPanel.tsx b/public/pages/ShowPost/components/ModerationPanel.tsx
index 4b0a06758..c0775ba96 100644
--- a/public/pages/ShowPost/components/ModerationPanel.tsx
+++ b/public/pages/ShowPost/components/ModerationPanel.tsx
@@ -4,10 +4,9 @@ import { actions, navigator, Failure } from "@fider/services"
import { Form, Modal, Button, TextArea } from "@fider/components"
import { useFider } from "@fider/hooks"
import { VStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface ModerationPanelProps {
post: Post
}
@@ -44,7 +43,7 @@ export const ModerationPanel = (props: ModerationPanelProps) => {
field="text"
onChange={setText}
value={text}
- placeholder={t({ id: "showpost.moderationpanel.text.placeholder", message: "Why are you deleting this post? (optional)" })}
+ placeholder={i18n._("showpost.moderationpanel.text.placeholder", { message: "Why are you deleting this post? (optional)" })}
>
<span className="text-muted">
<Trans id="showpost.moderationpanel.text.help">
diff --git a/public/pages/ShowPost/components/PostSearch.tsx b/public/pages/ShowPost/components/PostSearch.tsx
index 91fa56280..00509ef9a 100644
--- a/public/pages/ShowPost/components/PostSearch.tsx
+++ b/public/pages/ShowPost/components/PostSearch.tsx
@@ -4,10 +4,9 @@ import { Input, ShowPostStatus } from "@fider/components"
import { actions } from "@fider/services"
import { Post, PostStatus } from "@fider/models"
import { HStack, VStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface PostSearchProps {
exclude?: number[]
onChanged(postNumber: number): void
@@ -48,7 +47,7 @@ export const PostSearch = (props: PostSearchProps) => {
<Input
field="query"
icon={IconSearch}
- placeholder={t({ id: "showpost.postsearch.query.placeholder", message: "Search original post..." })}
+ placeholder={i18n._("showpost.postsearch.query.placeholder", { message: "Search original post..." })}
value={query}
onChange={setQuery}
/>
diff --git a/public/pages/ShowPost/components/ResponseForm.tsx b/public/pages/ShowPost/components/ResponseForm.tsx
index 97cdd2f78..abad95ee4 100644
--- a/public/pages/ShowPost/components/ResponseForm.tsx
+++ b/public/pages/ShowPost/components/ResponseForm.tsx
@@ -6,8 +6,8 @@ import { Post, PostStatus } from "@fider/models"
import { actions, Failure, Fider } from "@fider/services"
import { PostSearch } from "./PostSearch"
import IconSpeakerPhone from "@fider/assets/images/heroicons-speakerphone.svg"
-import { t } from "@lingui/core/macro"
import { Trans } from "@lingui/react/macro"
+import { i18n } from "@lingui/core"
interface ResponseFormProps {
post: Post
@@ -80,7 +80,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
const id = `enum.poststatus.${s.value.toString()}`
return {
value: s.value.toString(),
- label: t({ id, message: `${s.title}` }),
+ label: i18n._(id, { message: s.title }),
}
})
@@ -105,8 +105,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
onChange={this.setText}
value={this.state.text}
minRows={5}
- placeholder={t({
- id: "showpost.responseform.text.placeholder",
+ placeholder={i18n._("showpost.responseform.text.placeholder", {
message: "What's going on with this post? Let your users know what are your plans...",
})}
/>
diff --git a/public/pages/ShowPost/components/VotesModal.tsx b/public/pages/ShowPost/components/VotesModal.tsx
index 9d5e916d1..0944ea1d7 100644
--- a/public/pages/ShowPost/components/VotesModal.tsx
+++ b/public/pages/ShowPost/components/VotesModal.tsx
@@ -6,10 +6,9 @@ import { useFider } from "@fider/hooks"
import IconSearch from "@fider/assets/images/heroicons-search.svg"
import IconX from "@fider/assets/images/heroicons-x.svg"
import { HStack, VStack } from "@fider/components/layout"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
-
interface VotesModalProps {
isOpen: boolean
post: Post
@@ -62,7 +61,7 @@ export const VotesModal: React.FC<VotesModalProps> = (props) => {
field="query"
icon={query ? IconX : IconSearch}
onIconClick={query ? clearSearch : undefined}
- placeholder={t({ id: "modal.showvotes.query.placeholder", message: "Search for users by name..." })}
+ placeholder={i18n._("modal.showvotes.query.placeholder", { message: "Search for users by name..." })}
value={query}
onChange={handleSearchFilterChanged}
/>
diff --git a/public/pages/SignIn/CompleteSignInProfile.page.tsx b/public/pages/SignIn/CompleteSignInProfile.page.tsx
index 14e1f0d5b..db91e830a 100644
--- a/public/pages/SignIn/CompleteSignInProfile.page.tsx
+++ b/public/pages/SignIn/CompleteSignInProfile.page.tsx
@@ -2,7 +2,7 @@ import React, { useState } from "react"
import { Button, Form, Input, LegalFooter, TenantLogo } from "@fider/components"
import { actions, Failure } from "@fider/services"
-import { t } from "@lingui/core/macro"
+import { i18n } from "@lingui/core"
import { Trans } from "@lingui/react/macro"
import { EmailVerificationKind } from "@fider/models"
@@ -47,7 +47,7 @@ const CompleteSignInProfilePage = (props: CompleteSignInProfilePageProps) => {
field="name"
onChange={setName}
maxLength={100}
- placeholder={t({ id: "modal.completeprofile.name.placeholder", message: "Name" })}
+ placeholder={i18n._("modal.completeprofile.name.placeholder", { message: "Name" })}
suffix={
<Button type="submit" onClick={submit} variant="primary" disabled={name === ""}>
<Trans id="action.submit">Submit</Trans>