Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,484 changes: 741 additions & 743 deletions app/src/main/res/values-b+es+419/strings.xml

Large diffs are not rendered by default.

997 changes: 997 additions & 0 deletions app/src/main/res/values-es-rES/strings.xml

Large diffs are not rendered by default.

1,278 changes: 639 additions & 639 deletions app/src/main/res/values-it/strings.xml

Large diffs are not rendered by default.

997 changes: 997 additions & 0 deletions app/src/main/res/values-pt-rBR/strings.xml

Large diffs are not rendered by default.

40 changes: 25 additions & 15 deletions scripts/pull-translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,31 +117,41 @@ while IFS= read -r dir; do
dir_path=$(dirname "$dir")

case "$dir_name" in
values-arb)
rename_or_merge "$dir" "$dir_path/values-ar" && RENAMED_COUNT=$((RENAMED_COUNT + 1))
# Keep these as-is (direct 1:1 mapping from Transifex or already in correct format)
values-ar|values-b+es+419|values-ca|values-cs|values-de|values-el|values-es|values-es-rES|values-fr|values-it|values-nl|values-pl|values-pt|values-pt-rBR|values-ru)
;;
# RENAME Transifex locales to Android folder names
values-es_419)
rename_or_merge "$dir" "$dir_path/values-b+es+419" && RENAMED_COUNT=$((RENAMED_COUNT + 1))
echo " Renaming: $dir_name -> values-b+es+419"
rm -rf "$dir_path/values-b+es+419" 2>/dev/null
mv "$dir" "$dir_path/values-b+es+419"
RENAMED_COUNT=$((RENAMED_COUNT + 1))
;;
values-es_ES)
rename_or_merge "$dir" "$dir_path/values-es" && RENAMED_COUNT=$((RENAMED_COUNT + 1))
echo " Renaming: $dir_name -> values-es-rES"
rm -rf "$dir_path/values-es-rES" 2>/dev/null
mv "$dir" "$dir_path/values-es-rES"
RENAMED_COUNT=$((RENAMED_COUNT + 1))
;;
values-b+es+419|values-es|values-pt)
# Keep these as-is
values-pt_BR)
echo " Renaming: $dir_name -> values-pt-rBR"
rm -rf "$dir_path/values-pt-rBR" 2>/dev/null
mv "$dir" "$dir_path/values-pt-rBR"
RENAMED_COUNT=$((RENAMED_COUNT + 1))
;;
values-b+pt+PT|values-pt_PT)
echo " Removing: $dir_name"
rm -rf "$dir" && REMOVED_COUNT=$((REMOVED_COUNT + 1))
;;
values-b+pt+*|values-pt_*)
# Convert Brazilian Portuguese to values-pt
rename_or_merge "$dir" "$dir_path/values-pt" && RENAMED_COUNT=$((RENAMED_COUNT + 1))
# DELETE 0% or near-0% translation locales
values-arb|values-pt_PT|values-ja|values-ko|values-no|values-fa|values-ro|values-uk|values-yo)
echo " Removing: $dir_name (0% translations)"
rm -rf "$dir"
REMOVED_COUNT=$((REMOVED_COUNT + 1))
;;
# Handle any other BCP 47 formats
values-b+*)
# Convert other BCP 47 formats to underscore format
new_name=$(echo "$dir_name" | sed 's/values-b+\([a-z][a-z]*\)+\([A-Z0-9][A-Z0-9]*\)/values-\1_\2/')
if [ "$new_name" != "$dir_name" ]; then
rename_or_merge "$dir" "$dir_path/$new_name" && RENAMED_COUNT=$((RENAMED_COUNT + 1))
echo " Renaming: $dir_name -> $new_name"
mv "$dir" "$dir_path/$new_name"
RENAMED_COUNT=$((RENAMED_COUNT + 1))
fi
;;
esac
Expand Down
102 changes: 102 additions & 0 deletions scripts/push-translations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/bin/bash

# Script to push translations to Transifex
# Handles directory naming conversion between Android format and Transifex format

set -e

# Validate script is run from project root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
RES_DIR="$PROJECT_ROOT/app/src/main/res"

if [ ! -d "$RES_DIR" ]; then
echo "Error: Resource directory not found: $RES_DIR"
echo "Please run this script from the project root directory."
exit 1
fi

if [ ! -f "$PROJECT_ROOT/.tx/config" ]; then
echo "Error: Transifex config not found: $PROJECT_ROOT/.tx/config"
echo "Please ensure Transifex is configured for this project."
exit 1
fi

# Check if tx command is available
if ! command -v tx &> /dev/null; then
echo "Error: Transifex CLI (tx) is not installed or not in PATH"
echo "Please install it: https://developers.transifex.com/docs/cli"
exit 1
fi

# Check if TX_TOKEN is set
if [ -z "$TX_TOKEN" ]; then
echo "Error: TX_TOKEN environment variable is not set"
echo "Please set it with your Transifex API token: export TX_TOKEN=\"your-token\""
exit 1
fi

# Track renamed directories for cleanup
RENAMED_ES_ES=false
RENAMED_PT_BR=false
RENAMED_ES_419=false

# Cleanup function to restore Android directory names
cleanup() {
echo ""
echo "Restoring Android directory names..."

if [ "$RENAMED_ES_ES" = true ] && [ -d "$RES_DIR/values-es_ES" ]; then
echo " Restoring: values-es_ES -> values-es-rES"
mv "$RES_DIR/values-es_ES" "$RES_DIR/values-es-rES"
fi

if [ "$RENAMED_PT_BR" = true ] && [ -d "$RES_DIR/values-pt_BR" ]; then
echo " Restoring: values-pt_BR -> values-pt-rBR"
mv "$RES_DIR/values-pt_BR" "$RES_DIR/values-pt-rBR"
fi

if [ "$RENAMED_ES_419" = true ] && [ -d "$RES_DIR/values-es_419" ]; then
echo " Restoring: values-es_419 -> values-b+es+419"
mv "$RES_DIR/values-es_419" "$RES_DIR/values-b+es+419"
fi

echo "Cleanup complete."
}

# Set trap to ensure cleanup runs even if script fails
trap cleanup EXIT

echo "Pushing translations to Transifex..."
echo ""

# Step 1: Rename Android directories to Transifex format
echo "Converting directory names to Transifex format..."

if [ -d "$RES_DIR/values-es-rES" ]; then
echo " Renaming: values-es-rES -> values-es_ES"
mv "$RES_DIR/values-es-rES" "$RES_DIR/values-es_ES"
RENAMED_ES_ES=true
fi

if [ -d "$RES_DIR/values-pt-rBR" ]; then
echo " Renaming: values-pt-rBR -> values-pt_BR"
mv "$RES_DIR/values-pt-rBR" "$RES_DIR/values-pt_BR"
RENAMED_PT_BR=true
fi

if [ -d "$RES_DIR/values-b+es+419" ]; then
echo " Renaming: values-b+es+419 -> values-es_419"
mv "$RES_DIR/values-b+es+419" "$RES_DIR/values-es_419"
RENAMED_ES_419=true
fi

echo ""
echo "Running tx push..."

# Step 2: Push source and translations to Transifex
cd "$PROJECT_ROOT"
tx push --source --translation --all --skip --force

echo ""
echo "Push complete!"
Loading