From e1fe6980559e4e559fcdcb5e4bb67096e350caa9 Mon Sep 17 00:00:00 2001 From: Srishakatux Date: Thu, 5 Sep 2024 16:48:45 -0700 Subject: [PATCH] Hide language redirects in the ULS panel Around 30 languages with redirects and variants appear twice in the ULS panel. This fix checks if a redirect exists for a language code, and if it does it updates the target in the languages object and removes the redirect. Bug: T195342 --- src/jquery.uls.core.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 41fcb20..2e2d54a 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -61,6 +61,15 @@ // Language is unknown to ULS. delete this.languages[ code ]; } + + // Check if the language code is a redirect + var target = $.uls.data.isRedirect( code ); + + if ( target ) { + // Update target in the languages object and delete redirect + this.languages[ target ] = this.languages[ code ]; + delete this.languages[ code ]; + } } this.left = this.options.left;