Skip to content

Commit f1d96cb

Browse files
authored
[CI & i18n] GH action to run i18n-check + new fix GH action (#4620)
1 parent 66fcda7 commit f1d96cb

File tree

6 files changed

+43
-1
lines changed

6 files changed

+43
-1
lines changed

.github/workflows/check-i18n.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: i18n
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
i18n-check:
8+
name: I18N check
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- run: scripts/i18n-check.sh -u
13+
- run: .github/workflows/scripts/i18n-check-helper.sh

.github/workflows/pr-actions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K\w+')
3333
echo "Action is $PR_ACTION"
34-
ACTION_NAMES="all|dict|filenames|format|markdown|refcache|submodules"
34+
ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules|text"
3535
if [[ ! "$PR_ACTION" =~ ^($ACTION_NAMES)$ ]]; then
3636
echo "Invalid action name: $PR_ACTION"
3737
echo "Action name should be one of: $ACTION_NAMES"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash -e
2+
3+
echo "For localization docs, see https://opentelemetry.io/docs/contributing/localization"
4+
5+
CHANGES=`git status --porcelain`
6+
7+
if [[ -z $CHANGES ]]; then
8+
echo "All localization pages have the requisit commit hash. <3"
9+
exit;
10+
fi
11+
12+
cat <<EOS
13+
Some i18n pages are missing the 'default_lang_commit' front matter field.
14+
To fix this in your local development environment, run
15+
16+
scripts/i18n-check.sh -u
17+
18+
and commit the changes for your locale. Here are the list of pages that
19+
need to be updated:
20+
---
21+
EOS
22+
23+
echo "$CHANGES"
24+
echo "---"
25+
26+
exit 1

content/ja/docs/_index.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: ドキュメント
33
menu: { main: { weight: 10 } }
4+
default_lang_commit: 93ab1301
45
---
56

67
OTelの略称でも知られるOpenTelemetryは、[トレース](/docs/concepts/signals/traces/)[メトリクス](/docs/concepts/signals/metrics/)[ログ](/docs/concepts/signals/logs/)のようなテレメトリーデータを計装、生成、収集、エクスポートするためのベンダー非依存なオープンソースの[オブザーバビリティ](/docs/concepts/observability-primer/#what-is-observability)フレームワークです。

content/ja/docs/what-is-opentelemetry.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: OpenTelemetryとは
33
description: OpenTelemetryが何であり、何でないかについての簡単な説明。
44
weight: 150
5+
default_lang_commit: 93ab1301
56
---
67

78
OpenTelemetryは[オブザーバビリティ](/docs/concepts/observability-primer/#what-is-observability)フレームワークであり、[トレース](/docs/concepts/signals/traces/)[メトリクス](/docs/concepts/signals/metrics/)[ログ](/docs/concepts/signals/logs/)のようなテレメトリーデータを作成・管理するためにデザインされたツールキットです。

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"fix:dict": "find content layouts -name \"*.md\" -print0 | xargs -0 ./scripts/normalize-cspell-front-matter.pl",
5656
"fix:filenames": "npm run _rename-to-kebab-case",
5757
"fix:format": "npm run format",
58+
"fix:i18n": "scripts/i18n-check.sh -u",
5859
"fix:markdown": "npm run check:markdown -- --fix",
5960
"fix:refcache": "npm run check:links",
6061
"fix:submodules": "npm run _sync",

0 commit comments

Comments
 (0)