diff --git a/lib/.roundcube.sh.swp b/lib/.roundcube.sh.swp deleted file mode 100644 index a6e419f..0000000 Binary files a/lib/.roundcube.sh.swp and /dev/null differ diff --git a/lib/calcom.sh b/lib/calcom.sh index d60efce..3014b23 100644 --- a/lib/calcom.sh +++ b/lib/calcom.sh @@ -653,6 +653,69 @@ else echo "Error: Profile UI file not found" fi +echo "Now modify the text for /getting-started" + +# Handle getting-started wizard modifications (first level) +WIZARD_FILES=( + "/calcom/apps/web/.next/server/pages/getting-started/[[...step]].js" + "/calcom/apps/web/.next/standalone/apps/web/.next/server/pages/getting-started/[[...step]].js" +) + +for file in "${WIZARD_FILES[@]}"; do + if [ -f "$file" ]; then + echo "Processing wizard file $file" + + TIMESTAMP=$(date +%s) + cp "$file" "$file.${TIMESTAMP}" + sed -i 's/`${c("edit_form_later_subtitle")}`/`NOTE: Username and Full name changes need to be made in the Panel of your Federated Core.`/' "$file" + # Loks like only two array fields displayed? sed -i 's/subtitle:\[`${c("we_just_need_basic_info")}`,`${c("edit_form_later_subtitle")}`\]/subtitle:[`${c("we_just_need_basic_info")}`,`${c("edit_form_later_subtitle")}`," NOTE: Username and Full name changes need to be made in the Panel of your Federated Core."]/g' "$file" + # broken change sed -i 's/subtitle:\[`${c("we_just_need_basic_info")}`,`${c("edit_form_later_subtitle")}`\]/subtitle:[`${c("we_just_need_basic_info")}`,`${c("edit_form_later_subtitle")}`,"\n\nNOTE: Username and Full name changes need to be made in your Core'\''s Panel."]/g' "$BEAUTIFIED_WIZARD" + # did nothing sed -i 's/subtitle:\[`${c("we_just_need_basic_info")}`,`${c("edit_form_later_subtitle")}`\]/subtitle:[`${c("we_just_need_basic_info")}`,`${c("edit_form_later_subtitle")}`,'"' NOTE: Username and Full name changes need to be made in your Core\\'s Panel.'"]/g' "$file" + + if ! diff -q "$file.${TIMESTAMP}" "$file" >/dev/null; then + echo "Successfully modified minified code" + else + echo "Warning: No changes made to $file" + fi + else + echo "Warning: Wizard file not found: $file" + fi +done + +# Handle translation modifications (second level) +echo "Modifying translations..." +LOCALES_DIR="/calcom/apps/web/public/static/locales" +STANDALONE_LOCALES_DIR="/calcom/apps/web/.next/standalone/apps/web/public/static/locales" +WARNING_MESSAGE="NOTE: Username and Full name changes need to be made in the Panel of your Federated Core." + +# Function to modify translation files +modify_translations() { + local dir=$1 + if [ -d "$dir" ]; then + for lang_dir in "$dir"/*/; do + if [ -f "${lang_dir}common.json" ]; then + echo "Modifying translation for $(basename "$lang_dir")" + # Backup original + cp "${lang_dir}common.json" "${lang_dir}common.json.bak.$(date +%s)" + # Update translation + sed -i 's#"edit_form_later_subtitle": *"[^"]*"#"edit_form_later_subtitle": "'"$WARNING_MESSAGE"'"#' "${lang_dir}common.json" + sed -i 's#"welcome_instructions": *"[^"]*"#"welcome_instructions": "'"$WARNING_MESSAGE"'"#' "${lang_dir}common.json" + fi + done + else + echo "Warning: Locales directory not found: $dir" + fi +} + +# Modify both main and standalone translations +modify_translations "$LOCALES_DIR" +modify_translations "$STANDALONE_LOCALES_DIR" + +# Catch third level issues too. +# Find and modify all instances in built files +# find /calcom/apps/web/.next -type f -exec sed -i 's/You.*ll be able to edit this later/NOTE: Username and Full name changes need to be made in the Panel of your Federated Core/g' {} \; +# find /calcom/apps/web/.next/standalone/apps/web/.next -type f -exec sed -i 's/You.*ll be able to edit this later/NOTE: Username and Full name changes need to be made in the Panel of your Federated Core/g' {} \; + echo "All modifications complete" EOOF