{"id":13508037,"url":"https://github.com/jxs/phoenix_linguist","last_synced_at":"2025-03-22T12:32:30.899Z","repository":{"id":27839209,"uuid":"31329274","full_name":"jxs/phoenix_linguist","owner":"jxs","description":"linguist integration functions into phoenix","archived":false,"fork":false,"pushed_at":"2020-02-10T12:19:13.000Z","size":12,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T11:11:37.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jxs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T18:32:57.000Z","updated_at":"2023-10-10T12:49:01.000Z","dependencies_parsed_at":"2022-08-27T14:43:43.820Z","dependency_job_id":null,"html_url":"https://github.com/jxs/phoenix_linguist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxs%2Fphoenix_linguist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxs%2Fphoenix_linguist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxs%2Fphoenix_linguist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxs%2Fphoenix_linguist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jxs","download_url":"https://codeload.github.com/jxs/phoenix_linguist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959444,"owners_count":20538625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:46.402Z","updated_at":"2025-03-22T12:32:30.602Z","avatar_url":"https://github.com/jxs.png","language":"Elixir","funding_links":[],"categories":["Framework Components"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/jxs/phoenix_linguist.svg?branch=master)](https://travis-ci.org/jxs/phoenix_linguist)\n\n# PhoenixLinguist\n\nA project that integrates [Phoenix](http://github.com/phoenixframework/phoenix) with [Linguist](https://github.com/chrismccord/linguist), providing a plug and view helpers\n\n`PhoenixLinguistPlug` checks if there's a :locale param on the requested route, if there is and matches the existing locales, puts the locale on the session. If the requested :locale does not exist, forwards the user to the `ErrorView` `404` handler defined. If there isn't a :locale defined, `PhoenixLinguistPlug` puts the default locale on the session\n`PhoenixLinguist.Helpers` are a couple of view helpers that can be used on templates to help determine user's prefered locale\n\nYou can see the [online documentation](http://hexdocs.pm/phoenix_linguist/) for more information.\n\n## Requirements\n\nElixir 1.0.2\n\n[Phoenix](http://www.phoenixframework.org) 0.10.0\n\n## Instructions\n\nDefine your I18n Module on `config.ex` next to other Endpoint Settings\n\n```elixir\nconfig :my_app, MyApp.Endpoint,\n  url: [host: \"localhost\"],\n  secret_key_base: \"l6M/YRIzkiqMk5Irn9UNm7ANo1BoHIF0XchxNmcUJWhdKZdERA45ASDFIxZ\",\n  debug_errors: false,\n  i18n: MyApp.I18n\n```\n\nAdd `PhoenixLinguist.Plug` to the plug list on your routes file, on the browser pipeline after Phoenix plugs\n\n```elixir\n  pipeline :browser do\n    plug :accepts, ~w(html)\n    plug :fetch_session\n    plug :fetch_flash\n    plug :protect_from_forgery\n    plug PhoenixLinguist.Plug\n  end\n```\n\nIf you need to use the helper functions, add `PhoenixLinguist.Helpers` to your web module:\n\n```elixir\n  def view do\n    quote do\n      use Phoenix.View, root: \"web/templates\"\n\n      import MyAPP.Router.Helpers\n      use Phoenix.HTML\n      import PhoenixLinguist.Helpers\n    end\n  end\n\n```\n\nCheck the [online documentation](http://hexdocs.pm/phoenix_linguist/PhoenixLinguist.Helpers.html) for the list of helpers available\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjxs%2Fphoenix_linguist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjxs%2Fphoenix_linguist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjxs%2Fphoenix_linguist/lists"}