`, and the `data-finding` JSON the client-side filter reads. * Only the human-visible text is localized, via this map. Unknown keys fall * back to the key itself, so a new category never renders blank. */ final class CategoryLabels { /** @return array key (English, used for logic) => Arabic display label */ public static function map(): array { $labels = [ 'Performance' => 'الأداء', 'Technical SEO' => 'الأساسيات التقنية', 'On-Page' => 'المحتوى', 'AI-Friendly' => 'جاهزية الذكاء الاصطناعي', 'Mobile Usability' => 'الجوال', 'Security' => 'الأمان', 'Database' => 'قاعدة البيانات', 'Media' => 'الوسائط', 'Crawl' => 'الروابط والوصول', 'Logs' => 'السجلات', 'Analytics' => 'القياس', 'Ecommerce' => 'المتاجر', 'Local SEO' => 'البحث المحلي', ]; $labels = apply_filters('aetos_seo_category_labels', $labels); return is_array($labels) ? array_map('strval', $labels) : []; } /** * 4.0.18: plain English display names. The keys stay the internal * category ids used for scoring and filters; only the shown name changes. * * @return array */ public static function en_map(): array { return [ 'Performance' => 'Performance', 'Technical SEO' => 'Technical basics', 'On-Page' => 'Content', 'AI-Friendly' => 'AI readiness', 'Mobile Usability' => 'Mobile', 'Security' => 'Security', 'Database' => 'Database', 'Media' => 'Media', 'Crawl' => 'Links and access', 'Logs' => 'Logs', 'Analytics' => 'Measurement', 'Ecommerce' => 'Store', 'Local SEO' => 'Local search', ]; } /** English display label for a category key (falls back to the raw key). */ public static function en(string $key): string { $key = trim($key); $map = self::en_map(); return $map[$key] ?? $key; } /** Arabic display label for a category key (falls back to the raw key). */ public static function ar(string $key): string { $key = trim($key); $map = self::map(); return $map[$key] ?? $key; } /** * Locale-aware display label. Arabic UI → the Arabic label; English UI → * the category key itself, which is already a clean English label by * design (see map() doc). Keeps the findings filter, table, dashboard, * and HTML report consistent with the active admin language instead of * always rendering Arabic. */ public static function label(string $key): string { if (\AetosSeo\Utils\I18n::is_arabic()) { return self::ar($key); } return self::en($key); } }