Skip to content

Commit

Permalink
Optimize English translation (#822)
Browse files Browse the repository at this point in the history
* 更新文档翻译工作流,改进获取最近修改的Markdown文件功能

* 删除多余的空行,优化amqp-job文档格式

* 更新命令信号文档,增加手动退出和杀死进程的中文说明

* 更新docs-translate.yaml,修改分支忽略规则以排除main分支

* 更新confd.md,将“支持”标题修改为“支持驱动”

* Update docs and translate

* 更新config-consul.md,将“配置组件”修改为“配置中心引擎”

* Update docs and translate

* 更新doc-translate.js,使用环境变量替代硬编码的API密钥,并移除调试输出

更新文档翻译工作流,添加获取更改文件的步骤,并修改翻译文件处理逻辑

更新index.md,移除不必要的注释链接

Update docs and translate

更新文档翻译工作流,修改获取更改文件步骤的名称

更新index.md,添加主页布局的参考链接

Update docs and translate

* 移除获取更改文件的步骤,简化文档翻译工作流

* revert

* 删除不必要的文件并更新文档标题以反映最新名称

* 更新doc-translate.js,将最大并发数从5增加到10

* 更新关于页面,添加欢迎信息以增强文档的友好性

* Update docs and translate

---------

Co-authored-by: Deeka Wong <[email protected]>
Co-authored-by: huangdijia <[email protected]>
  • Loading branch information
3 people authored Dec 31, 2024
1 parent ecdd257 commit e27f93e
Show file tree
Hide file tree
Showing 47 changed files with 90 additions and 89 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs-translate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
paths:
- 'docs/**'
branches:
- "!main"
branches-ignore:
- "main"

jobs:
translate:
Expand Down Expand Up @@ -68,6 +68,6 @@ jobs:
pnpm run docs:translate
- name: Commit Updated
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update docs and translate
2 changes: 1 addition & 1 deletion bin/doc-translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path';

const endpoint = "https://api.deepseek.com";
const token = process.env["DEEPSEEK_API_KEY"];
const MAX_CONCURRENT = 5; // 最大并发数
const MAX_CONCURRENT = 10; // 最大并发数
const MAX_RETRIES = 3; // 最大重试次数

const openai = new OpenAI({
Expand Down
3 changes: 1 addition & 2 deletions docs/en/components/amqp-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

`friendsofhyperf/amqp-job` is an asynchronous task component based on the `hyperf/amqp` component, which supports dispatching tasks to the AMQP service and then consuming them via consumers. It encapsulates the `hyperf/amqp` component, providing a more convenient way to dispatch and consume tasks.
`friendsofhyperf/amqp-job` is an asynchronous task component based on the `hyperf/amqp` component, which supports distributing tasks to AMQP services and then consuming them via consumers. It encapsulates the `hyperf/amqp` component, providing a more convenient way to dispatch and consume tasks.

## Installation

Expand Down Expand Up @@ -59,5 +59,4 @@ class MyConsumer extends JobConsumer
{
//
}

```
4 changes: 2 additions & 2 deletions docs/en/components/command-signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ class FooCommand extends HyperfCommand

## Execution

- `Ctrl + C`
- Manually exit by pressing `Ctrl + C`

```shell
$ hyperf foo
^CReceived signal 2, exiting...
```

- `killall php`
- Kill the process using `killall php`

```shell
$ hyperf foo
Expand Down
6 changes: 3 additions & 3 deletions docs/en/components/compoships.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compoships

**Compoships** provides the ability to specify relationships based on two (or more) columns in Hyperf's Model ORM. This is particularly useful when dealing with third-party or pre-existing schemas/databases where you need to match multiple columns in the definition of Eloquent relationships.
**Compoships** provides the ability to specify relationships based on two (or more) columns in the Model ORM of Hyperf. When dealing with third-party or pre-existing schemas/databases, it is common to encounter situations where you need to match multiple columns in the definition of Eloquent relationships.

## The Problem

Expand All @@ -23,7 +23,7 @@ class User extends Model

## Installation

It is recommended to install **Compoships** via [Composer](http://getcomposer.org/).
It is recommended to install the **Compoships** component via [Composer](http://getcomposer.org/).

```shell
composer require friendsofhyperf/compoships
Expand Down Expand Up @@ -107,7 +107,7 @@ class User extends Model
}
```

The same syntax can be used to define the inverse of the relationship:
The same syntax can define the inverse of the relationship:

```php
namespace App;
Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/confd.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ConfigChangedListener implements ListenerInterface
}
```

## Supported
## Supported Drivers

- [x] Etcd
- [x] Nacos
Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/config-consul.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Config Consul

A Consul configuration component for Hyperf.
A Consul configuration center engine for Hyperf.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/console-spinner.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FooCommand extends Command
}
```

The `$spinner` is compatible with Symfony ProgressBar, so you can run any method of this class. Alternatively, you can also use the `withSpinner` method by providing an iterable object.
The `$spinner` is compatible with Symfony's ProgressBar, so you can run any method of this class. Alternatively, you can also use the `withSpinner` method by providing an iterable object.

```php
$this->withSpinner(User::all(), function($user) {
Expand Down
6 changes: 3 additions & 3 deletions docs/en/components/fast-paginate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is a fast `limit`/`offset` pagination macro for Hyperf. It can replace the

This package uses an SQL approach similar to "deferred joins" to achieve this speedup. Deferred joins are a technique where the requested columns are accessed only after applying the `offset` and `limit`.

In our case, we don't actually perform a join but use a `where in` with a subquery. Using this technique, we create a subquery that can be optimized with a specific index for maximum speed, and then use these results to fetch the full rows.
In our case, we don't actually perform a join but use a `where in` with a subquery. Using this technique, we create a subquery that can be optimized with specific indexes for maximum speed, and then use these results to fetch the full rows.

The SQL statement looks like this:

Expand All @@ -25,7 +25,7 @@ select * from contacts -- The full data that you want to show your
Depending on your dataset, the performance improvement may vary, but this approach allows the database to examine as little data as possible to meet the user's needs.

While this method is unlikely to perform worse than the traditional `offset` / `limit`, it is possible, so be sure to test it on your data!
While this method is unlikely to perform worse than traditional `offset` / `limit`, it is possible, so be sure to test it on your data!

> If you want to read a 3,000-word article on the theory behind this package, visit [aaronfrancis.com/2022/efficient-pagination-using-deferred-joins](https://aaronfrancis.com/2022/efficient-pagination-using-deferred-joins).
Expand All @@ -41,7 +41,7 @@ No additional steps are required; the service provider will be automatically loa

Anywhere you would use `Model::query()->paginate()`, you can use `Model::query()->fastPaginate()`! It's that simple! The method signature is the same.

Relations are also supported:
Relationships are also supported:

```php
User::first()->posts()->fastPaginate();
Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/http-client.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HTTP Client

An HTTP client component for Hyperf, ported from Laravel.
A HTTP client component for Hyperf, ported from Laravel.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/ide-helper.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IDE Helper

The IDE Helper component for Hyperf
The IDE Helper component for Hyperf.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/ipc-broadcaster.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ipc Broadcaster

Hyperf Inter-Process Communication Broadcast Component.
Hyperf Inter-Process Communication Broadcasting Component.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/en/components/lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ if ($lock->get()) {
}
```

The `get` method can also accept a closure. The lock will be automatically released after the closure is executed:
The `get` method can also accept a closure. After the closure is executed, the lock will be automatically released:

```php
lock('foo')->get(function () {
// Lock acquired indefinitely and automatically released...
});
```

If the lock is not available when requested, you can control the number of seconds to wait. If the lock cannot be acquired within the specified time limit, a `FriendsOfHyperf\Lock\Exception\LockTimeoutException` will be thrown:
If the lock is unavailable when requested, you can control the wait time in seconds. If the lock cannot be acquired within the specified time limit, a `FriendsOfHyperf\Lock\Exception\LockTimeoutException` will be thrown.

```php
use FriendsOfHyperf\Lock\Exception\LockTimeoutException;
Expand Down
14 changes: 7 additions & 7 deletions docs/en/components/model-hashids.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Using hashids instead of integer IDs in URLs and list items can be more attractive and clever. For more information, visit [hashids.org](https://hashids.org/).

This package adds hashids to Hyperf models by dynamically encoding/decoding them, rather than persisting them to the database. This eliminates the need for additional database columns and allows for higher performance by using primary keys in queries.
This package adds hashids to Hyperf models by dynamically encoding/decoding them, rather than persisting them in the database. This eliminates the need for additional database columns and allows for higher performance by using primary keys in queries.

Features include:

Expand Down Expand Up @@ -42,7 +42,7 @@ Class Item extends Model

### Customizing Hashid Settings

You can customize hashid settings for each model by overriding `getHashidsConnection()`. It must return the name of the connection in `config/autoload/hashids.php`.
Hashid settings can be customized per model by overriding `getHashidsConnection()`. It must return the name of the connection in `config/autoload/hashids.php`.

## Usage

Expand Down Expand Up @@ -77,7 +77,7 @@ $item->getHashidsConnection();

### Adding Hashid to Serialized Models

Set it as the default:
Setting it as default:

```php

Expand All @@ -98,7 +98,7 @@ class Item extends Model

```

Set it for a specific route:
Setting it for a specific route:

`return $item->append('hashid')->toJson();`

Expand Down Expand Up @@ -133,7 +133,7 @@ Route::get('/items/{item:slug}', function (Item $item) {

#### Customizing the Default Route Key Name

If you want to resolve implicit route bindings using another field by default, you can override `getRouteKeyName()` to return the field name used in the resolution process and `getRouteKey()` to return its value in links.
If you want to resolve implicit route bindings using another field by default, you can override `getRouteKeyName()` to return the field name during resolution and `getRouteKey()` to return its value in links.

```php

Expand All @@ -158,7 +158,7 @@ class Item extends Model

```

You can still specify the hashid for specific routes.
You can still specify hashid for specific routes.

```php

Expand All @@ -170,7 +170,7 @@ Route::get('/items/{item:hashid}', function (Item $item) {

#### Supporting Other Laravel Implicit Route Binding Features

When using `HashidRouting`, you can still use soft-deletes and child route bindings.
When using `HashidRouting`, you can still use soft deletion and child route bindings.

```php

Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/model-morph-addon.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Model Morph Addon

The Model Morph Addon supports polymorphic relationships in Hyperf models.
The Model Morph Addon supports polymorphic associations in Hyperf models.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/en/components/mysql-grammar-addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class Event extends Model
* @property int $user_id User ID
* @property string $group_name Event Group
* @property string $event_name Event Name
* @property string $page_name Page Name
* @property string $extra Extra Information
* @property string $page_name Page
* @property string $extra Additional Information
* @property string $device pc,android,ios,touch
* @property string $device_id Device ID
* @property \Carbon\Carbon $created_at Creation Time
Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/notification-easysms.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class TestNotification extends Notification implements Smsable
];
}

// or return custom Message
// or return customer Message
// public function toSms(mixed $notifiable): array|Message
// {
// return new Message();
Expand Down
4 changes: 2 additions & 2 deletions docs/en/components/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ composer require friendsofhyperf/notification:~3.1.0

## Usage

### Using the `Notifiable` Trait in a Model
### Using `Notifiable` Trait in Model

```php
<?php
Expand Down Expand Up @@ -237,7 +237,7 @@ return [

```

#### Using in a Controller
#### Using in Controller

```php
$user = User::create();
Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/openai-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $client = OpenAI::factory()
->make();
```

To use Azure, you must deploy a model, which is identified by {deployment-id}, integrated into the API call. Therefore, you do not need to provide the model during the call, as it is already included in the BaseUri.
To use Azure, you must deploy a model identified by {deployment-id}, which is integrated into the API call. Therefore, you do not need to provide the model during the call, as it is already included in the BaseUri.

Thus, a basic example completion call would be:

Expand Down
2 changes: 1 addition & 1 deletion docs/en/components/purifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ To use your own settings, publish the configuration.
php bin/hyperf.php vendor:publish friendsofhyperf/purifier
```

The configuration file `config/autoload/purifier.php` is as follows:
The configuration file `config/autoload/purifier.php` will look like this:

```php

Expand Down
12 changes: 6 additions & 6 deletions docs/en/components/redis-subscriber.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

A Redis native protocol subscriber based on Swoole coroutines, forked from [mix-php/redis-subscriber](https://github.com/mix-php/redis-subscriber).

This Redis subscription library, based on Swoole coroutines, connects directly to the Redis server using sockets, without relying on the phpredis extension. The subscriber offers the following advantages:
This Redis subscription library, built on Swoole coroutines, connects directly to the Redis server using sockets without relying on the phpredis extension. The subscriber offers the following advantages:

- Smooth Modifications: You can add or cancel subscription channels at any time, enabling seamless channel switching.
- Cross-Coroutine Safe Closure: The subscription can be closed at any moment.
- Channel Message Retrieval: The library's encapsulation style is inspired by the [go-redis](https://github.com/go-redis/redis) library in Golang, retrieving subscription messages through channels.
- **Smooth Modifications**: You can add or cancel subscription channels at any time, enabling seamless channel switching.
- **Cross-Coroutine Safe Shutdown**: The subscription can be closed at any moment safely.
- **Channel Message Retrieval**: The library's encapsulation style is inspired by the [go-redis](https://github.com/go-redis/redis) library in Golang, allowing you to retrieve subscribed messages through channels.

## Installation

Expand Down Expand Up @@ -55,5 +55,5 @@ object(FriendsOfHyperf\Redis\Subscriber\Message)#8 (2) {
| unsubscribe(string ...$channels) : void | Cancel subscriptions |
| psubscribe(string ...$channels) : void | Add pattern subscriptions |
| punsubscribe(string ...$channels) : void | Cancel pattern subscriptions |
| channel() : Hyperf\Engine\Channel | Get message channel |
| close() : void | Close subscription |
| channel() : Hyperf\Engine\Channel | Get the message channel |
| close() : void | Close the subscription |
6 changes: 3 additions & 3 deletions docs/en/components/sentry.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sentry

Sentry component for Hyperf.
Sentry Component for Hyperf.

## Installation

Expand All @@ -19,7 +19,7 @@ php bin/hyperf.php vendor:publish friendsofhyperf/sentry
```php
<?php

# Use it to send custom logs to Sentry
# use it send customer log to sentry
//\FriendsOfHyperf\Helpers\logs('project-name', 'sentry')->warning('this is a test warning issue!');

return [
Expand Down Expand Up @@ -76,7 +76,7 @@ class Foo
}
```

## Tracing
## Distributed Tracing

```env
SENTRY_TRACING_ENABLE_AMQP=true
Expand Down
3 changes: 1 addition & 2 deletions docs/en/components/tcp-sender.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Introduction

`friendsofhyperf/tcp-sender` is a TCP service component similar to `hyperf/websocket-server`, which can be used to send messages to a specified fd.
There's no need to worry about the underlying implementation; just focus on the business logic.
`friendsofhyperf/tcp-sender` is a TCP service component similar to `hyperf/websocket-server`, designed to send messages to specified file descriptors (fd). It allows developers to focus on business logic without worrying about the underlying implementation details.

## Installation

Expand Down
Loading

0 comments on commit e27f93e

Please sign in to comment.