summarylogtreecommitdiffstats
path: root/gcc-kawaii-plugin-zh.install
blob: 1ba0c548d4e357d748b30e26e90c0be5f8cc29e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
post_install() {
    # backup file

    if [[ -f /usr/share/locale/zh_CN/LC_MESSAGES/gcc.mo ]]; then
        install -Dm644 /usr/share/locale/zh_CN/LC_MESSAGES/gcc.mo{,.bak}
    fi

    # replace file
    install -Dm644 /usr/share/locale/zh_CN/LC_MESSAGES/gcc{-kawaii,}.mo

    # note "Please run 'echo export LANG=zh_CN.UTF-8 > /etc/locale.conf'"
    echo -e "\e[34m::\e[0m Please set \"LANG=zh_CN.UTF-8\" in /etc/locale.conf"
    echo -e "请在 /etc/locale.conf 里设置 LANG=zh_CN.UTF-8"
}

post_upgrade() {
    # replace file
    install -Dm644 /usr/share/locale/zh_CN/LC_MESSAGES/gcc{-kawaii,}.mo
}

pre_remove() {
    # restore the source file
    install -Dm644 /usr/share/locale/zh_CN/LC_MESSAGES/gcc.mo{.bak,}
}