update gettext schema and use macros for cannery app
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
shibao 2024-10-26 15:36:12 -04:00
parent ab3d3721d6
commit 668e4c611b
45 changed files with 289 additions and 311 deletions

View File

@ -6,4 +6,34 @@ defmodule Cannery do
Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others.
"""
def context do
quote do
use Gettext, backend: CanneryWeb.Gettext
import Ecto.Query
alias Cannery.Accounts.User
alias Cannery.Repo
alias Ecto.{Changeset, Multi, Queryable, UUID}
end
end
def schema do
quote do
use Ecto.Schema
use Gettext, backend: CanneryWeb.Gettext
import Ecto.{Changeset, Query}
alias Cannery.Accounts.User
alias Ecto.{Association, Changeset, Queryable, UUID}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
end
end
@doc """
When used, dispatch to the appropriate context/schema/etc.
"""
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
end

View File

@ -3,10 +3,9 @@ defmodule Cannery.Accounts do
The Accounts context.
"""
import Ecto.Query, warn: false
alias Cannery.{Mailer, Repo}
alias Cannery.Accounts.{Invite, Invites, User, UserToken}
alias Ecto.{Changeset, Multi}
use Cannery, :context
alias Cannery.Mailer
alias Cannery.Accounts.{Invite, Invites, UserToken}
alias Oban.Job
## Database getters

View File

@ -5,13 +5,8 @@ defmodule Cannery.Accounts.Invite do
`:uses_left` is defined.
"""
use Ecto.Schema
import Ecto.Changeset
alias Cannery.Accounts.User
alias Ecto.{Association, Changeset, UUID}
use Cannery, :schema
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "invites" do
field :name, :string
field :token, :string

View File

@ -3,10 +3,8 @@ defmodule Cannery.Accounts.Invites do
The Invites context.
"""
import Ecto.Query, warn: false
alias Ecto.Multi
alias Cannery.Accounts.{Invite, User}
alias Cannery.Repo
use Cannery, :context
alias Cannery.Accounts.Invite
@invite_token_length 20

View File

@ -3,11 +3,8 @@ defmodule Cannery.Accounts.User do
A Cannery user
"""
use Ecto.Schema
import Ecto.Changeset
import CanneryWeb.Gettext
alias Ecto.{Association, Changeset, UUID}
alias Cannery.Accounts.{Invite, User}
use Cannery, :schema
alias Cannery.Accounts.Invite
@derive {Jason.Encoder,
only: [
@ -20,8 +17,6 @@ defmodule Cannery.Accounts.User do
:updated_at
]}
@derive {Inspect, except: [:password]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "users" do
field :email, :string
field :password, :string, virtual: true

View File

@ -3,10 +3,7 @@ defmodule Cannery.Accounts.UserToken do
Schema for a user's session token
"""
use Ecto.Schema
import Ecto.Query
alias Cannery.Accounts.User
alias Ecto.{Association, UUID}
use Cannery, :schema
@hash_algorithm :sha256
@rand_size 32
@ -18,8 +15,6 @@ defmodule Cannery.Accounts.UserToken do
@change_email_validity_in_days 7
@session_validity_in_days 60
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "users_tokens" do
field :token, :binary
field :context, :string

View File

