diff --git a/build.sh b/build.sh index 2b068b8dbad854705e5ba5da822b64d63e018e2e..074907f29cf4b41b41399677e8fe081ca1a72a7d 100755 --- a/build.sh +++ b/build.sh @@ -126,6 +126,9 @@ patch() { for file in $e_patches_list; do git am -3 --ignore-whitespace "${root_dir}/build/patches/$file" done + + # Rename Chrome to Browser + bash ${root_dir}/rename.sh } sync() { diff --git a/rename.sh b/rename.sh new file mode 100755 index 0000000000000000000000000000000000000000..6d1d2b314729bab796d335607e4b61e450efbd2a --- /dev/null +++ b/rename.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +chromium_dir="${chromium_dir:-/srv/chromium}" +root_dir=$(dirname "$(readlink -f "$0")") +if [ ! -d "$chromium_dir" ]; then + chromium_dir=$root_dir +fi + +cd $chromium_dir/src + +# Translation directories +dirs="components components/strings chrome/browser/ui/android/strings chrome/browser/ui/android/strings/translations" + +for dir in $dirs; do + grdp_files=$(ls $dir/*.grdp 2> /dev/null | wc -l) + if [ "$grdp_files" != "0" ]; then + sed -i 's/Chrome browser/Browser/g' $dir/*.grdp + sed -i 's/Chrome/Browser/g' $dir/*.grdp + fi + xtb_files=$(ls $dir/*.xtb 2> /dev/null | wc -l) + if [ "$xtb_files" != "0" ]; then + sed -i 's/Chrome browser/Browser/g' $dir/*.xtb + sed -i 's/Chrome/Browser/g' $dir/*.xtb + fi +done + +git add . +git commit -m "Browser: Replace Chrome with Browser"