mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
18 lines
492 B
Bash
Executable File
18 lines
492 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Usage: replace-with-translation.sh <target_language> <path>
|
|
set -e
|
|
BASE_DIR=$(dirname $(readlink -f $0))
|
|
TEMP_FILE=$(mktemp)
|
|
trap 'rm -f -- "${TEMP_FILE}"' INT TERM HUP EXIT
|
|
TARGET_LANGUAGE="$1"
|
|
export INPUT="$2"
|
|
cat "${INPUT}" > "${TEMP_FILE}"
|
|
if [[ ! -z $SLEEP ]]
|
|
then
|
|
sleep $[ ( $RANDOM % 20 ) + 1 ]s
|
|
fi
|
|
rm -f "${INPUT}"
|
|
mkdir -p $(dirname "${INPUT}") || true
|
|
YANDEX=1 "${BASE_DIR}/translate.sh" "${TARGET_LANGUAGE}" "${TEMP_FILE}" "${INPUT}"
|
|
git add "${INPUT}"
|