@ -3,10 +3,8 @@ defmodule Cannery.ActivityLog do
The ActivityLog context.
"""
import Ecto.Query, warn: false
alias Cannery.Ammo.{Pack, Type}
alias Cannery.{Accounts.User, ActivityLog.ShotRecord, Repo}
alias Ecto.{Multi, Queryable}
use Cannery, :context
alias Cannery.{ActivityLog.ShotRecord, Ammo.Pack, Ammo.Type}
@type list_shot_records_option ::
{:search, String.t() | nil}

View File

@ -3,11 +3,8 @@ defmodule Cannery.ActivityLog.ShotRecord do
A shot record records a group of ammo shot during a range trip
"""
use Ecto.Schema
import CanneryWeb.Gettext
import Ecto.Changeset
alias Cannery.{Accounts.User, Ammo, Ammo.Pack}
alias Ecto.{Changeset, UUID}
use Cannery, :schema
alias Cannery.{Ammo, Ammo.Pack}
@derive {Jason.Encoder,
only: [

View File

@ -3,13 +3,11 @@ defmodule Cannery.Ammo do
The Ammo context.
"""
import CanneryWeb.Gettext
import Ecto.Query, warn: false
alias Cannery.{Accounts.User, Containers, Repo}
use Cannery, :context
alias Cannery.Containers
alias Cannery.Containers.{Container, ContainerTag, Tag}
alias Cannery.{ActivityLog, ActivityLog.ShotRecord}
alias Cannery.Ammo.{Pack, Type}
alias Ecto.{Changeset, Queryable}
@pack_create_limit 10_000
@pack_preloads [:type]

View File

@ -6,12 +6,8 @@ defmodule Cannery.Ammo.Pack do
amount paid for that ammunition, or what condition it is in
"""
use Ecto.Schema
import CanneryWeb.Gettext
import Ecto.Changeset
alias Cannery.Ammo.Type
alias Cannery.{Accounts.User, Containers, Containers.Container}
alias Ecto.{Changeset, UUID}
use Cannery, :schema
alias Cannery.{Ammo.Type, Containers, Containers.Container}
@derive {Jason.Encoder,
only: [
@ -24,8 +20,6 @@ defmodule Cannery.Ammo.Pack do
:type_id,
:container_id
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "packs" do
field :count, :integer
field :notes, :string

View File

@ -5,11 +5,8 @@ defmodule Cannery.Ammo.Type do
Contains statistical information about the ammunition.
"""
use Ecto.Schema
import Ecto.Changeset
alias Cannery.Accounts.User
use Cannery, :schema
alias Cannery.Ammo.Pack
alias Ecto.{Changeset, UUID}
@derive {Jason.Encoder,
only: [
@ -46,8 +43,6 @@ defmodule Cannery.Ammo.Type do
:shot_charge_weight,
:dram_equivalent
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "types" do
field :name, :string
field :desc, :string

View File

@ -3,11 +3,9 @@ defmodule Cannery.Containers do
The Containers context.
"""
import CanneryWeb.Gettext
import Ecto.Query, warn: false
alias Cannery.{Accounts.User, Ammo.Pack, Repo}
use Cannery, :context
alias Cannery.Ammo.Pack
alias Cannery.Containers.{Container, ContainerTag, Tag}
alias Ecto.{Changeset, Queryable}
@container_preloads [:tags]

View File

@ -3,10 +3,8 @@ defmodule Cannery.Containers.Container do
A container that holds ammunition and belongs to a user.
"""
use Ecto.Schema
import Ecto.Changeset
alias Ecto.{Changeset, UUID}
alias Cannery.{Accounts.User, Containers.ContainerTag, Containers.Tag}
use Cannery, :schema
alias Cannery.{Containers.ContainerTag, Containers.Tag}
@derive {Jason.Encoder,
only: [
@ -17,8 +15,6 @@ defmodule Cannery.Containers.Container do
:type,
:tags
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "containers" do
field :name, :string
field :desc, :string

View File

@ -4,13 +4,9 @@ defmodule Cannery.Containers.ContainerTag do
Cannery.Containers.Tag.
"""
use Ecto.Schema
import Ecto.Changeset
use Cannery, :schema
alias Cannery.Containers.{Container, Tag}
alias Ecto.{Changeset, UUID}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "container_tags" do
belongs_to :container, Container
belongs_to :tag, Tag

View File

@ -4,10 +4,7 @@ defmodule Cannery.Containers.Tag do
text and bg colors.
"""
use Ecto.Schema
import Ecto.Changeset
alias Cannery.Accounts.User
alias Ecto.{Changeset, UUID}
use Cannery, :schema
@derive {Jason.Encoder,
only: [
@ -16,8 +13,6 @@ defmodule Cannery.Containers.Tag do
:bg_color,
:text_color
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "tags" do
field :name, :string
field :bg_color, :string

View File

@ -7,8 +7,8 @@ defmodule Cannery.Email do
`lib/cannery_web/components/layouts/email_text.txt.eex` for text emails.
"""
use Gettext, backend: CanneryWeb.Gettext
import Swoosh.Email
import CanneryWeb.Gettext
import Phoenix.Template
alias Cannery.Accounts.User
alias CanneryWeb.{EmailHTML, Layouts}

View File

@ -42,9 +42,10 @@ defmodule CanneryWeb do
formats: [:html, :json],
layouts: [html: CanneryWeb.Layouts]
use Gettext, backend: CanneryWeb.Gettext
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import Plug.Conn
import CanneryWeb.Gettext
unquote(verified_routes())
end
@ -84,8 +85,9 @@ defmodule CanneryWeb do
defp html_helpers do
quote do
use PhoenixHTMLHelpers
use Gettext, backend: CanneryWeb.Gettext
import Phoenix.{Component, HTML, HTML.Form}
import CanneryWeb.{ErrorHelpers, Gettext, CoreComponents, HTMLHelpers}
import CanneryWeb.{ErrorHelpers, CoreComponents, HTMLHelpers}
# Shortcut for generating JS commands
alias Phoenix.LiveView.JS

View File

@ -4,7 +4,8 @@ defmodule CanneryWeb.CoreComponents do
"""
use Phoenix.Component
use CanneryWeb, :verified_routes
import CanneryWeb.{Gettext, HTMLHelpers}
use Gettext, backend: CanneryWeb.Gettext
import CanneryWeb.HTMLHelpers
alias Cannery.{Accounts, Accounts.Invite, Accounts.User}
alias Cannery.{Ammo, Ammo.Pack}
alias Cannery.{Containers.Container, Containers.Tag}

View File

@ -1,5 +1,5 @@
defmodule CanneryWeb.ErrorJSON do
import CanneryWeb.Gettext
use Gettext, backend: CanneryWeb.Gettext
def render(template, _assigns) do
error_string =

View File

@ -4,9 +4,9 @@ defmodule CanneryWeb.UserAuth do
"""
use CanneryWeb, :verified_routes
use Gettext, backend: CanneryWeb.Gettext
import Plug.Conn
import Phoenix.Controller
import CanneryWeb.Gettext
alias Cannery.{Accounts, Accounts.User}
# Make the remember me cookie valid for 60 days.

View File

@ -1,7 +1,5 @@
defmodule CanneryWeb.UserConfirmationController do
use CanneryWeb, :controller
import CanneryWeb.Gettext
alias Cannery.Accounts
def new(conn, _params) do

View File

@ -1,6 +1,5 @@
defmodule CanneryWeb.UserRegistrationController do
use CanneryWeb, :controller
import CanneryWeb.Gettext
alias Cannery.{Accounts, Accounts.Invites}
alias Ecto.Changeset

View File

@ -1,6 +1,5 @@
defmodule CanneryWeb.UserSettingsController do
use CanneryWeb, :controller
import CanneryWeb.Gettext
alias Cannery.Accounts
alias CanneryWeb.UserAuth

View File

@ -5,7 +5,7 @@ defmodule CanneryWeb.Gettext do
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:
import CanneryWeb.Gettext
use Gettext, backend: CanneryWeb.Gettext
# Simple translation
gettext("Here is the string to translate")
@ -20,5 +20,5 @@ defmodule CanneryWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
use Gettext, otp_app: :cannery
use Gettext.Backend, otp_app: :cannery
end

View File

@ -338,7 +338,7 @@ msgstr ""
"Hosten Sie Ihre eigene Instanz oder verwenden Sie eine Instanz, der Sie "
"vertrauen."
#: lib/cannery_web/controllers/user_settings_controller.ex:10
#: lib/cannery_web/controllers/user_settings_controller.ex:9
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:3
#, elixir-autogen, elixir-format
msgid "Settings"
@ -621,7 +621,7 @@ msgstr "Prozent verbleibend:"
msgid "Rounds used"
msgstr "Patronen verbraucht"
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8
#: lib/cannery_web/controllers/user_confirmation_controller.ex:6
#, elixir-autogen, elixir-format
msgid "Confirm your account"
msgstr "Bestätigen Sie ihr Nutzerkonto"
@ -636,7 +636,7 @@ msgstr "Passwort vergessen?"
msgid "Log in"
msgstr "Einloggen"
#: lib/cannery_web/controllers/user_registration_controller.ex:32
#: lib/cannery_web/controllers/user_registration_controller.ex:31
#, elixir-autogen, elixir-format
msgid "Register"
msgstr "Registrieren"

View File

@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery/containers.ex:224
#: lib/cannery/containers.ex:222
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr "Behälter muss vor dem Löschen leer sein"
@ -39,7 +39,7 @@ msgstr "Konnte %{name} nicht löschen: %{error}"
msgid "Could not find that container"
msgstr "Konnte Behälter nicht finden"
#: lib/cannery_web/controllers/user_settings_controller.ex:84
#: lib/cannery_web/controllers/user_settings_controller.ex:83
#, elixir-autogen, elixir-format
msgid "Email change link is invalid or it has expired."
msgstr "Mailadressenänderungs-Link ist ungültig oder abgelaufen."
@ -80,21 +80,21 @@ msgstr "Oops, etwas ist schiefgegangen. Bitte beachten Sie den Fehler unten."
msgid "Reset password link is invalid or it has expired."
msgstr "Link zum Passwort zurücksetzen ist ungültig oder abgelaufen."
#: lib/cannery_web/controllers/user_registration_controller.ex:22
#: lib/cannery_web/controllers/user_registration_controller.ex:51
#: lib/cannery_web/controllers/user_registration_controller.ex:21
#: lib/cannery_web/controllers/user_registration_controller.ex:50
#, elixir-autogen, elixir-format
msgid "Sorry, public registration is disabled"
msgstr "Entschuldigung, aber öffentliche Registrierung ist deaktiviert"
#: lib/cannery_web/controllers/user_registration_controller.ex:12
#: lib/cannery_web/controllers/user_registration_controller.ex:41
#: lib/cannery_web/controllers/user_registration_controller.ex:70
#: lib/cannery_web/controllers/user_registration_controller.ex:11
#: lib/cannery_web/controllers/user_registration_controller.ex:40
#: lib/cannery_web/controllers/user_registration_controller.ex:69
#, elixir-autogen, elixir-format
msgid "Sorry, this invite was not found or expired"
msgstr ""
"Entschuldigung, aber diese Einladung wurde nicht gefunden oder ist abgelaufen"
#: lib/cannery_web/controllers/user_settings_controller.ex:99
#: lib/cannery_web/controllers/user_settings_controller.ex:98
#, elixir-autogen, elixir-format
msgid "Unable to delete user"
msgstr "Dieser Nutzer konnte nicht gelöscht werden"
@ -105,7 +105,7 @@ msgstr "Dieser Nutzer konnte nicht gelöscht werden"
msgid "Unauthorized"
msgstr "Unbefugt"
#: lib/cannery_web/controllers/user_confirmation_controller.ex:53
#: lib/cannery_web/controllers/user_confirmation_controller.ex:51
#, elixir-autogen, elixir-format
msgid "User confirmation link is invalid or it has expired."
msgstr "Nutzerkonto Bestätigungslink ist ungültig oder abgelaufen."
@ -115,22 +115,22 @@ msgstr "Nutzerkonto Bestätigungslink ist ungültig oder abgelaufen."
msgid "You are not authorized to view this page."
msgstr "Sie sind nicht berechtigt, diese Seite aufzurufen."
#: lib/cannery/accounts/user.ex:145
#: lib/cannery/accounts/user.ex:140
#, elixir-autogen, elixir-format
msgid "did not change"
msgstr "hat sich nicht geändert"
#: lib/cannery/accounts/user.ex:166
#: lib/cannery/accounts/user.ex:161
#, elixir-autogen, elixir-format
msgid "does not match password"
msgstr "Passwort stimmt nicht überein"
#: lib/cannery/accounts/user.ex:203
#: lib/cannery/accounts/user.ex:198
#, elixir-autogen, elixir-format
msgid "is not valid"
msgstr "ist nicht gültig"
#: lib/cannery/accounts/user.ex:100
#: lib/cannery/accounts/user.ex:95
#, elixir-autogen, elixir-format
msgid "must have the @ sign and no spaces"
msgstr "Muss ein @ Zeichen und keine Leerzeichen haben"
@ -163,7 +163,7 @@ msgstr "Tag konnte nicht gelöscht werden"
msgid "Could not parse number of copies"
msgstr "Konnte die Anzahl der Kopien nicht verstehen"
#: lib/cannery/ammo.ex:1028
#: lib/cannery/ammo.ex:1026
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@ -175,27 +175,27 @@ msgstr ""
msgid "Your browser does not support the canvas element."
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:74
#: lib/cannery/activity_log/shot_record.ex:71
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid user and ammo pack"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:88
#: lib/cannery/activity_log/shot_record.ex:85
#, elixir-autogen, elixir-format
msgid "Ammo left can be at most %{count} rounds"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:84
#: lib/cannery/activity_log/shot_record.ex:81
#, elixir-autogen, elixir-format
msgid "Ammo left must be at least 0"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:119
#: lib/cannery/activity_log/shot_record.ex:116
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr "Anzahl muss weniger als %{count} betragen"
#: lib/cannery/activity_log/shot_record.ex:80
#: lib/cannery/activity_log/shot_record.ex:77
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
@ -216,12 +216,12 @@ msgstr ""
msgid "You must log in to access this page."
msgstr ""
#: lib/cannery/ammo/pack.ex:104
#: lib/cannery/ammo/pack.ex:98
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid container"
msgstr ""
#: lib/cannery/ammo/pack.ex:102
#: lib/cannery/ammo/pack.ex:96
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid type"
msgstr ""

View File

@ -52,7 +52,7 @@ msgstr "%{name} wurde gelöscht"
msgid "%{name} updated successfully"
msgstr "%{name} erfolgreich aktualisiert"
#: lib/cannery_web/controllers/user_settings_controller.ex:29
#: lib/cannery_web/controllers/user_settings_controller.ex:28
#, elixir-autogen, elixir-format
msgid "A link to confirm your email change has been sent to the new address."
msgstr "Eine Mail zum Bestätigen ihre Mailadresse wurde Ihnen zugesandt."
@ -89,12 +89,12 @@ msgstr "Sind Sie sicher, dass sie Ihren Account löschen möchten?"
msgid "Are you sure you want to log out?"
msgstr "Wirklich ausloggen?"
#: lib/cannery_web/controllers/user_settings_controller.ex:77
#: lib/cannery_web/controllers/user_settings_controller.ex:76
#, elixir-autogen, elixir-format
msgid "Email changed successfully."
msgstr "Mailadresse erfolgreich geändert."
#: lib/cannery_web/controllers/user_confirmation_controller.ex:23
#: lib/cannery_web/controllers/user_confirmation_controller.ex:21
#, elixir-autogen, elixir-format
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
msgstr ""
@ -118,12 +118,12 @@ msgstr "Erfolgreich ausgeloggt."
msgid "Password reset successfully."
msgstr "Passwort erfolgreich zurückgesetzt."
#: lib/cannery_web/controllers/user_settings_controller.ex:49
#: lib/cannery_web/controllers/user_settings_controller.ex:48
#, elixir-autogen, elixir-format
msgid "Password updated successfully."
msgstr "Passwort erfolgreich geändert."
#: lib/cannery_web/controllers/user_registration_controller.ex:65
#: lib/cannery_web/controllers/user_registration_controller.ex:64
#, elixir-autogen, elixir-format
msgid "Please check your email to verify your account"
msgstr "Bitte überprüfen Sie ihre Mailbox und bestätigen Sie das Nutzerkonto"
@ -139,7 +139,7 @@ msgstr "Bitte überprüfen Sie ihre Mailbox und bestätigen Sie das Nutzerkonto"
msgid "Saving..."
msgstr "Speichere..."
#: lib/cannery_web/controllers/user_settings_controller.ex:95
#: lib/cannery_web/controllers/user_settings_controller.ex:94
#, elixir-autogen, elixir-format
msgid "Your account has been deleted"
msgstr "Ihr Nutzerkonto wurde gelöscht"
@ -193,7 +193,7 @@ msgstr "Schießkladde erfolgreich gelöscht"
msgid "Shot records updated successfully"
msgstr "Schießkladde erfolgreich aktualisiert"
#: lib/cannery_web/controllers/user_confirmation_controller.ex:37
#: lib/cannery_web/controllers/user_confirmation_controller.ex:35
#, elixir-autogen, elixir-format
msgid "%{email} confirmed successfully."
msgstr "%{email} erfolgreich bestätigt."
@ -229,7 +229,7 @@ msgstr "Erstellen..."
msgid "Are you sure you want to change your language?"
msgstr "Möchten Sie die Sprache wechseln?"
#: lib/cannery_web/controllers/user_settings_controller.ex:65
#: lib/cannery_web/controllers/user_settings_controller.ex:64
#, elixir-autogen, elixir-format
msgid "Language updated successfully."
msgstr "Spracheinstellung gespeichert."

View File

@ -332,7 +332,7 @@ msgstr ""
msgid "Self-host your own instance, or use an instance from someone you trust."
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:10
#: lib/cannery_web/controllers/user_settings_controller.ex:9
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:3
#, elixir-autogen, elixir-format
msgid "Settings"
@ -615,7 +615,7 @@ msgstr ""
msgid "Rounds used"
msgstr ""
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8
#: lib/cannery_web/controllers/user_confirmation_controller.ex:6
#, elixir-autogen, elixir-format
msgid "Confirm your account"
msgstr ""
@ -630,7 +630,7 @@ msgstr ""
msgid "Log in"
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:32
#: lib/cannery_web/controllers/user_registration_controller.ex:31
#, elixir-autogen, elixir-format
msgid "Register"
msgstr ""

View File

@ -332,7 +332,7 @@ msgstr ""
msgid "Self-host your own instance, or use an instance from someone you trust."
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:10
#: lib/cannery_web/controllers/user_settings_controller.ex:9
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:3
#, elixir-autogen, elixir-format
msgid "Settings"
@ -615,7 +615,7 @@ msgstr ""
msgid "Rounds used"
msgstr ""
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8
#: lib/cannery_web/controllers/user_confirmation_controller.ex:6
#, elixir-autogen, elixir-format
msgid "Confirm your account"
msgstr ""
@ -630,7 +630,7 @@ msgstr ""
msgid "Log in"
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:32
#: lib/cannery_web/controllers/user_registration_controller.ex:31
#, elixir-autogen, elixir-format
msgid "Register"
msgstr ""

View File

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Language: en\n"
#: lib/cannery/containers.ex:224
#: lib/cannery/containers.ex:222
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr ""
@ -26,7 +26,7 @@ msgstr ""
msgid "Could not find that container"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:84
#: lib/cannery_web/controllers/user_settings_controller.ex:83
#, elixir-autogen, elixir-format
msgid "Email change link is invalid or it has expired."
msgstr ""
@ -67,20 +67,20 @@ msgstr ""
msgid "Reset password link is invalid or it has expired."
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:22
#: lib/cannery_web/controllers/user_registration_controller.ex:51
#: lib/cannery_web/controllers/user_registration_controller.ex:21
#: lib/cannery_web/controllers/user_registration_controller.ex:50
#, elixir-autogen, elixir-format
msgid "Sorry, public registration is disabled"
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:12
#: lib/cannery_web/controllers/user_registration_controller.ex:41
#: lib/cannery_web/controllers/user_registration_controller.ex:70
#: lib/cannery_web/controllers/user_registration_controller.ex:11
#: lib/cannery_web/controllers/user_registration_controller.ex:40
#: lib/cannery_web/controllers/user_registration_controller.ex:69
#, elixir-autogen, elixir-format
msgid "Sorry, this invite was not found or expired"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:99
#: lib/cannery_web/controllers/user_settings_controller.ex:98
#, elixir-autogen, elixir-format
msgid "Unable to delete user"
msgstr ""
@ -91,7 +91,7 @@ msgstr ""
msgid "Unauthorized"
msgstr ""
#: lib/cannery_web/controllers/user_confirmation_controller.ex:53
#: lib/cannery_web/controllers/user_confirmation_controller.ex:51
#, elixir-autogen, elixir-format
msgid "User confirmation link is invalid or it has expired."
msgstr ""
@ -101,23 +101,23 @@ msgstr ""
msgid "You are not authorized to view this page."
msgstr ""
#: lib/cannery/accounts/user.ex:145
#: lib/cannery/accounts/user.ex:140
#, elixir-autogen, elixir-format
msgid "did not change"
msgstr ""
#: lib/cannery/accounts/user.ex:166
#: lib/cannery/accounts/user.ex:161
#, elixir-autogen, elixir-format
msgid "does not match password"
msgstr ""
## From Ecto.Changeset.put_change/3
#: lib/cannery/accounts/user.ex:203
#: lib/cannery/accounts/user.ex:198
#, elixir-autogen, elixir-format, fuzzy
msgid "is not valid"
msgstr ""
#: lib/cannery/accounts/user.ex:100
#: lib/cannery/accounts/user.ex:95
#, elixir-autogen, elixir-format
msgid "must have the @ sign and no spaces"
msgstr ""
@ -148,7 +148,7 @@ msgstr ""
msgid "Could not parse number of copies"
msgstr ""
#: lib/cannery/ammo.ex:1028
#: lib/cannery/ammo.ex:1026
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@ -158,27 +158,27 @@ msgstr ""
msgid "Your browser does not support the canvas element."
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:74
#: lib/cannery/activity_log/shot_record.ex:71
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid user and ammo pack"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:88
#: lib/cannery/activity_log/shot_record.ex:85
#, elixir-autogen, elixir-format
msgid "Ammo left can be at most %{count} rounds"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:84
#: lib/cannery/activity_log/shot_record.ex:81
#, elixir-autogen, elixir-format
msgid "Ammo left must be at least 0"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:119
#: lib/cannery/activity_log/shot_record.ex:116
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:80
#: lib/cannery/activity_log/shot_record.ex:77
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
@ -199,12 +199,12 @@ msgstr ""
msgid "You must log in to access this page."
msgstr ""
#: lib/cannery/ammo/pack.ex:104
#: lib/cannery/ammo/pack.ex:98
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid container"
msgstr ""
#: lib/cannery/ammo/pack.ex:102
#: lib/cannery/ammo/pack.ex:96
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid type"
msgstr ""

View File

@ -39,7 +39,7 @@ msgstr ""
msgid "%{name} updated successfully"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:29
#: lib/cannery_web/controllers/user_settings_controller.ex:28
#, elixir-autogen, elixir-format
msgid "A link to confirm your email change has been sent to the new address."
msgstr ""
@ -74,12 +74,12 @@ msgstr ""
msgid "Are you sure you want to log out?"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:77
#: lib/cannery_web/controllers/user_settings_controller.ex:76
#, elixir-autogen, elixir-format
msgid "Email changed successfully."
msgstr ""
#: lib/cannery_web/controllers/user_confirmation_controller.ex:23
#: lib/cannery_web/controllers/user_confirmation_controller.ex:21
#, elixir-autogen, elixir-format
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
msgstr ""
@ -99,12 +99,12 @@ msgstr ""
msgid "Password reset successfully."
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:49
#: lib/cannery_web/controllers/user_settings_controller.ex:48
#, elixir-autogen, elixir-format
msgid "Password updated successfully."
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:65
#: lib/cannery_web/controllers/user_registration_controller.ex:64
#, elixir-autogen, elixir-format
msgid "Please check your email to verify your account"
msgstr ""
@ -120,7 +120,7 @@ msgstr ""
msgid "Saving..."
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:95
#: lib/cannery_web/controllers/user_settings_controller.ex:94
#, elixir-autogen, elixir-format
msgid "Your account has been deleted"
msgstr ""
@ -172,7 +172,7 @@ msgstr ""
msgid "Shot records updated successfully"
msgstr ""
#: lib/cannery_web/controllers/user_confirmation_controller.ex:37
#: lib/cannery_web/controllers/user_confirmation_controller.ex:35
#, elixir-autogen, elixir-format
msgid "%{email} confirmed successfully."
msgstr ""
@ -208,7 +208,7 @@ msgstr ""
msgid "Are you sure you want to change your language?"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:65
#: lib/cannery_web/controllers/user_settings_controller.ex:64
#, elixir-autogen, elixir-format
msgid "Language updated successfully."
msgstr ""

View File

@ -10,7 +10,7 @@
msgid ""
msgstr ""
#: lib/cannery/containers.ex:224
#: lib/cannery/containers.ex:222
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr ""
@ -26,7 +26,7 @@ msgstr ""
msgid "Could not find that container"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:84
#: lib/cannery_web/controllers/user_settings_controller.ex:83
#, elixir-autogen, elixir-format
msgid "Email change link is invalid or it has expired."
msgstr ""
@ -67,20 +67,20 @@ msgstr ""
msgid "Reset password link is invalid or it has expired."
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:22
#: lib/cannery_web/controllers/user_registration_controller.ex:51
#: lib/cannery_web/controllers/user_registration_controller.ex:21
#: lib/cannery_web/controllers/user_registration_controller.ex:50
#, elixir-autogen, elixir-format
msgid "Sorry, public registration is disabled"
msgstr ""
#: lib/cannery_web/controllers/user_registration_controller.ex:12
#: lib/cannery_web/controllers/user_registration_controller.ex:41
#: lib/cannery_web/controllers/user_registration_controller.ex:70
#: lib/cannery_web/controllers/user_registration_controller.ex:11
#: lib/cannery_web/controllers/user_registration_controller.ex:40
#: lib/cannery_web/controllers/user_registration_controller.ex:69
#, elixir-autogen, elixir-format
msgid "Sorry, this invite was not found or expired"
msgstr ""
#: lib/cannery_web/controllers/user_settings_controller.ex:99
#: lib/cannery_web/controllers/user_settings_controller.ex:98
#, elixir-autogen, elixir-format
msgid "Unable to delete user"
msgstr ""
@ -91,7 +91,7 @@ msgstr ""
msgid "Unauthorized"
msgstr ""
#: lib/cannery_web/controllers/user_confirmation_controller.ex:53
#: lib/cannery_web/controllers/user_confirmation_controller.ex:51
#, elixir-autogen, elixir-format
msgid "User confirmation link is invalid or it has expired."
msgstr ""
@ -101,22 +101,22 @@ msgstr ""
msgid "You are not authorized to view this page."
msgstr ""
#: lib/cannery/accounts/user.ex:145
#: lib/cannery/accounts/user.ex:140
#, elixir-autogen, elixir-format
msgid "did not change"
msgstr ""
#: lib/cannery/accounts/user.ex:166
#: lib/cannery/accounts/user.ex:161
#, elixir-autogen, elixir-format
msgid "does not match password"
msgstr ""
#: lib/cannery/accounts/user.ex:203
#: lib/cannery/accounts/user.ex:198
#, elixir-autogen, elixir-format
msgid "is not valid"
msgstr ""
#: lib/cannery/accounts/user.ex:100
#: lib/cannery/accounts/user.ex:95
#, elixir-autogen, elixir-format
msgid "must have the @ sign and no spaces"
msgstr ""
@ -147,7 +147,7 @@ msgstr ""
msgid "Could not parse number of copies"
msgstr ""
#: lib/cannery/ammo.ex:1028
#: lib/cannery/ammo.ex:1026
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@ -157,27 +157,27 @@ msgstr ""
msgid "Your browser does not support the canvas element."
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:74
#: lib/cannery/activity_log/shot_record.ex:71
#, elixir-autogen, elixir-format
msgid "Please select a valid user and ammo pack"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:88
#: lib/cannery/activity_log/shot_record.ex:85
#, elixir-autogen, elixir-format
msgid "Ammo left can be at most %{count} rounds"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:84
#: lib/cannery/activity_log/shot_record.ex:81
#, elixir-autogen, elixir-format
msgid "Ammo left must be at least 0"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:119
#: lib/cannery/activity_log/shot_record.ex:116
#, elixir-autogen, elixir-format
msgid "Count can be at most %{count} shots"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:80
#: lib/cannery/activity_log/shot_record.ex:77
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
@ -198,12 +198,12 @@ msgstr ""
msgid "You must log in to access this page."
msgstr ""
#: lib/cannery/ammo/pack.ex:104
#: lib/cannery/ammo/pack.ex:98
#, elixir-autogen, elixir-format
msgid "Please select a valid container"
msgstr ""
#: lib/cannery/ammo/pack.ex:102
#: lib/cannery/ammo/pack.ex:96
#, elixir-autogen, elixir-format
msgid "Please select a valid type"
msgstr ""

View File

@ -338,7 +338,7 @@ msgstr ""
"Autogestiona tu propia instancia, o usa una instancia de alguién de quien te "
"fíes."
#: lib/cannery_web/controllers/user_settings_controller.ex:10
#: lib/cannery_web/controllers/user_settings_controller.ex:9
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:3
#, elixir-autogen, elixir-format
msgid "Settings"
@ -622,7 +622,7 @@ msgstr "Pocentaje restante:"
msgid "Rounds used"
msgstr "Balas usadas"
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8
#: lib/cannery_web/controllers/user_confirmation_controller.ex:6
#, elixir-autogen, elixir-format
msgid "Confirm your account"
msgstr "Confirmar su cuenta"
@ -637,7 +637,7 @@ msgstr "¿Olvidó su contraseña?"
msgid "Log in"
msgstr "Entrar"
#: lib/cannery_web/controllers/user_registration_controller.ex:32
#: lib/cannery_web/controllers/user_registration_controller.ex:31
#, elixir-autogen, elixir-format
msgid "Register"
msgstr "Registrarse"

View File

@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery/containers.ex:224
#: lib/cannery/containers.ex:222
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr "El contenedor debe estar vacío antes de ser borrado"
@ -39,7 +39,7 @@ msgstr "No se pudo eliminar %{name}: %{error}"
msgid "Could not find that container"
msgstr "No se pudo encontrar el contenedor"
#: lib/cannery_web/controllers/user_settings_controller.ex:84
#: lib/cannery_web/controllers/user_settings_controller.ex:83
#, elixir-autogen, elixir-format
msgid "Email change link is invalid or it has expired."
msgstr "El enlace de cambio de correo es inválido o ha expirado."
@ -83,20 +83,20 @@ msgid "Reset password link is invalid or it has expired."
msgstr ""
"El enlace de reestablecimiento de la contraseña es inválido o ha caducado."
#: lib/cannery_web/controllers/user_registration_controller.ex:22
#: lib/cannery_web/controllers/user_registration_controller.ex:51
#: lib/cannery_web/controllers/user_registration_controller.ex:21
#: lib/cannery_web/controllers/user_registration_controller.ex:50
#, elixir-autogen, elixir-format
msgid "Sorry, public registration is disabled"
msgstr "Lo sentimos, el registro público no está habilitado"
#: lib/cannery_web/controllers/user_registration_controller.ex:12
#: lib/cannery_web/controllers/user_registration_controller.ex:41
#: lib/cannery_web/controllers/user_registration_controller.ex:70
#: lib/cannery_web/controllers/user_registration_controller.ex:11
#: lib/cannery_web/controllers/user_registration_controller.ex:40
#: lib/cannery_web/controllers/user_registration_controller.ex:69
#, elixir-autogen, elixir-format
msgid "Sorry, this invite was not found or expired"
msgstr "Lo sentimos, esta invitación no es válida o ha caducado"
#: lib/cannery_web/controllers/user_settings_controller.ex:99
#: lib/cannery_web/controllers/user_settings_controller.ex:98
#, elixir-autogen, elixir-format
msgid "Unable to delete user"
msgstr "No se ha podido eliminar el usuario"
@ -107,7 +107,7 @@ msgstr "No se ha podido eliminar el usuario"
msgid "Unauthorized"
msgstr "No autorizado"
#: lib/cannery_web/controllers/user_confirmation_controller.ex:53
#: lib/cannery_web/controllers/user_confirmation_controller.ex:51
#, elixir-autogen, elixir-format
msgid "User confirmation link is invalid or it has expired."
msgstr "El enlace de confirmación de usuario no es válido o ha caducado."
@ -117,22 +117,22 @@ msgstr "El enlace de confirmación de usuario no es válido o ha caducado."
msgid "You are not authorized to view this page."
msgstr "No está autorizado a ver esta página."
#: lib/cannery/accounts/user.ex:145
#: lib/cannery/accounts/user.ex:140
#, elixir-autogen, elixir-format
msgid "did not change"
msgstr "no cambió"
#: lib/cannery/accounts/user.ex:166
#: lib/cannery/accounts/user.ex:161
#, elixir-autogen, elixir-format
msgid "does not match password"
msgstr "no coincide con la contraseña"
#: lib/cannery/accounts/user.ex:203
#: lib/cannery/accounts/user.ex:198
#, elixir-autogen, elixir-format
msgid "is not valid"
msgstr "no es válido"
#: lib/cannery/accounts/user.ex:100
#: lib/cannery/accounts/user.ex:95
#, elixir-autogen, elixir-format
msgid "must have the @ sign and no spaces"
msgstr "debe tener el signo @ y no contener espacios"
@ -163,7 +163,7 @@ msgstr "La etiqueta no pudo ser eliminada"
msgid "Could not parse number of copies"
msgstr "No se ha podido procesar el número de copias"
#: lib/cannery/ammo.ex:1028
#: lib/cannery/ammo.ex:1026
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Número inválido de copias, debe ser entre 1 y %{max}. Fue %{multiplier"
@ -173,27 +173,27 @@ msgstr "Número inválido de copias, debe ser entre 1 y %{max}. Fue %{multiplier
msgid "Your browser does not support the canvas element."
msgstr "Su navegador no es compatible con el elemento lienzo."
#: lib/cannery/activity_log/shot_record.ex:74
#: lib/cannery/activity_log/shot_record.ex:71
#, elixir-autogen, elixir-format
msgid "Please select a valid user and ammo pack"
msgstr "Por favor escoja un usuario y tipo de munición valido"
#: lib/cannery/activity_log/shot_record.ex:88
#: lib/cannery/activity_log/shot_record.ex:85
#, elixir-autogen, elixir-format
msgid "Ammo left can be at most %{count} rounds"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:84
#: lib/cannery/activity_log/shot_record.ex:81
#, elixir-autogen, elixir-format
msgid "Ammo left must be at least 0"
msgstr ""
#: lib/cannery/activity_log/shot_record.ex:119
#: lib/cannery/activity_log/shot_record.ex:116
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr "El recuento debe ser menos de %{count}"
#: lib/cannery/activity_log/shot_record.ex:80
#: lib/cannery/activity_log/shot_record.ex:77
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
@ -214,12 +214,12 @@ msgstr ""
msgid "You must log in to access this page."
msgstr ""
#: lib/cannery/ammo/pack.ex:104
#: lib/cannery/ammo/pack.ex:98
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid container"
msgstr "Por favor escoja un tipo de munición y un contenedor"
#: lib/cannery/ammo/pack.ex:102
#: lib/cannery/ammo/pack.ex:96
#, elixir-autogen, elixir-format, fuzzy
msgid "Please select a valid type"
msgstr "Por favor escoja un usuario y tipo de munición valido"

View File

@ -52,7 +52,7 @@ msgstr "%{name} ha sido borrado"
msgid "%{name} updated successfully"
msgstr "%{name} actualizado exitosamente"
#: lib/cannery_web/controllers/user_settings_controller.ex:29
#: lib/cannery_web/controllers/user_settings_controller.ex:28
#, elixir-autogen, elixir-format
msgid "A link to confirm your email change has been sent to the new address."
msgstr ""
@ -89,12 +89,12 @@ msgstr "Está seguro que desea eliminar su cuenta?"
msgid "Are you sure you want to log out?"
msgstr "Está seguro que desea cerrar sesión?"
#: lib/cannery_web/controllers/user_settings_controller.ex:77
#: lib/cannery_web/controllers/user_settings_controller.ex:76
#, elixir-autogen, elixir-format
msgid "Email changed successfully."
msgstr "Correo electrónico cambiado exitosamente."
#: lib/cannery_web/controllers/user_confirmation_controller.ex:23
#: lib/cannery_web/controllers/user_confirmation_controller.ex:21
#, elixir-autogen, elixir-format
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
msgstr ""
@ -118,12 +118,12 @@ msgstr "Sesión cerrada exitosamente."
msgid "Password reset successfully."
msgstr "Contraseña reiniciada exitosamente."
#: lib/cannery_web/controllers/user_settings_controller.ex:49
#: lib/cannery_web/controllers/user_settings_controller.ex:48
#, elixir-autogen, elixir-format
msgid "Password updated successfully."
msgstr "Contraseña cambiada exitosamente."
#: lib/cannery_web/controllers/user_registration_controller.ex:65
#: lib/cannery_web/controllers/user_registration_controller.ex:64
#, elixir-autogen, elixir-format
msgid "Please check your email to verify your account"
msgstr "Por favor chequea el correo para verificar tu cuenta"
@ -139,7 +139,7 @@ msgstr "Por favor chequea el correo para verificar tu cuenta"
msgid "Saving..."
msgstr "Guardando..."
#: lib/cannery_web/controllers/user_settings_controller.ex:95
#: lib/cannery_web/controllers/user_settings_controller.ex:94
#, elixir-autogen, elixir-format
msgid "Your account has been deleted"
msgstr "Su cuenta ha sido eliminada"