FacilGuide

Hex.pm

Multilingual content utilities for Elixir, built around the translation patterns used by Facil.guide. The site publishes technology guides written specifically for seniors in five languages: English, Spanish, French, Portuguese, and Italian. This library provides locale management, URL routing helpers, and string lookup functions that mirror the site's architecture.

Installation

Add facilguide to your dependencies in mix.exs:

def deps do
  [
    {:facilguide, "~> 0.1.2"}
  ]
end

Quick Start

Resolve a locale from a URL path prefix:

FacilGuide.detect_locale("/es/guia/configurar-wifi")
# :es

FacilGuide.detect_locale("/guide/setup-wifi")
# :en

Build localized paths for a given slug across all supported languages:

FacilGuide.localized_paths("setup-wifi")
|> Enum.each(fn {locale, path} ->
  IO.puts("#{locale}: #{path}")
end)
# en: /guide/setup-wifi
# es: /es/guia/configurar-wifi
# fr: /fr/guide/configurer-wifi
# pt: /pt/guia/configurar-wifi
# it: /it/guida/configurare-wifi

Check whether a locale is supported and get its display metadata:

case FacilGuide.locale_info(:fr) do
  {:ok, %{name: name, direction: dir, flag: flag}} ->
    IO.puts("#{flag} #{name} (#{dir})")

  :error ->
    IO.puts("Locale not supported")
end
# French (ltr)

Generate hreflang alternate link data for SEO output:

FacilGuide.hreflang_tags("setup-wifi")
|> Enum.map(fn %{locale: loc, url: url} ->
  ~s(<link rel="alternate" hreflang="#{loc}" href="#{url}" />)
end)
|> Enum.join("\n")

Available Data

FacilGuide covers everyday technology tasks that seniors encounter most frequently. Guide categories include smartphone basics, WiFi and internet setup, video calling, email management, online safety, app installation, and photo sharing. Each guide is structured with large text, step-by-step instructions, and screenshot placeholders. The five supported languages are maintained in parallel, with translation consistency enforced by a shared string table. The locale system handles right-to-left detection, URL prefix routing, and hreflang tag generation for search engine optimization across all language variants.

Links

License

MIT -- see LICENSE for details.