Skip to content

Commit e905154

Browse files
authored
Merge pull request #24 from qiancai/fix-ja-placeholder-handling
Use structured placeholders for Japanese link restoration
2 parents 44b2068 + 964b768 commit e905154

File tree

7 files changed

+480
-27
lines changed

7 files changed

+480
-27
lines changed
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Test Japanese Translation
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
relative_md_path:
7+
description: Optional path under markdown-translator/docs-for-test/en, for example tidb-cloud-intro.md
8+
required: false
9+
default: ""
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
translate-ja:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: yarn
27+
cache-dependency-path: markdown-translator/yarn.lock
28+
29+
- name: Install dependencies
30+
working-directory: markdown-translator
31+
run: yarn --frozen-lockfile
32+
33+
- name: Configure translation credentials
34+
shell: bash
35+
env:
36+
GCP_KEY: ${{ secrets.GCP_KEY }}
37+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
38+
GCP_GLOSSARY_ID: ${{ secrets.GCP_GLOSSARY_ID }}
39+
run: |
40+
set -euo pipefail
41+
42+
if [ -z "${GCP_KEY}" ] || [ -z "${GCP_PROJECT_ID}" ] || [ -z "${GCP_GLOSSARY_ID}" ]; then
43+
echo "Missing one or more required secrets: GCP_KEY, GCP_PROJECT_ID, GCP_GLOSSARY_ID" >&2
44+
exit 1
45+
fi
46+
47+
CREDENTIALS_FILE="$RUNNER_TEMP/gcp-key.json"
48+
echo "${GCP_KEY}" | base64 --decode > "${CREDENTIALS_FILE}"
49+
50+
echo "GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_FILE}" >> "$GITHUB_ENV"
51+
echo "PROJECT_ID=${GCP_PROJECT_ID}" >> "$GITHUB_ENV"
52+
echo "GLOSSARY_ID=${GCP_GLOSSARY_ID}" >> "$GITHUB_ENV"
53+
54+
- name: Generate artifact name
55+
id: artifact
56+
shell: bash
57+
run: |
58+
set -euo pipefail
59+
TIMESTAMP="$(date -u +'%Y%m%d-%H%M%S')"
60+
echo "name=ja-translation-output-${TIMESTAMP}" >> "$GITHUB_OUTPUT"
61+
62+
- name: Prepare input and output directories
63+
id: prepare
64+
shell: bash
65+
env:
66+
RELATIVE_MD_PATH: ${{ inputs.relative_md_path }}
67+
run: |
68+
set -euo pipefail
69+
70+
SOURCE_DIR="$GITHUB_WORKSPACE/markdown-translator/docs-for-test/en"
71+
TEMP_INPUT_DIR="$(mktemp -d)"
72+
OUTPUT_DIR="$GITHUB_WORKSPACE/markdown-translator/docs-for-test/ja"
73+
74+
if [ ! -d "${SOURCE_DIR}" ]; then
75+
echo "Source directory not found: ${SOURCE_DIR}" >&2
76+
exit 1
77+
fi
78+
79+
cp -R "${SOURCE_DIR}/." "${TEMP_INPUT_DIR}/"
80+
81+
if [ -n "${RELATIVE_MD_PATH}" ]; then
82+
case "${RELATIVE_MD_PATH}" in
83+
/*|*..*)
84+
echo "relative_md_path must be a relative path under markdown-translator/docs-for-test/en" >&2
85+
exit 1
86+
;;
87+
esac
88+
89+
TARGET_FILE="${TEMP_INPUT_DIR}/${RELATIVE_MD_PATH}"
90+
if [ ! -f "${TARGET_FILE}" ]; then
91+
echo "Requested file not found: ${RELATIVE_MD_PATH}" >&2
92+
exit 1
93+
fi
94+
95+
case "${TARGET_FILE}" in
96+
*.md) ;;
97+
*)
98+
echo "relative_md_path must point to a .md file" >&2
99+
exit 1
100+
;;
101+
esac
102+
103+
find "${TEMP_INPUT_DIR}" -type f -name '*.md' ! -path "${TARGET_FILE}" -delete
104+
fi
105+
106+
rm -rf "${OUTPUT_DIR}"
107+
mkdir -p "${OUTPUT_DIR}"
108+
109+
echo "temp_input_dir=${TEMP_INPUT_DIR}" >> "$GITHUB_OUTPUT"
110+
echo "output_dir=${OUTPUT_DIR}" >> "$GITHUB_OUTPUT"
111+
112+
- name: Run Japanese translation
113+
run: |
114+
set -euo pipefail
115+
node markdown-translator/src/index_ja.js \
116+
--input-dir "${{ steps.prepare.outputs.temp_input_dir }}" \
117+
--output-dir "${{ steps.prepare.outputs.output_dir }}"
118+
119+
- name: Show generated files
120+
shell: bash
121+
run: |
122+
set -euo pipefail
123+
if find markdown-translator/docs-for-test/ja -type f -name '*.md' | grep -q .; then
124+
{
125+
echo "## Generated Japanese files"
126+
find markdown-translator/docs-for-test/ja -type f -name '*.md' | sort
127+
} >> "$GITHUB_STEP_SUMMARY"
128+
else
129+
echo "No translated Markdown files were generated." >> "$GITHUB_STEP_SUMMARY"
130+
fi
131+
132+
- name: Upload translated files
133+
uses: actions/upload-artifact@v4
134+
with:
135+
name: ${{ steps.artifact.outputs.name }}
136+
path: markdown-translator/docs-for-test/ja
137+
if-no-files-found: error
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: What is TiDB Cloud
3+
summary: Learn about TiDB Cloud and its architecture.
4+
category: intro
5+
---
6+
7+
# What is TiDB Cloud
8+
9+
[TiDB Cloud](https://www.pingcap.com/tidb-cloud/) is a fully managed, cloud-native Database-as-a-Service (DBaaS) based on [TiDB](https://docs.pingcap.com/tidb/stable/overview), an open-source Hybrid Transactional and Analytical Processing (HTAP) database. TiDB Cloud offers an easy way to deploy and manage databases to let you focus on your applications, not the complexities of the databases. <CustomContent language="en,zh">You can create TiDB Cloud clusters to quickly build mission-critical applications on Amazon Web Services (AWS), Google Cloud, Microsoft Azure, and Alibaba Cloud.</CustomContent><CustomContent language="ja">You can create TiDB Cloud clusters to quickly build mission-critical applications on Amazon Web Services (AWS), Google Cloud, and Microsoft Azure.</CustomContent>
10+
11+
![TiDB Cloud Overview](/media/tidb-cloud/tidb-cloud-overview.png)
12+
13+
## Why TiDB Cloud
14+
15+
TiDB Cloud allows you with little or no training to handle complex tasks such as infrastructure management and cluster deployment easily.
16+
17+
- Developers and database administrators (DBAs) can handle a large amount of online traffic effortlessly and rapidly analyze a large volume of data across multiple datasets.
18+
19+
- Enterprises of all sizes can easily deploy and manage TiDB Cloud to adapt to your business growth without prepayment.
20+
21+
Watch the following video to learn more about TiDB Cloud:
22+
23+
<iframe width="600" height="450" src="https://www.youtube.com/embed/skCV9BEmjbo?enablejsapi=1" title="Why TiDB Cloud?" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
24+
25+
With TiDB Cloud, you can get the following key features:
26+
27+
- **Fast and Customized Scaling**
28+
29+
Elastically and transparently scale to hundreds of nodes for critical workloads while maintaining ACID transactions. No need to bother with sharding. And you can scale your computing and storage nodes separately according to your business needs.
30+
31+
- **MySQL Compatibility**
32+
33+
Increase productivity and shorten time-to-market for your applications with TiDB's MySQL compatibility. Easily migrate data from existing MySQL instances without the need to rewrite code.
34+
35+
- **High Availability and Reliability**
36+
37+
Naturally high availability by design. Data replication across multiple Availability Zones, daily backups, and auto-failover ensure business continuity, regardless of hardware failure, network partition, or data center loss.
38+
39+
- **Real-Time Analytics**
40+
41+
Get real-time analytical query results with a built-in analytics engine. TiDB Cloud runs consistent analytical queries on current data without disturbing mission-critical applications.
42+
43+
- **Enterprise Grade Security**
44+
45+
Secure your data in dedicated networks and machines, with support for encryption both in-flight and at-rest. TiDB Cloud is certified by SOC 2 Type 2, ISO 27001:2013, ISO 27701, and fully compliant with GDPR.
46+
47+
- **Fully-Managed Service**
48+
49+
Deploy, scale, monitor, and manage TiDB clusters with a few clicks, through an easy-to-use web-based management platform.
50+
51+
- **Multi-Cloud Support**
52+
53+
<CustomContent language="en,zh">
54+
55+
Stay flexible without cloud vendor lock-in. TiDB Cloud is currently available on AWS, Azure, Google Cloud, and Alibaba Cloud.
56+
57+
</CustomContent>
58+
59+
<CustomContent language="ja">
60+
61+
Stay flexible without cloud vendor lock-in. TiDB Cloud is currently available on AWS, Azure, and Google Cloud.
62+
63+
</CustomContent>
64+
65+
- **Simple Pricing Plans**
66+
67+
Pay only for what you use, with transparent and upfront pricing with no hidden fees.
68+
69+
- **World-Class Support**
70+
71+
Get world-class support through our support portal, <a href="mailto:tidbcloud-support@pingcap.com">email</a>, chat, or video conferencing.
72+
73+
## Deployment options
74+
75+
TiDB Cloud provides the following deployment options:
76+
77+
- TiDB Cloud Starter
78+
79+
{{{ .starter }}} is a fully managed, multi-tenant TiDB offering. It delivers an instant, autoscaling MySQL-compatible database and offers a generous free quota and consumption based billing once free limits are exceeded.
80+
81+
<CustomContent language="en,zh">
82+
83+
Currently, {{{ .starter }}} is generally available on AWS and in public preview on Alibaba Cloud.
84+
85+
</CustomContent>
86+
87+
- {{{ .essential }}}
88+
89+
For applications experiencing growing workloads and needing scalability in real time, {{{ .essential }}} provides the flexibility and performance to keep pace with your business growth.
90+
91+
<CustomContent language="en,zh">
92+
93+
Currently, {{{ .essential }}} is in public preview on AWS and Alibaba Cloud.
94+
95+
For feature comparison between {{{ .starter }}} and {{{ .essential }}} on Alibaba Cloud, see [TiDB on Alibaba Cloud](https://www.pingcap.com/partners/alibaba-cloud/).
96+
97+
</CustomContent>
98+
99+
<CustomContent language="ja">
100+
101+
Currently, {{{ .essential }}} is in public preview on AWS.
102+
103+
</CustomContent>
104+
105+
<CustomContent plan="premium">
106+
107+
- {{{ .premium }}}
108+
109+
{{{ .premium }}} is designed for mission-critical businesses that demand unlimited real-time scalability. It delivers workload-aware auto-scaling and comprehensive enterprise capabilities.
110+
111+
Currently, {{{ .premium }}} is in private preview on AWS and Alibaba Cloud.
112+
113+
</CustomContent>
114+
115+
- TiDB Cloud Dedicated
116+
117+
TiDB Cloud Dedicated is designed for mission-critical businesses, offering high availability across multiple availability zones, horizontal scaling, and full [HTAP](https://en.wikipedia.org/wiki/Hybrid_transactional/analytical_processing) capabilities.
118+
119+
Currently, TiDB Cloud Dedicated is generally available on AWS and Google Cloud, and in public preview on Azure. For more information, see [TiDB Cloud Dedicated](https://www.pingcap.com/tidb-cloud-dedicated).
120+
121+
## Architecture
122+
123+
![TiDB Cloud architecture](/media/tidb-cloud/tidb-cloud-architecture.png)
124+
125+
- TiDB VPC (Virtual Private Cloud)
126+
127+
For each TiDB Cloud cluster, all TiDB nodes and auxiliary nodes, including TiDB Operator nodes and logging nodes, are deployed in the same VPC.
128+
129+
- TiDB Cloud Central Services
130+
131+
Central Services, including billing, alerts, meta storage, dashboard UI, are deployed independently. You can access the dashboard UI to operate the TiDB cluster via the internet.
132+
133+
- Your VPC
134+
135+
You can connect to your TiDB cluster via private endpoint connection or VPC peering connection. Refer to [Set Up Private Endpoint Connections](/tidb-cloud/set-up-private-endpoint-connections.md) or [Set up VPC Peering Connection](/tidb-cloud/set-up-vpc-peering-connections.md) for details.

markdown-translator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"type": "module",
77
"scripts": {
8-
"test": "node --test test/frontmatterAliases.test.js"
8+
"test": "node --test"
99
},
1010
"dependencies": {
1111
"@google-cloud/translate": "^9.2.1",

0 commit comments

Comments
 (0)