Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
icodesign committed Aug 29, 2024
1 parent ea9b288 commit 39bb454
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ Here's an example of a configuration file:
```yaml
baseLanguage: en
translator:
agent: api
baseUrl: http://localhost:3000/v1/
agent: openai
mode: interactive
localizations:
- id: hostapp
Expand All @@ -65,19 +64,25 @@ For more details on how to write a configuration file, please check the [Configu

Dolphin defines an interface for translators to implement, which is responsible for translating source strings into target languages.

> I'm still working on adding more translators. PRs are welcome!

#### openai

This is a local translator which uses OpenAI API to translate strings. To use this translator, you need to provide the OpenAI API key as an environment variable (`OPENAI_API_KEY`) or pass it to the translator with the `apiKey` option.

#### api

The `api` translator is a built-in translator that uses the Dolphin API service to translate strings. You need to provide the `baseUrl` to the API endpoint.
The `api` translator is a built-in translator that uses the Dolphin API (or compatible) service to translate strings. You need to provide the `baseUrl` to the API endpoint.

> Related code of the API service (using Next.js as an example) can be found in the [api folder](https://github.com/icodesign/dolphin/tree/main/apps/api/).
> Related spec and code of the API service (using Next.js as an example) can be found in the [api folder](https://github.com/icodesign/dolphin/tree/main/apps/api/).
>
> You can deploy the API service to your own server or managed platforms (like Vercel) and change the `baseUrl` to your server address.
>
> Deploy to Vercel with a single click:
>
> [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ficodesign%2Fdolphin&env=OPENAI_API_KEY&envDescription=The%20openai%20api%20key&envLink=https%3A%2F%2Fplatform.openai.com%2Fapi-keys)

We're working on adding more agents, especially local translators without the need of cloud deployment. PRs are welcome!
You can also implement your own API server if needed.

### Running Dolphin

Expand Down Expand Up @@ -141,6 +146,7 @@ The source language of the strings, which is used to translate from.

Supported translators:

- **openai**: OpenAI API. You need to provide the OpenAI API key as an environment variable (`OPENAI_API_KEY`) or pass it to the translator with the `apiKey` option.
- **api**: Dolphin API. You need to provide the `baseUrl` to the API endpoint.

Supported modes:
Expand Down

0 comments on commit 39bb454

Please sign in to comment.