#!/bin/bash

# Update pricing from $19 to $15 in all WordPress plugin translation files

echo "Updating pricing in WordPress plugin translation files from \$19 to \$15..."

# List of all .po files to update
files=(
    "allaccessible-af.po"
    "allaccessible-ar.po"
    "allaccessible-de_DE.po"
    "allaccessible-es_ES.po"
    "allaccessible-es_MX.po"
    "allaccessible-he_IL.po"
    "allaccessible-hu_HU.po"
    "allaccessible-it_IT.po"
    "allaccessible-nl_NL.po"
    "allaccessible-pl.po"
    "allaccessible-pt.po"
    "allaccessible-pt_BR.po"
    "allaccessible-sr_RS.po"
    "allaccessible-zh_CN.po"
)

for file in "${files[@]}"; do
    if [ -f "$file" ]; then
        echo "Updating $file..."
        # Update "$19 a month" to "$15 a month"
        sed -i '' 's/\$19 a month/\$15 a month/g' "$file"
        # Update "$19/mo" to "$15/mo"
        sed -i '' 's/\$19\/mo/\$15\/mo/g' "$file"
        # Update "$19 per" to "$15 per"
        sed -i '' 's/\$19 per/\$15 per/g' "$file"
        echo "  ✓ Updated $file"
    else
        echo "  ⚠ File not found: $file"
    fi
done

echo "Pricing update complete!"