Packages
A tool for pseudolocalizing Gettext translations in Elixir applications. Helps identify hardcoded strings, character encoding issues, and UI problems by converting ASCII characters to similar-looking Unicode characters with text expansion simulation.
Current section
Files
Jump to
Current section
Files
lib/gettext_pseudolocalize.ex
defmodule GettextPseudolocalize do
use Gettext, backend: GettextPseudolocalize.Gettext
def hello(name \\ "world") do
Gettext.with_locale(GettextPseudolocalize.Gettext, "xx", fn ->
gettext("hello %{name}", name: name)
end)
end
def translate(count) do
Gettext.with_locale(GettextPseudolocalize.Gettext, "xx", fn ->
ngettext(
"Here is the string to translate",
"Here are the %{count} strings to translate",
count,
count: count
)
end)
end
end