-- EN vitrin: boş menü başlıklarına kurumsal varsayılan metin (yapı/URL migration_nav_footer_locale ile uyumlu)
USE faunamix;

SET @nav_loc = (
  SELECT COUNT(*) FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'nav_menu_items' AND COLUMN_NAME = 'locale'
);
SET @sql = IF(
  @nav_loc > 0,
  "UPDATE nav_menu_items SET title = 'Home'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/', '')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @sql = IF(
  @nav_loc > 0,
  "UPDATE nav_menu_items SET title = 'Products'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) = '/arama-sonuclari'",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @sql = IF(
  @nav_loc > 0,
  "UPDATE nav_menu_items SET title = 'Contact'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/contact', '/iletisim')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @sql = IF(
  @nav_loc > 0,
  "UPDATE nav_menu_items SET title = 'About us'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/about-us', '/about', '/hakkimizda')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @footer_loc = (
  SELECT COUNT(*) FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'footer_menu_items' AND COLUMN_NAME = 'locale'
);
SET @sql = IF(
  @footer_loc > 0,
  "UPDATE footer_menu_items SET title = 'Home'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/', '')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @sql = IF(
  @footer_loc > 0,
  "UPDATE footer_menu_items SET title = 'Contact'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/contact', '/iletisim')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @sql = IF(
  @footer_loc > 0,
  "UPDATE footer_menu_items SET title = 'Privacy'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/privacy', '/gizlilik')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

SET @sql = IF(
  @footer_loc > 0,
  "UPDATE footer_menu_items SET title = 'Terms of use'
   WHERE locale = 'en' AND TRIM(COALESCE(title, '')) = '' AND TRIM(url) IN ('/terms', '/kullanim')",
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
