Import phase of Glossary
Terms affected by phase Import phase
In each phase, some terms appeared for the first time, changed their place in the structure, were updated with new meaning, or were marked as no longer in use. These shifts help trace the evolution of the project’s conceptual map.
Added
Attribute external_resource
@external_resource Path.join(__dir__, "glossary.md")
@external_resource Path.join(__dir__, "glossary.md")
Provides the `hint/2` function for translating custom Ecto validation messages using a localized glossary. Designed for use in modules that define or consume `Ecto.Changeset` validations. ## Why? Ecto allows adding errors with custom messages and m...
defmodule Glossary.Ecto do
@moduledoc "Provides the `hint/2` function for translating custom Ecto validation messages\nusing a localized glossary.\n\nDesigned for use in modules that define or consume `Ecto.Changeset` validations.\n\n## Why?\n\nEcto allows adding errors with custom messages and m..."
end
defmodule Glossary.EctoTest do
use ExUnit.Case, async: true
end
Internal functions for working with glossary lexemes. This module is not part of the public API. It provides utilities to identify, qualify, and resolve localized expressions based on Ecto-style validation metadata.
defmodule Glossary.Lexeme do
@moduledoc "Internal functions for working with glossary lexemes.\n\nThis module is not part of the public API.\nIt provides utilities to identify, qualify, and resolve localized expressions\nbased on Ecto-style validation metadata.\n"
alias Glossary.Lexeme
@doc "Head of safe_to_string/1"
@spec safe_to_string(any) :: any
def safe_to_string(v)
def safe_to_string(v) when is_list(v) do
end
def safe_to_string(v) do
end
@doc "Prepends a locale prefix to a lexeme to produce a fully qualified glossary key.\n\n## Examples\n\n qualify(\"validation.required\", \"en\")\n #=> \"en.validation.required\"\n"
@spec qualify(String.t(), String.t()) :: String.t()
def qualify(lexeme, locale) do
end
@doc "Looks up a localized expression in the glossary by its fully qualified key.\n\nPerforms interpolation of placeholders in the form `{{key}}` using values from `bindings`.\nIf the key is not found, returns `fallback` or the key itself, and logs a warning.\n..."
@spec lookup(String.t(), map, any, atom) :: String.t()
def lookup(key, glossary, bindings, fallback) do
end
@doc "Builds a lexeme identifier from Ecto validation options.\n\nThe result is used to construct the glossary key. It attempts to match the most\nspecific form: `validation.key.kind.type`, then `validation.key.kind`, then `validation.key`.\n\nLogs a warning and..."
@spec identify(map) :: String.t()
def identify(map)
def identify(%{validation: key, kind: kind, type: type}) do
end
def identify(%{validation: key, kind: kind}) do
end
def identify(%{validation: key}) do
end
def identify(opts) do
end
end
defmodule Glossary.LexemeTest do
use ExUnit.Case, async: true
alias Glossary.Lexeme
describe("identify / 1") do
test "arg #1 is map with validation, kind and type" do
end
test "arg #1 is map with validation and kind" do
end
test "arg #1 is map with only validation key" do
end
test "fallback" do
end
end
describe("lookup / 4") do
test "" do
end
end
describe("qualify / 2") do
test "" do
end
end
describe("safe_to_string / 1") do
test "" do
end
test "" do
end
end
end
Compiles YAML glossaries into a flat map of localized expressions. Used internally by `Glossary` to build a lexicon of lexeme–expression mappings.
defmodule Glossary.Lexicon do
@moduledoc "Compiles YAML glossaries into a flat map of localized expressions.\n\nUsed internally by `Glossary` to build a lexicon of lexeme–expression mappings.\n"
@doc "Head of with_locale/1"
@spec with_locale(String.t()) :: tuple
def with_locale(path) do
end
@doc "Head of read_yaml/2"
@spec read_yaml(String.t(), String.t()) :: any
def read_yaml(file, locale) do
end
@doc "Head of mark_as_external/2"
@spec mark_as_external(list, any) :: any
def mark_as_external(paths, module) do
end
@doc "Head of load_all_expressions/1"
@spec load_all_expressions(list) :: map
def load_all_expressions(paths) do
end
@doc "Head of flatten_keys/2"
@spec flatten_keys(map, atom) :: any
def flatten_keys(yaml, prefix) do
end
@doc "Head of expand_paths/2"
@spec expand_paths(list, String.t()) :: any
def expand_paths(sources, base_path) do
end
@doc "Compiles a list of YAML glossary files into a map of keys (`locale.lexeme`) to expressions.\n\nAutomatically marks each file as an external resource for recompilation tracking.\n"
@spec compile(String.t(), list, any) :: map
def compile(base_path, sources, module) do
end
end
defmodule Glossary.LexiconTest do
use ExUnit.Case, async: true
describe("compile / 3") do
test "" do
end
end
describe("expand_paths / 2") do
test "" do
end
end
describe("flatten_keys / 2") do
test "" do
end
end
describe("load_all_expressions / 1") do
test "" do
end
end
describe("mark_as_external / 2") do
test "" do
end
end
describe("read_yaml / 2") do
test "" do
end
end
describe("with_locale / 1") do
test "" do
end
end
end
Phase History Tree
A tree of all phases the project has passed through to reach the current phase.