istio / istio.io

Source for the istio.io site
https://istio.io/
Apache License 2.0
764 stars 1.52k forks source link

some content is missing in the Chinese document #12614

Closed wulianglongrd closed 8 months ago

wulianglongrd commented 1 year ago

Some content is missing in the Chinese document, so the translation may need to be checked and supplemented. For example this PR #9127

wulianglongrd commented 1 year ago

cc @istio/wg-docs-maintainers-chinese

rootsongjc commented 1 year ago

It's true that a lot of the content is different from the English version, so it would take a lot of work to update all the Chinese documents, and someone would need to take the lead. And even if it is synchronized with English, we need to create a mechanism to check which documents need to be updated. Otherwise, you can only check manually.

windsonsea commented 1 year ago

Recommend a script to check difference between zh and en.

  1. Save the script below to your local branch, such as ./scripts/lsync.sh.
  2. Run a command to check en-zh differences by a folder or a file since the last localization:

    ./scripts/lsync.sh content/zh/docs/
  3. Run a command to find those zh files that have not been synced yet:

    ./scripts/lsync.sh content/en/docs/

This script comes from k8s/website. It works well to istio.io after some minor changes. The complete script is as follows:

#!/bin/bash
#

# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http:/www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script checks if the English version of a page has changed since a localized
# page has been committed.

if [ "$#" -ne 1 ] ; then
  echo -e "\nThis script checks if the English version of a page has changed since a " >&2
  echo -e "localized page has been committed.\n" >&2
  echo -e "Usage:\n\t$0 <PATH>\n" >&2
  echo -e "Example:\n\t$0 content/zh/docs/concepts/_index.md\n" >&2
  exit 1
fi

# Check if path exists, and whether it is a directory or a file
if [ ! -e "$1" ] ; then
  echo "Path not found: '$1'" >&2
  exit 2
fi

if [ -d "$1" ] ; then
  SYNCED=1
  for f in `find $1 -name "*.md"` ; do
    EN_VERSION=`echo $f | sed "s/content\/.\{2,5\}\//content\/en\//g"`
    if [ ! -e $EN_VERSION ]; then
      echo -e "**removed**\t$EN_VERSION"
      SYNCED=0
      continue
    fi

    LASTCOMMIT=`git log -n 1 --pretty=format:%h -- $f`
    git diff --exit-code --numstat $LASTCOMMIT...HEAD $EN_VERSION
    if [ $? -ne 0 ] ; then
      SYNCED=0
    fi

    ZH_VERSION=`echo $f | sed "s/content\/.\{2,5\}\//content\/zh\//g"`
    if [ ! -f $ZH_VERSION ]; then
      echo "**file does not exist**\t$ZH_VERSION"
    fi
  done
  if [ $SYNCED -eq 1 ]; then
    echo "$1 is still in sync"
    exit 0
  fi
  exit 1
fi

LOCALIZED="$1"

# Try get the English version
EN_VERSION=`echo $LOCALIZED | sed "s/content\/.\{2,5\}\//content\/en\//g"`
if [ ! -e $EN_VERSION ]; then
  echo "$EN_VERSION has been removed."
  exit 3
fi

# Last commit for the localized path
LASTCOMMIT=`git log -n 1 --pretty=format:%h -- $LOCALIZED`

git diff --exit-code $LASTCOMMIT...HEAD $EN_VERSION

if [ "$?" -eq 0 ]; then
  echo "$LOCALIZED is still in sync"
  exit 0
fi
rootsongjc commented 1 year ago

This script is useful to determine if the English version has changed since the Chinese version was committed, and the number of lines added and removed from the file.

When I execute this script, I get the following output.

