# shellcheck shell=dash

# using languagesetup
# It's not commonly used or seen on newer versions of macOS (it's been replaced by the `defaults` command). -- chatgpt

___x_cmd_mac_lang(){
    [ $# -gt 0 ]    ||  set -- get

    local op="$1";      shift
    case "$op" in
        get)            ___x_cmd_mac_lang_"$op" "$@" ;;
        -h|--help)      ___x_cmd help -m mac    lang ;;
        *)              N=mac M="Unknown subcmd -> $op" log:ret:64 ;;
    esac
}

___x_cmd_mac_lang_get(){
    ___x_cmd_cmds defaults read -g AppleLanguages
    # defaults read /Library/Preferences/.GlobalPreferences
    # defaults read <appid> AppleLanguages
}

# TODO
___x_cmd_mac_lang_set(){
    N=mac M="Unimplemented" log:ret:1

    # defaults write -g AppleLanguages "(zh-Hans)"
    # sudo shutdown

    # defaults write <appid> AppleLanguages "(zh-Hans)"
}
