Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
23 lines
546 B
Bash
Executable File
23 lines
546 B
Bash
Executable File
#!/bin/bash
|
|
# omarchy:summary=Generate zh_CN.UTF-8 and en_US.UTF-8 locales
|
|
# omarchy:examples=omarchycn locale apply
|
|
# omarchy:requires-sudo=true
|
|
|
|
set -euo pipefail
|
|
|
|
for loc in zh_CN en_US; do
|
|
if ! grep -qE "^${loc}\.UTF-8 UTF-8" /etc/locale.gen; then
|
|
echo "${loc}.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen > /dev/null
|
|
fi
|
|
done
|
|
|
|
sudo locale-gen
|
|
|
|
for loc in zh_CN en_US; do
|
|
if ! locale -a | grep -qiE "^${loc}\.utf-?8$"; then
|
|
echo "FAIL locale: ${loc}.UTF-8 not generated" >&2
|
|
exit 1
|
|
fi
|
|
echo "PASS locale: ${loc}.UTF-8"
|
|
done
|