43  21  content/en/docs/releases/supported-releases/index.md
0   1   content/en/docs/releases/log/index.md
8   1   content/en/docs/tasks/security/cert-management/custom-ca-k8s/index.md
**removed** content/en/docs//tasks/security/cert-management/dns-cert/index.md
1   1   content/en/docs/tasks/security/authorization/authz-td-migration/index.md
3   3   content/en/docs/tasks/security/authorization/authz-jwt/index.md
5   5   content/en/docs/tasks/security/authorization/authz-http/index.md
3   3   content/en/docs/tasks/security/authorization/authz-deny/index.md
1   3   content/en/docs/tasks/security/authentication/jwt-route/index.md
4   4   content/en/docs/tasks/security/authentication/authn-policy/index.md
2   2   content/en/docs/tasks/observability/metrics/classify-metrics/index.md
1   1   content/en/docs/tasks/observability/metrics/_index.md
1   1   content/en/docs/tasks/observability/logs/_index.md
1   1   content/en/docs/tasks/observability/gateways/index.md
1   1   content/en/docs/tasks/observability/distributed-tracing/zipkin/index.md
13  16  content/en/docs/tasks/observability/distributed-tracing/lightstep/index.md
1   3   content/en/docs/tasks/observability/distributed-tracing/mesh-and-proxy-config/index.md
1   0   content/en/docs/tasks/observability/distributed-tracing/overview/index.md
**removed** content/en/docs//tasks/traffic-management/egress/egress-gateway-tls-origination-sds/index.md
**removed** content/en/docs//tasks/traffic-management/egress/egress_sni_monitoring_and_policies/index.md
1   1   content/en/docs/tasks/traffic-management/egress/egress-control/index.md
0   1   content/en/docs/tasks/traffic-management/egress/egress-tls-origination/index.md
6   2   content/en/docs/tasks/traffic-management/ingress/ingress-control/index.md
63  2   content/en/docs/tasks/traffic-management/ingress/gateway-api/index.md
2   2   content/en/docs/tasks/traffic-management/request-timeouts/index.md
257 114 content/en/docs/tasks/traffic-management/request-routing/index.md
187 73  content/en/docs/tasks/traffic-management/tcp-traffic-shifting/index.md
193 77  content/en/docs/tasks/traffic-management/mirroring/index.md
0   1   content/en/docs/tasks/traffic-management/locality-load-balancing/before-you-begin/index.md
0   1   content/en/docs/tasks/traffic-management/locality-load-balancing/distribute/index.md
0   1   content/en/docs/tasks/traffic-management/locality-load-balancing/cleanup/index.md
169 55  content/en/docs/tasks/traffic-management/traffic-shifting/index.md
0   1   content/en/docs/tasks/_index.md
5   4   content/en/docs/setup/additional-setup/config-profiles/index.md
92  21  content/en/docs/setup/upgrade/canary/index.md
2   2   content/en/docs/setup/install/virtual-machine/index.md
85  19  content/en/docs/setup/install/external-controlplane/index.md
2   3   content/en/docs/setup/install/multicluster/verify/index.md
2   2   content/en/docs/setup/install/multicluster/primary-remote/index.md
1   1   content/en/docs/setup/install/multicluster/primary-remote_multi-network/index.md
0   1   content/en/docs/setup/install/multicluster/multi-primary/index.md
83  11  content/en/docs/setup/install/helm/index.md
1   1   content/en/docs/setup/platform-setup/alicloud/index.md
1   1   content/en/docs/setup/platform-setup/MicroK8s/index.md
1   1   content/en/docs/setup/platform-setup/docker/index.md
2   2   content/en/docs/setup/platform-setup/minikube/index.md
1   1   content/en/docs/setup/platform-setup/azure/index.md
0   1   content/en/docs/setup/platform-setup/kind/index.md
1   1   content/en/docs/setup/platform-setup/ibm/index.md
1   1   content/en/docs/setup/platform-setup/gke/index.md
1   1   content/en/docs/setup/platform-setup/openshift/index.md
1   1   content/en/docs/setup/platform-setup/huaweicloud/index.md
1   1   content/en/docs/setup/platform-setup/kubesphere/index.md
1   1   content/en/docs/setup/platform-setup/kops/index.md
1   1   content/en/docs/setup/platform-setup/_index.md
1   1   content/en/docs/setup/platform-setup/tencent-cloud-mesh/index.md
1   1   content/en/docs/examples/microservices-istio/prereq/index.md
2   2   content/en/docs/examples/microservices-istio/setup-kubernetes-cluster/index.md
0   1   content/en/docs/ops/configuration/mesh/webhook/index.md
1   1   content/en/docs/ops/configuration/mesh/app-health-check/index.md
1   1   content/en/docs/ops/configuration/security/harden-docker-images/index.md
1   1   content/en/docs/ops/configuration/telemetry/monitoring-multicluster-prometheus/index.md
1   1   content/en/docs/ops/configuration/extensibility/wasm-pull-policy/index.md
1   1   content/en/docs/ops/configuration/traffic-management/tls-configuration/index.md
2   2   content/en/docs/ops/configuration/traffic-management/protocol-selection/index.md
**removed** content/en/docs//ops/configuration/traffic-management/locality-load-balancing/index.md
1   1   content/en/docs/ops/diagnostic-tools/istioctl/index.md
3   1   content/en/docs/ops/integrations/jaeger/index.md
1   1   content/en/docs/ops/integrations/certmanager/index.md
3   3   content/en/docs/ops/integrations/prometheus/index.md
2   1   content/en/docs/ops/deployment/deployment-models/index.md
1   1   content/en/docs/ops/deployment/_index.md
2   2   content/en/docs/ops/common-problems/network-issues/index.md
0   1   content/en/docs/ops/_index.md
0   1   content/en/docs/reference/config/metrics/index.md
47  0   content/en/docs/reference/config/analysis/ist0137/index.md
1   1   content/en/docs/reference/config/analysis/ist0136/index.md
0   1   content/en/docs/reference/config/analysis/ist0119/index.md
1   1   content/en/docs/reference/config/analysis/ist0118/index.md
**removed** content/en/docs//reference/config/security/constraints-and-properties/index.md
**removed** content/en/docs//reference/config/installation-options/index.md
0   1   content/en/docs/reference/glossary/identity.md
1   1   content/en/docs/reference/glossary/micro-segmentation.md
**removed** content/en/docs//reference/glossary/adapters.md
**removed** content/en/docs//reference/glossary/mixer.md
0   1   content/en/docs/reference/glossary/index.md
1   1   content/en/docs/reference/glossary/routing-rules.md
0   1   content/en/docs/reference/_index.md

