I will start with i am new to Phoenix and Elixir so please consider it before reading my question.
I am trying to get multi-lingual site. So far i have the gettext files and Phoenix configuration work properly. At the current stage i want to implement the language switcher. For example:
- User opens mysite.com/en/ping
- User need to have the UI on another language and clicks on the Bulgarian flag of from the language switch on top
- User gets redirected to /bg/ping
My question is - is there a smart way to generate a link for the same page the user is currently at or if there is another better approach for such situation?
My goal is when a person opens a long url like mysite.com/en/param1/param2/group/id but the UI is not conveniently matching their language to be able to switch it and stay on the same page.
I hope this makes sense. Any help will be appreciated.