Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lorenzosinisi/phrase_client
Un-official Phrase.com client for Elixir
https://github.com/lorenzosinisi/phrase_client
Last synced: 3 days ago
JSON representation
Un-official Phrase.com client for Elixir
- Host: GitHub
- URL: https://github.com/lorenzosinisi/phrase_client
- Owner: lorenzosinisi
- License: apache-2.0
- Created: 2021-08-30T17:07:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-02T08:01:33.000Z (over 3 years ago)
- Last Synced: 2024-11-30T19:17:36.505Z (28 days ago)
- Language: Elixir
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Un-official phrase.com Elixir Client
**TODO: Support all other endpoints, add more tests, PRs welcome**
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `phrase_client` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:phrase_client, "~> 0.1.0"}
]
end
```At the moment this library is simply a minimal wrapper around the Phrase.com APIs and does only 2 things:
- List all projects
- Get one project
- Get the translations for a language in a projectYou will have to generate a token and find the id of both the project and the language in your Phrase.com dashboard. When you found them add them to your
config like the following:```
config :phrase_client,
base_url: "https://api.phrase.com/v2/",
token: System.get_env("PHRASE_TOKEN") || raise "export PHRASE_TOKEN first!"
```How to download a translation?
```
project_id = ""
locale_id = ""
{:ok, locale} = PhraseClient.download_locale(project_id, locale_id, %{file_format: :json})
```