Skip to content

Commit

Permalink
Merge branch 'main' into getting-started
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm authored Jun 11, 2024
2 parents 581edb2 + 630d1ab commit 33942c4
Show file tree
Hide file tree
Showing 14 changed files with 394 additions and 197 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ on:
pull_request:

jobs:
i18n-check:
check-i18n:
name: I18N check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # all
- run: scripts/i18n-check.sh -u
- run: .github/workflows/scripts/i18n-check-helper.sh
- name: Any files missing hash key?
run: scripts/check-i18n.sh -n -x -v
- name: Any files with invalid hash keys?
run: scripts/check-i18n.sh -v
- run: .github/workflows/scripts/check-i18n-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ if [[ -z $CHANGES ]]; then
fi

cat <<EOS
Some i18n pages are missing the 'default_lang_commit' front matter field.
To fix this in your local development environment, run
Some localization pages are missing the 'default_lang_commit' front matter
field. To fix this in your local development environment, run
scripts/i18n-check.sh -u
npm run fix:i18n:new
and commit the changes for your locale. Here are the list of pages that
and commit the changes for your localization. Here are the list of pages that
need to be updated:
---
EOS
Expand Down
62 changes: 47 additions & 15 deletions content/en/docs/contributing/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dropdown menu in the top nav.

## Keeping track of localized page drift {#track-changes}

One of the main challenges of maintaining localized pages is identifying when
One of the main challenges of maintaining localized pages, is identifying when
the corresponding English language pages have been updated. This section
explains how we handle this.

Expand All @@ -28,19 +28,21 @@ explains how we handle this.
When a localized page is written, such as `content/zh/<some-path>/page.md`, this
translation is based on a specific [`main` branch commit][main] of the
corresponding English language version of the page at
`content/en/<some-path>/page.md`. Every localized page identifies this commit in
the page's front matter as follows:
`content/en/<some-path>/page.md`. In this repository, every localized page
identifies the English page commit in the localized page's front matter as
follows:

```markdown
---
title: Your localized page title
...

## default_lang_commit: <commit-hash-of-main-for-default-language-page>
default_lang_commit: <commit-hash-of-main-for-default-language-page>
```

The front matter above would be in `content/zh/<some-path>/page.md`. The commit
corresponds to the latest commit of `content/en/<some-path>/page.md` in `main`.
would correspond to the latest commit of `content/en/<some-path>/page.md` in
`main`.

### Tracking changes to English pages

Expand All @@ -49,25 +51,26 @@ corresponding localized pages that need updating by running the following
command:

```console
$ scripts/i18n-check.sh
$ npm run check:i18n
1 1 content/en/docs/kubernetes/_index.md - content/zh/docs/kubernetes/_index.md
...
```

Specify the path to your localization to restrict the output, for example:
You can restrict the target pages to one or more localizations by providing
path(s) like this:

```sh
scripts/i18n-check.sh content/zh
npm run check:i18n -- content/zh
```

### Viewing change details

For any given localized pages that need updating, you can see the diff details
of the corresponding English language pages by using the `-d` flag and providing
the paths to your localized pages. For example:
the paths to your localized pages, or omit the paths to see all. For example:

