#!/bin/sh
progdir=`dirname "$0"`
cp -f $progdir/zh-CN/font.ttf /mnt/mmc/CFW/skin
cp -f $progdir/zh-CN/font.ttf /mnt/mmc/CFW/font/Oswald-Regular.otf
tar xf $progdir/zh-CN/fix.tar -C /mnt/mmc
$progdir/zh-CN/printstr "Installing: Arcade ROM name Display..."
sleep 1
if grep -q "简体中文" /mnt/mmc/CFW/language.flag; then
	cp -f $progdir/zh-CN/mame.csv /mnt/mmc/CFW/config/mame.csv
else
	cp -f $progdir/zh-CN/mame_en.csv /mnt/mmc/CFW/config/mame.csv
fi
$progdir/zh-CN/printstr "Adjusting: Game List Text Position..."
sleep 1
sed -i 's/"text-alignment": ".*"/"text-alignment": "left"/g' "/mnt/mmc/CFW/skin/settings.json"
sed -i 's/"text-margin": .*/"text-margin": 322/g' "/mnt/mmc/CFW/skin/settings.json"
$progdir/system/printstr " Operation completed "
sleep 2
sync
