Skip to content

Commit 214f15d

Browse files
committed
Improve docs here and there
1 parent b7d8fb5 commit 214f15d

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

lib/gettext.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ defmodule Gettext do
733733
734734
Gettext.dgettext(MyApp.Gettext, "errors", "signup form", "%{name} is not a valid name", name: "Meg")
735735
#=> "Meg non è un nome valido"
736+
736737
"""
737738
@spec dpgettext(module, binary, binary | nil, binary, bindings) :: binary
738739
def dpgettext(backend, domain, msgctxt, msgid, bindings \\ %{})

lib/gettext/backend.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ defmodule Gettext.Backend do
9898
) :: Macro.t()
9999

100100
@doc """
101-
Same as `dpgettext(domain, msgid, %{})`.
101+
Same as `dpgettext(domain, msgctxt, msgid, %{})`.
102102
103103
See also `Gettext.dpgettext/5`.
104104
"""

lib/gettext/compiler.ex

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ defmodule Gettext.Compiler do
366366
@spec warn_if_domain_contains_slashes(binary) :: :ok
367367
def warn_if_domain_contains_slashes(domain) do
368368
if String.contains?(domain, "/") do
369-
Logger.error(fn -> ["Slashes in domains are not supported: ", inspect(domain)] end)
369+
_ = Logger.error(fn -> ["Slashes in domains are not supported: ", inspect(domain)] end)
370370
end
371371

372372
:ok
@@ -581,12 +581,13 @@ defmodule Gettext.Compiler do
581581
defp warn_if_missing_plural_forms(locale, plural_mod, translation, file) do
582582
Enum.each(0..(plural_mod.nplurals(locale) - 1), fn form ->
583583
unless Map.has_key?(translation.msgstr, form) do
584-
Logger.error([
585-
"#{file}:#{translation.po_source_line}: translation is missing plural form ",
586-
Integer.to_string(form),
587-
" which is required by the locale ",
588-
inspect(locale)
589-
])
584+
_ =
585+
Logger.error([
586+
"#{file}:#{translation.po_source_line}: translation is missing plural form ",
587+
Integer.to_string(form),
588+
" which is required by the locale ",
589+
inspect(locale)
590+
])
590591
end
591592
end)
592593
end

0 commit comments

Comments
 (0)