```console
$ scripts/i18n-check.sh -d content/zh/docs/kubernetes
$ npm run check:i18n -- -d content/zh/docs/kubernetes
diff --git a/content/en/docs/kubernetes/_index.md b/content/en/docs/kubernetes/_index.md
index 3592df5d..c7980653 100644
--- a/content/en/docs/kubernetes/_index.md
Expand All @@ -87,12 +90,20 @@ index 3592df5d..c7980653 100644
As you create pages for your localization, remember to add `default_lang_commit`
to the page front matter along with an appropriate commit hash from `main`.

If your translation is based on an English page in `main` at `HEAD`, then run
the following command to automatically add `default_lang_commit` to your page
file's front matter using the commit hash at `HEAD`:
If your page translation is based on an English page in `main` at `<hash>`, then
run the following command to automatically add `default_lang_commit` to your
page file's front matter using the commit `<hash>`. You can specify `HEAD` as an
argument if your pages are now synced with `main` at `HEAD`. For example:

```sh
scripts/i18n-check.sh -u <PATH-TO-YOUR-NEW-FILES>
npm run check:i18n -- -n -c 1ca30b4d content/ja
npm run check:i18n -- -n -c HEAD content/zh/docs/concepts
```

To list localization page files with missing hash keys, run:

```sh
npm run check:i18n -- -n
```

### Updating `default_lang_commit` for existing pages
Expand All @@ -105,11 +116,32 @@ commit hash.

If your localized page now corresponds to the English language version in `main`
at `HEAD`, then erase the commit hash value in the front matter, and run the
update command given in the previous section to automatically refresh the
**add** command given in the previous section to automatically refresh the
`default_lang_commit` field value.

{{% /alert %}}

If you have batch updated all of your localization pages that had drifted, you
can update the commit hash of these files using the `-u` flag followed by a
commit hash or 'HEAD' to use `main@HEAD`.

```sh
npm run check:i18n -- -c <hash> <PATH-TO-YOUR-NEW-FILES>
npm run check:i18n -- -c HEAD <PATH-TO-YOUR-NEW-FILES>
```

{{% alert title="Important" %}}

When you use `HEAD` as a hash specifier, the script will use the hash of `main`
at HEAD in your **local environment**. Make sure that you fetch and pull `main`,
if you want HEAD to correspond to `main` in GitHub.

{{% /alert %}}

### Script help

For more details about the script, run `npm run check:i18n -- -h`.

## New localizations

(Section To Be Completed soon with information about how to propose a new
Expand Down
4 changes: 2 additions & 2 deletions content/zh/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OpenTelemetry 也被称为 OTel,是一个供应商中立的、开源的[可观
可用于插桩、生成、采集和导出[链路](concepts/signals/traces/)
[指标](concepts/signals/metrics/)[日志](concepts/signals/logs/)等遥测数据。

OpenTelemetry 作为一个行业标准,得到了 40 多个可观测供应商的支持,
被许多[代码库、服务和应用](/ecosystem/integrations/)集成,被众多[最终用户](/ecosystem/adopters/)采用。
OpenTelemetry 作为一个行业标准,得到了 [40 多个可观测供应商的支持](/ecosystem/vendors/)
被许多[代码库、服务和应用](/ecosystem/integrations/)集成,[众多最终用户](/ecosystem/adopters/)采用。

![OpenTelemetry 基准架构](/img/otel-diagram.svg)
2 changes: 1 addition & 1 deletion content/zh/docs/faas/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linkTitle: FaaS
description: >-
OpenTelemetry 支持不同云供应商提供的各种功能即服务(FaaS)的监控方法
weight: 360
default_lang_commit: 64fbfee6
default_lang_commit: c2cd5b14a73e051acacb6914740fb3e20536f8ba
---

功能即服务(FaaS)是云原生应用的重要无服务(Serverless)计算平台。
Expand Down
2 changes: 1 addition & 1 deletion data/registry/exporter-dotnet-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors:
package:
name: Azure.Monitor.OpenTelemetry.Exporter
registry: nuget
version: 1.3.0-beta.2
version: 1.3.0
urls:
repo: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter
createdAt: 2021-11-01
2 changes: 1 addition & 1 deletion data/registry/exporter-dotnet-onecollector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ createdAt: 2023-03-03
package:
registry: nuget
name: OpenTelemetry.Exporter.OneCollector
version: 1.8.0
version: 1.9.0-rc.1
2 changes: 1 addition & 1 deletion data/registry/instrumentation-js-express.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ createdAt: 2020-11-09
package:
registry: npm
name: '@opentelemetry/instrumentation-express'
version: 0.40.0
version: 0.40.1
2 changes: 1 addition & 1 deletion data/registry/instrumentation-js-mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ createdAt: 2020-11-09
package:
registry: npm
name: '@opentelemetry/instrumentation-mongodb'
version: 0.44.0
version: 0.45.0
2 changes: 1 addition & 1 deletion data/registry/resource-detector-js-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ createdAt: 2022-12-07
package:
registry: npm
name: '@opentelemetry/resource-detector-azure'
version: 0.2.8
version: 0.2.9
2 changes: 1 addition & 1 deletion data/registry/resource-detector-js-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ createdAt: 2022-12-07
package:
registry: npm
name: '@opentelemetry/resource-detector-container'
version: 0.3.10
version: 0.3.11
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"cd:public": "cd public &&",
"check:filenames": "test -z \"$(npm run -s _ls-bad-filenames)\" || npm run -s _filename-error",
"check:format": "npm run _check:format && npm run _check:format:ja+zh || (echo '[help] Run: npm run fix:format'; exit 1)",
"check:i18n": "scripts/check-i18n.sh",
"check:links:internal": "npm run _check:links:internal",
"check:links": "npm run _check:links",
"check:markdown": "scripts/check-markdown-wrapper.sh",
Expand All @@ -58,7 +59,10 @@
"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:i18n:all": "scripts/check-i18n.sh -a -c HEAD",
"fix:i18n:drifted": "scripts/check-i18n.sh -c HEAD",
"fix:i18n:new": "scripts/check-i18n.sh -n -c HEAD",
"fix:i18n": "npm run fix:i18n:new",
"fix:markdown": "npm run check:markdown -- --fix",
"fix:refcache": "npm run check:links",
"fix:submodules": "npm run _sync",
Expand Down
Loading

0 comments on commit 33942c4

Please sign in to comment.