From f1889aec071e2d99532c757f021d90d804b63ad5 Mon Sep 17 00:00:00 2001 From: shibao Date: Thu, 17 Nov 2022 22:30:01 -0500 Subject: [PATCH] ee cummings this shit --- lib/memex_web/components/invite_card.ex | 4 +- lib/memex_web/components/topbar.ex | 16 +++---- lib/memex_web/components/user_card.ex | 7 ++- .../user_registration_controller.ex | 2 +- .../controllers/user_session_controller.ex | 2 +- .../live/context_live/form_component.ex | 4 +- lib/memex_web/live/context_live/index.ex | 6 +-- .../live/context_live/index.html.heex | 12 ++--- lib/memex_web/live/context_live/show.ex | 4 +- .../live/context_live/show.html.heex | 4 +- lib/memex_web/live/home_live.html.heex | 48 +++++++++---------- lib/memex_web/live/invite_live/index.ex | 6 +-- .../live/invite_live/index.html.heex | 24 +++++----- .../live/note_live/form_component.ex | 4 +- lib/memex_web/live/note_live/index.ex | 9 ++-- lib/memex_web/live/note_live/show.ex | 4 +- .../live/pipeline_live/form_component.ex | 4 +- lib/memex_web/live/pipeline_live/index.ex | 6 +-- .../live/pipeline_live/index.html.heex | 12 ++--- lib/memex_web/live/pipeline_live/show.ex | 4 +- .../live/pipeline_live/show.html.heex | 4 +- .../templates/user_confirmation/new.html.heex | 4 +- .../templates/user_registration/new.html.heex | 6 +-- .../user_reset_password/edit.html.heex | 6 +-- .../user_reset_password/new.html.heex | 4 +- .../templates/user_session/new.html.heex | 6 +-- .../templates/user_settings/edit.html.heex | 36 +++++++------- .../controllers/home_controller_test.exs | 2 +- .../user_registration_controller_test.exs | 6 +-- .../user_session_controller_test.exs | 6 +-- .../user_settings_controller_test.exs | 4 +- test/memex_web/live/context_live_test.exs | 26 +++++----- test/memex_web/live/invite_live_test.exs | 8 ++-- test/memex_web/live/note_live_test.exs | 23 +++++---- test/memex_web/live/page_live_test.exs | 4 +- test/memex_web/live/pipeline_live_test.exs | 26 +++++----- 36 files changed, 177 insertions(+), 176 deletions(-) diff --git a/lib/memex_web/components/invite_card.ex b/lib/memex_web/components/invite_card.ex index 0ae9950..2ff2e3e 100644 --- a/lib/memex_web/components/invite_card.ex +++ b/lib/memex_web/components/invite_card.ex @@ -18,11 +18,11 @@ defmodule MemexWeb.Components.InviteCard do <%= if @invite.disabled_at |> is_nil() do %>

<%= gettext("Uses Left:") %> - <%= @invite.uses_left || "Unlimited" %> + <%= @invite.uses_left || gettext("unlimited") %>

<% else %>

- <%= gettext("Invite Disabled") %> + <%= gettext("invite disabled") %>

