Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI & i18n] GH action to run i18n-check + new fix GH action #4620

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: i18n

on:
pull_request:

jobs:
i18n-check:
name: I18N check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: scripts/i18n-check.sh -u
- run: .github/workflows/scripts/i18n-check-helper.sh
2 changes: 1 addition & 1 deletion .github/workflows/pr-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K\w+')
echo "Action is $PR_ACTION"
ACTION_NAMES="all|dict|filenames|format|markdown|refcache|submodules"
ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules|text"
if [[ ! "$PR_ACTION" =~ ^($ACTION_NAMES)$ ]]; then
echo "Invalid action name: $PR_ACTION"
echo "Action name should be one of: $ACTION_NAMES"
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/scripts/i18n-check-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash -e

echo "For localization docs, see https://opentelemetry.io/docs/contributing/localization"

CHANGES=`git status --porcelain`

if [[ -z $CHANGES ]]; then
echo "All localization pages have the requisit commit hash. <3"
exit;
fi

cat <<EOS
Some i18n pages are missing the 'default_lang_commit' front matter field.
To fix this in your local development environment, run
scripts/i18n-check.sh -u
and commit the changes for your locale. Here are the list of pages that
need to be updated:
---
EOS

echo "$CHANGES"
echo "---"

exit 1
1 change: 1 addition & 0 deletions content/ja/docs/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: ドキュメント
menu: { main: { weight: 10 } }
default_lang_commit: 93ab1301
---

OTelの略称でも知られるOpenTelemetryは、[トレース](/docs/concepts/signals/traces/)、[メトリクス](/docs/concepts/signals/metrics/)、[ログ](/docs/concepts/signals/logs/)のようなテレメトリーデータを計装、生成、収集、エクスポートするためのベンダー非依存なオープンソースの[オブザーバビリティ](/docs/concepts/observability-primer/#what-is-observability)フレームワークです。
Expand Down
1 change: 1 addition & 0 deletions content/ja/docs/what-is-opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: OpenTelemetryとは
description: OpenTelemetryが何であり、何でないかについての簡単な説明。
weight: 150
default_lang_commit: 93ab1301
---

OpenTelemetryは[オブザーバビリティ](/docs/concepts/observability-primer/#what-is-observability)フレームワークであり、[トレース](/docs/concepts/signals/traces/)、[メトリクス](/docs/concepts/signals/metrics/)、[ログ](/docs/concepts/signals/logs/)のようなテレメトリーデータを作成・管理するためにデザインされたツールキットです。
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"fix:dict": "find content layouts -name \"*.md\" -print0 | xargs -0 ./scripts/normalize-cspell-front-matter.pl",
"fix:filenames": "npm run _rename-to-kebab-case",
"fix:format": "npm run format",
"fix:i18n": "scripts/i18n-check.sh -u",
"fix:markdown": "npm run check:markdown -- --fix",
"fix:refcache": "npm run check:links",
"fix:submodules": "npm run _sync",
Expand Down