Using the hex linguist package in the Phoenix Framework

How can I use the linguists package with Phoenix? I am trying to do internationalization on a webpage. I added the package to mix.exs and successfully executed it successfully mix deps.get.

Now I don’t know where to write the package module file in the folder, or if it should be ex or exs in the extension, for example, a file of another country language if used (fr.exs).

Also, after writing the module, how exactly would I apply it to my HTML tags?

+4
source share
2 answers

Looking quickly at the reading, it seems you are specifying the path to the local file in the declaration localewhen writing your module I18n. This is the line:

locale "fr", Path.join([__DIR__, "fr.exs"])

: " " fr.exs "", , , , - :

locale "fr", Path.join(["lib", "translations", "fr.exs"])

I18n, , , readme :

<%=  I18n.t!("fr", "greeting") %>
+8

All Articles