Skip to content

Commit

Permalink
Merge pull request ddnet#9503 from Robyt3/Android-Localize
Browse files Browse the repository at this point in the history
Support localizing Android-specific strings
  • Loading branch information
def- authored Jan 9, 2025
2 parents 8b9b9b6 + 3bfd0a5 commit 7401519
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 6 additions & 7 deletions scripts/android/cmake_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ log_info "Copying project files..."
cd "${BUILD_FOLDER}" || exit 1

mkdir -p src/main
mkdir -p src/main/res/values
mkdir -p src/main/res/xml
mkdir -p src/main/res/mipmap

function copy_dummy_files() {
rm -f ./"$2"
Expand All @@ -219,10 +216,12 @@ copy_dummy_files scripts/android/files/gradle.properties gradle.properties
copy_dummy_files scripts/android/files/proguard-rules.pro proguard-rules.pro
copy_dummy_files scripts/android/files/settings.gradle settings.gradle
copy_dummy_files scripts/android/files/AndroidManifest.xml src/main/AndroidManifest.xml
copy_dummy_files scripts/android/files/res/values/strings.xml src/main/res/values/strings.xml
copy_dummy_files scripts/android/files/res/xml/shortcuts.xml src/main/res/xml/shortcuts.xml
copy_dummy_files other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher.png
copy_dummy_files other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher_round.png

rm -R -f src/main/res
cp -R ../scripts/android/files/res src/main/
mkdir -p src/main/res/mipmap
cp ../other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher.png
cp ../other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher_round.png

log_info "Copying libraries..."

Expand Down
4 changes: 3 additions & 1 deletion scripts/android/files/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ sed -i "s/TW_KEY_ALIAS/${TW_KEY_ALIAS_ESCAPED}/g" build.gradle
sed -i "s/TW_VERSION_CODE/${TW_VERSION_CODE}/g" build.gradle
sed -i "s/TW_VERSION_NAME/${TW_VERSION_NAME}/g" build.gradle

sed -i "s/DDNet/${APK_BASENAME}/g" src/main/res/values/strings.xml
for f in src/main/res/values*; do
sed -i "s/DDNet/${APK_BASENAME}/g" "$f/strings.xml"
done

sed -i "s/org.ddnet.client/${APK_PACKAGE_NAME}/g" src/main/res/xml/shortcuts.xml

Expand Down

0 comments on commit 7401519

Please sign in to comment.