Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
16 lines
444 B
Bash
Executable File
16 lines
444 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.UTF-8 UTF-8" "en_US.UTF-8 UTF-8"; do
|
|
if ! grep -qE "^${loc% *}" /etc/locale.gen; then
|
|
echo "$loc" | sudo tee -a /etc/locale.gen > /dev/null
|
|
fi
|
|
done
|
|
|
|
sudo locale-gen
|
|
echo "Locales available: $(locale -a | grep -cE 'zh_CN|en_US') (zh_CN/en_US variants)"
|