There are a total of 88 files to be synchronized, most of which have relatively minor changes. But the new English documents are not considered here, @wulianglongrd can you compare what new documents have been added? We can make a list and schedule tasks to determine the amount of work to be synchronized.

wulianglongrd commented 1 year ago

sure, wait a moment.

wulianglongrd commented 1 year ago

minor changes above script.

for f in `find content/en -name "*.md"` ; do
  ZH_VERSION=`echo $f | sed "s/content\/.\{2,5\}\//content\/zh\//g"`
  if [ ! -f $ZH_VERSION ]; then
    echo "**file does not exist**\t$ZH_VERSION"
  fi
done

The following file list does not exist in zh (122 files)

**file does not exist** content/zh/about/solutions/instituting-observability-and-sre-best-practices/index.md
**file does not exist** content/zh/about/case-studies/bluecore/index.md
**file does not exist** content/zh/about/case-studies/rappi/index.md
**file does not exist** content/zh/docs/tasks/security/authorization/authz-dry-run/index.md
**file does not exist** content/zh/docs/tasks/security/authentication/claim-to-header/index.md
**file does not exist** content/zh/docs/tasks/observability/logs/otel-provider/index.md
**file does not exist** content/zh/docs/tasks/observability/telemetry/index.md
**file does not exist** content/zh/docs/tasks/observability/distributed-tracing/opencensusagent/index.md
**file does not exist** content/zh/docs/tasks/observability/distributed-tracing/skywalking/index.md
**file does not exist** content/zh/docs/setup/additional-setup/getting-started/index.md
**file does not exist** content/zh/docs/setup/additional-setup/gateway/index.md
**file does not exist** content/zh/docs/ops/configuration/security/security-policy-examples/index.md
**file does not exist** content/zh/docs/ops/configuration/traffic-management/traffic-routing/index.md
**file does not exist** content/zh/docs/ops/diagnostic-tools/cni/index.md
**file does not exist** content/zh/docs/ops/integrations/spire/index.md
**file does not exist** content/zh/docs/ops/deployment/vm-architecture/index.md
**file does not exist** content/zh/docs/reference/config/analysis/ist0134/index.md
**file does not exist** content/zh/docs/reference/config/analysis/ist0143/index.md
**file does not exist** content/zh/docs/reference/config/security/normalization/index.md
**file does not exist** content/zh/docs/reference/config/proxy_extensions/_index.md
**file does not exist** content/zh/blog/2022/istiocon-register/index.md
**file does not exist** content/zh/blog/2022/istiocon-2022/index.md
**file does not exist** content/zh/blog/2022/getting-started-gtwapi/index.md
**file does not exist** content/zh/blog/2022/istioctl-proxy/index.md
**file does not exist** content/zh/blog/2022/ambient-security/index.md
**file does not exist** content/zh/blog/2023/steering-contribution-seat-results/index.md
**file does not exist** content/zh/blog/2023/ada-logics-security-assessment/index.md
**file does not exist** content/zh/blog/2023/istioday-kubecon-eu/index.md
**file does not exist** content/zh/blog/2021/statefulsets-made-easier/index.md
**file does not exist** content/zh/blog/2021/migrate-alpha-policy/index.md
**file does not exist** content/zh/blog/2021/patch-tuesdays/index.md
**file does not exist** content/zh/blog/2021/ncc-security-assessment/index.md
**file does not exist** content/zh/blog/2021/upcoming-networking-changes/index.md
**file does not exist** content/zh/blog/2021/istio-community-meetup-china/index.md
**file does not exist** content/zh/blog/2021/better-external-authz/index.md
**file does not exist** content/zh/blog/2021/aeraki/index.md
**file does not exist** content/zh/blog/2021/wasm-progress/index.md
**file does not exist** content/zh/blog/2021/discovery-selectors/index.md
**file does not exist** content/zh/blog/2021/proxyless-grpc/index.md
**file does not exist** content/zh/blog/2021/wasm-api-alpha/index.md
**file does not exist** content/zh/blog/2021/simple-vms/index.md
**file does not exist** content/zh/blog/2021/external-locality-failover/index.md
**file does not exist** content/zh/blog/2020/dns-proxy/index.md
**file does not exist** content/zh/blog/2020/istio-sds-gloo/index.md
**file does not exist** content/zh/blog/2020/large-scale-security-policy-performance-tests/index.md
**file does not exist** content/zh/blog/2020/proxying-legacy-services-using-egress-gateways/index.md
**file does not exist** content/zh/blog/2020/show-source-ip/index.md
**file does not exist** content/zh/blog/2020/alb-ingress-gateway-iks/index.md
**file does not exist** content/zh/news/releases/1.13.x/announcing-1.13.9/index.md
**file does not exist** content/zh/news/releases/1.13.x/announcing-1.13/_index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.5/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.2/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.3/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.4/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.10/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.1/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.6/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.8/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.9/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.7/index.md
**file does not exist** content/zh/news/releases/1.14.x/announcing-1.14.6/index.md
**file does not exist** content/zh/news/releases/1.14.x/announcing-1.14.5/index.md
**file does not exist** content/zh/news/releases/1.10.x/announcing-1.10/change-notes/index.md
**file does not exist** content/zh/news/releases/1.10.x/announcing-1.10/upgrade-notes/index.md
**file does not exist** content/zh/news/releases/1.10.x/announcing-1.10/_index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8.3/index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8.4/index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8.5/index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8/change-notes/index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8/upgrade-notes/index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8/_index.md
**file does not exist** content/zh/news/releases/1.8.x/announcing-1.8.6/index.md
**file does not exist** content/zh/news/releases/1.8.x/_index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.10/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.11/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.5/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.2/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.3/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.4/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6/change-notes/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6/upgrade-notes/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6/_index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.14/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.13/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.12/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.1/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.6/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.8/index.md
**file does not exist** content/zh/news/releases/1.6.x/_index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.9/index.md
**file does not exist** content/zh/news/releases/1.6.x/announcing-1.6.7/index.md
**file does not exist** content/zh/news/releases/1.15.x/announcing-1.15.4/index.md
**file does not exist** content/zh/news/releases/1.15.x/announcing-1.15.5/index.md
**file does not exist** content/zh/news/releases/1.15.x/announcing-1.15/change-notes/index.md
**file does not exist** content/zh/news/releases/1.11.x/announcing-1.11/change-notes/index.md
**file does not exist** content/zh/news/releases/1.11.x/announcing-1.11/upgrade-notes/index.md
**file does not exist** content/zh/news/releases/1.11.x/announcing-1.11/_index.md
**file does not exist** content/zh/news/releases/1.11.x/announcing-1.11.8/index.md
**file does not exist** content/zh/news/releases/1.11.x/announcing-1.11.6/index.md
**file does not exist** content/zh/news/releases/1.11.x/announcing-1.11.7/index.md
**file does not exist** content/zh/news/releases/1.9.x/announcing-1.9/change-notes/index.md
**file does not exist** content/zh/news/releases/1.9.x/announcing-1.9/_index.md
**file does not exist** content/zh/news/releases/1.7.x/announcing-1.7.8/index.md
**file does not exist** content/zh/news/releases/1.7.x/announcing-1.7.7/index.md
**file does not exist** content/zh/news/releases/1.7.x/announcing-1.7/_index.md
**file does not exist** content/zh/news/releases/1.7.x/_index.md
**file does not exist** content/zh/news/releases/1.16.x/announcing-1.16/_index.md
**file does not exist** content/zh/news/releases/1.16.x/announcing-1.16.2/index.md
**file does not exist** content/zh/news/releases/1.4.x/announcing-1.4.8/index.md
**file does not exist** content/zh/news/releases/1.4.x/announcing-1.4.6/index.md
**file does not exist** content/zh/news/releases/1.4.x/announcing-1.4.7/index.md
**file does not exist** content/zh/news/releases/1.4.x/announcing-1.4.9/index.md
**file does not exist** content/zh/news/releases/1.4.x/announcing-1.4.10/index.md
**file does not exist** content/zh/news/security/istio-security-2021-005/index.md
**file does not exist** content/zh/news/security/istio-security-2021-002/index.md
**file does not exist** content/zh/news/security/istio-security-2021-004/index.md
**file does not exist** content/zh/news/security/istio-security-2022-002/index.md
**file does not exist** content/zh/news/security/istio-security-2020-003/index.md
**file does not exist** content/zh/news/support/announcing-1.14-eol-final/index.md
**file does not exist** content/zh/boilerplates/external-loadbalancer-support.md
**file does not exist** content/zh/events/banners/announcing-ambient-mesh.md
**file does not exist** content/zh/events/banners/test-banner.md
hanxiaop commented 1 year ago

How about also exclude the releasenotes announcements of EOL versions?(https://istio.io/latest/docs/releases/supported-releases/) Which are not worth spending time anymore. For example:

**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.1/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.6/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.8/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.9/index.md
**file does not exist** content/zh/news/releases/1.5.x/announcing-1.5.7/index.md
wulianglongrd commented 1 year ago

agreed, the above is just a list of non-existing files, and those that need to be translated can be further confirmed.