Ashkan
Schema internationalization/localization
I have translated some custom error message in a schema, it just works, no problem here.
But to do that I have imported import MyappWeb.Gettext into the schema which is inside Myapp module. Importing something from MyappWeb into Myapp makes me feel that I am doing something wrong. More generally gettext is not in Myapp so should I even internationalize messages inside the schema?
Is there another way to do the translation importing gettext from MyappWeb or any other place into Myapp? Or should I try report the error somehow that doesn’t need to be internationalized inside schema? how?
Or maybe it is just OK to do the internationalization inside a schema.
Marked As Solved
Ashkan
OK, I found a way. I added msgid and msgstr to errors.pot file. Then I ran mix gettext.merge priv/gettext to update the .po files. And there I added the translated string.
There is file views/error_helpers.ex I think it is doing the translation.
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