<% end %> diff --git a/lib/memex_web/components/topbar.ex b/lib/memex_web/components/topbar.ex index bc4d57f..679bead 100644 --- a/lib/memex_web/components/topbar.ex +++ b/lib/memex_web/components/topbar.ex @@ -41,7 +41,7 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.note_index_path(Endpoint, :index)} class="text-primary-400 text-primary-400 hover:underline truncate" > - <%= gettext("Notes") %> + <%= gettext("notes") %> @@ -50,7 +50,7 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.context_index_path(Endpoint, :index)} class="text-primary-400 text-primary-400 hover:underline truncate" > - <%= gettext("Contexts") %> + <%= gettext("contexts") %> @@ -59,11 +59,11 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.pipeline_index_path(Endpoint, :index)} class="text-primary-400 text-primary-400 hover:underline truncate" > - <%= gettext("Pipelines") %> + <%= gettext("pipelines") %> -
  • +
  • <%= if @current_user.role == :admin do %>
  • @@ -71,7 +71,7 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.invite_index_path(Endpoint, :index)} class="text-primary-400 text-primary-400 hover:underline" > - <%= gettext("Invites") %> + <%= gettext("invites") %>
  • <% end %> @@ -89,7 +89,7 @@ defmodule MemexWeb.Components.Topbar do <.link href={Routes.user_session_path(Endpoint, :delete)} method="delete" - data-confirm={dgettext("prompts", "Are you sure you want to log out?")} + data-confirm={dgettext("prompts", "are you sure you want to log out?")} > @@ -112,7 +112,7 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.user_registration_path(Endpoint, :new)} class="text-primary-400 text-primary-400 hover:underline truncate" > - <%= dgettext("actions", "Register") %> + <%= dgettext("actions", "register") %> <% end %> @@ -122,7 +122,7 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.user_session_path(Endpoint, :new)} class="text-primary-400 text-primary-400 hover:underline truncate" > - <%= dgettext("actions", "Log in") %> + <%= dgettext("actions", "log in") %> <% end %> diff --git a/lib/memex_web/components/user_card.ex b/lib/memex_web/components/user_card.ex index 33664cc..f1de4c6 100644 --- a/lib/memex_web/components/user_card.ex +++ b/lib/memex_web/components/user_card.ex @@ -20,9 +20,12 @@ defmodule MemexWeb.Components.UserCard do

    <%= if @user.confirmed_at |> is_nil() do %> - Email unconfirmed + <%= gettext("email unconfirmed") %> <% else %> - User was confirmed at <%= @user.confirmed_at |> display_datetime() %> + <%= gettext( + "user was confirmed at %{relative_datetime}", + relative_datetime: @user.confirmed_at |> display_datetime() + ) %> <% end %>

    diff --git a/lib/memex_web/controllers/user_registration_controller.ex b/lib/memex_web/controllers/user_registration_controller.ex index a0e5694..7f6a379 100644 --- a/lib/memex_web/controllers/user_registration_controller.ex +++ b/lib/memex_web/controllers/user_registration_controller.ex @@ -32,7 +32,7 @@ defmodule MemexWeb.UserRegistrationController do render(conn, "new.html", changeset: Accounts.change_user_registration(%User{}), invite: invite, - page_title: gettext("Register") + page_title: gettext("register") ) end diff --git a/lib/memex_web/controllers/user_session_controller.ex b/lib/memex_web/controllers/user_session_controller.ex index 0706a69..b677e68 100644 --- a/lib/memex_web/controllers/user_session_controller.ex +++ b/lib/memex_web/controllers/user_session_controller.ex @@ -5,7 +5,7 @@ defmodule MemexWeb.UserSessionController do alias MemexWeb.UserAuth def new(conn, _params) do - render(conn, "new.html", error_message: nil, page_title: gettext("Log in")) + render(conn, "new.html", error_message: nil, page_title: gettext("log in")) end def create(conn, %{"user" => user_params}) do diff --git a/lib/memex_web/live/context_live/form_component.ex b/lib/memex_web/live/context_live/form_component.ex index 9875062..b8fc686 100644 --- a/lib/memex_web/live/context_live/form_component.ex +++ b/lib/memex_web/live/context_live/form_component.ex @@ -32,7 +32,7 @@ defmodule MemexWeb.ContextLive.FormComponent do {:ok, _context} -> {:noreply, socket - |> put_flash(:info, "Context updated successfully") + |> put_flash(:info, "context updated successfully") |> push_navigate(to: socket.assigns.return_to)} {:error, %Ecto.Changeset{} = changeset} -> @@ -45,7 +45,7 @@ defmodule MemexWeb.ContextLive.FormComponent do {:ok, _context} -> {:noreply, socket - |> put_flash(:info, "Context created successfully") + |> put_flash(:info, "context created successfully") |> push_navigate(to: socket.assigns.return_to)} {:error, %Ecto.Changeset{} = changeset} -> diff --git a/lib/memex_web/live/context_live/index.ex b/lib/memex_web/live/context_live/index.ex index 0c5f843..de1fa0d 100644 --- a/lib/memex_web/live/context_live/index.ex +++ b/lib/memex_web/live/context_live/index.ex @@ -16,19 +16,19 @@ defmodule MemexWeb.ContextLive.Index do defp apply_action(socket, :edit, %{"id" => id}) do socket - |> assign(:page_title, "Edit Context") + |> assign(:page_title, "edit context") |> assign(:context, Contexts.get_context!(id)) end defp apply_action(socket, :new, _params) do socket - |> assign(:page_title, "New Context") + |> assign(:page_title, "new context") |> assign(:context, %Context{}) end defp apply_action(socket, :index, _params) do socket - |> assign(:page_title, "Listing Contexts") + |> assign(:page_title, "listing contexts") |> assign(:context, nil) end diff --git a/lib/memex_web/live/context_live/index.html.heex b/lib/memex_web/live/context_live/index.html.heex index 6adb12f..3e8a1cf 100644 --- a/lib/memex_web/live/context_live/index.html.heex +++ b/lib/memex_web/live/context_live/index.html.heex @@ -1,4 +1,4 @@ -

    Listing Contexts

    +

    listing contexts

    <%= if @live_action in [:new, :edit] do %> <.modal return_to={Routes.context_index_path(@socket, :index)}> @@ -35,12 +35,12 @@ <.link navigate={Routes.context_show_path(@socket, :show, context)}> - <%= dgettext("actions", "Show") %> + <%= dgettext("actions", "show") %> <.link patch={Routes.context_index_path(@socket, :edit, context)}> - <%= dgettext("actions", "Edit") %> + <%= dgettext("actions", "edit") %> @@ -48,9 +48,9 @@ href="#" phx-click="delete" phx-value-id={context.id} - data-confirm={dgettext("prompts", "Are you sure?")} + data-confirm={dgettext("prompts", "are you sure?")} > - <%= dgettext("actions", "Delete") %> + <%= dgettext("actions", "delete") %> @@ -61,6 +61,6 @@ <.link patch={Routes.context_index_path(@socket, :new)}> - <%= dgettext("actions", "New Context") %> + <%= dgettext("actions", "new context") %> diff --git a/lib/memex_web/live/context_live/show.ex b/lib/memex_web/live/context_live/show.ex index 079f00e..6f77a96 100644 --- a/lib/memex_web/live/context_live/show.ex +++ b/lib/memex_web/live/context_live/show.ex @@ -16,6 +16,6 @@ defmodule MemexWeb.ContextLive.Show do |> assign(:context, Contexts.get_context!(id))} end - defp page_title(:show), do: "Show Context" - defp page_title(:edit), do: "Edit Context" + defp page_title(:show), do: "show context" + defp page_title(:edit), do: "edit context" end diff --git a/lib/memex_web/live/context_live/show.html.heex b/lib/memex_web/live/context_live/show.html.heex index dfc9614..510618b 100644 --- a/lib/memex_web/live/context_live/show.html.heex +++ b/lib/memex_web/live/context_live/show.html.heex @@ -1,4 +1,4 @@ -

    Show Context

    +

    show context

    <%= if @live_action in [:edit] do %> <.modal return_to={Routes.context_show_path(@socket, :show, @context)}> @@ -37,7 +37,7 @@ <.link patch={Routes.context_show_path(@socket, :edit, @context)} class="button"> - <%= dgettext("actions", "Edit") %> + <%= dgettext("actions", "edit") %> | diff --git a/lib/memex_web/live/home_live.html.heex b/lib/memex_web/live/home_live.html.heex index 66780ce..8628b60 100644 --- a/lib/memex_web/live/home_live.html.heex +++ b/lib/memex_web/live/home_live.html.heex @@ -9,30 +9,30 @@
  • - <%= gettext("Notes:") %> + <%= gettext("notes:") %>

    - <%= gettext("Document notes about individual items or concepts") %> + <%= gettext("document notes about individual items or concepts") %>

  • - <%= gettext("Contexts:") %> + <%= gettext("contexts:") %>

    - <%= gettext("Provide context around a single topic and hotlink to your notes") %> + <%= gettext("provide context around a single topic and hotlink to your notes") %>

  • - <%= gettext("Pipelines:") %> + <%= gettext("pipelines:") %>

    - <%= gettext("Document your processes, attaching contexts to each step") %> + <%= gettext("document your processes, attaching contexts to each step") %>

  • @@ -41,36 +41,36 @@ @@ -79,12 +79,12 @@