Parameters for custom sigil

Hi, i have a thought regarding my phoenix application and translations. I might have understood it wrong, but here it goes.

I want to create a custom sigil ~t which helps with translation of text with the help of gettext. From what i have found, only a charlist can be passed as options. However, i want to be able too choose a particular domain for the gettext call. For example:

def sigil_t(string, domain, opts) do
...
dgettext(domain, string)
end

Is there anyway i can pass arguments with the ~t(foo) call? without appending chars at the end of the translation?

No more that you mentioned. Sigils have two inputs: The text contents within delimiters and the chars after the delimiter. That’s it.

2 Likes