Odoo18-Base/setup/migrate-lang.sh

33 lines
862 B
Bash
Raw Normal View History

2025-02-21 16:30:02 +07:00
#!/bin/bash
# Set source and destination repositories
SRC_REPO="/root/dev/NextERP/dev/Viindoo/odoo-18.0"
DEST_REPO="/root/dev/NextERP/dev/odoo18/Odoo18"
2025-02-21 17:19:10 +07:00
LANG="vi"
2025-02-21 16:30:02 +07:00
# Ensure both paths exist
if [ ! -d "$SRC_REPO" ]; then
echo "Error: Source repository does not exist!"
exit 1
fi
if [ ! -d "$DEST_REPO" ]; then
echo "Error: Destination repository does not exist!"
exit 1
fi
# Find and copy vi.po files while preserving directory structure
cd "$SRC_REPO" || exit
2025-02-21 17:19:10 +07:00
find . -type f -name "${LANG}.po" | while read -r file; do
2025-02-21 16:30:02 +07:00
# Get the directory path of the file
dir_path=$(dirname "$file")
# Ensure the destination directory exists
mkdir -p "$DEST_REPO/$dir_path"
# Copy the file
cp "$file" "$DEST_REPO/$dir_path/"
echo "Copied: $file -> $DEST_REPO/$dir_path/"
done
2025-02-21 17:19:10 +07:00
echo "All ${LANG}.po files copied successfully!"