This repository was archived by the owner on Sep 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 145145 "font-weight" : "bold" ,
146146 "color" : "red"
147147 } ) ;
148+ updateLinks ( lang ) ; // Call updateLinks here to handle specific URL changes.
148149 } else {
149150 $ ( this ) . removeClass ( 'active-lang' ) . removeAttr ( 'style' ) ;
150151 }
151152 } ) ;
152153 }
153154
154- setActiveLanguage ( ) ;
155-
156155 function constructNewPath ( lang ) {
157156 var currentPath = window . location . pathname ;
158157 var pathSegments = currentPath . split ( '/' ) ;
167166 return pathSegments . join ( '/' ) ;
168167 }
169168
169+ function updateLinks ( lang ) {
170+ // Update the navbar-brand href
171+ var baseUrl = "https://docs.splunk.com/Observability" ;
172+ if ( lang === "ja" ) {
173+ $ ( ".navbar-brand" ) . attr ( "href" , baseUrl + "/ja/" ) ;
174+ } else {
175+ // Default or other languages' behavior
176+ $ ( ".navbar-brand" ) . attr ( "href" , baseUrl ) ;
177+ }
178+
179+ var serviceDescUrl = "https://docs.splunk.com/observability" ;
180+ if ( lang === "ja" ) {
181+ $ ( "a.nav-link.newnavbar" ) . attr ( "href" , serviceDescUrl + "/ja/get-started/service-description.html" ) ;
182+ } else {
183+ $ ( "a.nav-link.newnavbar" ) . attr ( "href" , serviceDescUrl + "/en/get-started/service-description.html" ) ;
184+ }
185+ }
186+
170187 $ ( '.lang' ) . click ( function ( ) {
171188 var lang = $ ( this ) . data ( 'lang' ) ;
172189 var newPath = constructNewPath ( lang ) ;
173190 window . location . pathname = newPath ;
174191
175192 setActiveLanguage ( ) ;
176193 } ) ;
194+
195+ setActiveLanguage ( ) ;
177196 } ) ;
178197 </ script >
179198
You can’t perform that action at this time.
0 commit comments