Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 0a36d92

Browse files
Merge pull request #1815 from splunk/feature/japanese-release
Japanese release
2 parents 3048b04 + c1fc18c commit 0a36d92

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

_templates/404.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@
5757
<script>
5858
const getBarConfig = () => {
5959
const customTheme = ``;
60+
const language = window.location.pathname.includes('/ja/') ? 'ja' : 'en';
6061

6162
return {
6263
customTheme,
6364
env: window.location.hostname.includes('splunk') ? 'prod' : 'dev',
64-
language: 'en',
65+
language: language,
66+
suiLanguage: language,
6567
layoutTemplate: "docsResultLayout",
6668
showSearchButton: false,
6769
searchBarRedirectUrl: 'https://docs.splunk.com/observability/en/search.html',

_templates/banner.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
<li class="nav-item">
103103
<a class="nav-link newnavbar" href="https://www.splunk.com/en_us/training/course-catalog.html?sort=Newest&filters=filterGroup4SplunkObservabilityCloud%2CfilterGroup4SplunkSyntheticMonitoring%2CfilterGroup4SplunkInfrastructureMonitoring%2CfilterGroup4SplunkITSI%2CfilterGroup4SplunkAPM%2CfilterGroup4SplunkOnCall%2CfilterGroup4SplunkRUM%2CfilterGroup4SplunkLogObserver%2CfilterGroup4SplunkInsights" target="_blank">Training</a>
104104
</li>
105+
<li class="nav-item nav-lang">
106+
<span class="lang" data-lang="en">EN</span> | <span class="lang" data-lang="ja">JA</span>
107+
</li>
105108
<li class="nav-item">
106109
<a class="nav-link newnavbar" href="https://www.splunk.com/en_us/download/infrastructure-monitoring.html" target="_blank" style="
107110
font-size: 12px;
@@ -118,6 +121,62 @@
118121
</ul>
119122
</div>
120123

124+
<style>
125+
.nav-lang{
126+
margin-top: 18px;
127+
color:darkgrey;
128+
}
129+
.active-lang {
130+
font-weight: bold;
131+
color: white !important;
132+
}
133+
.lang{
134+
cursor:pointer;
135+
}
136+
</style>
137+
<script>
138+
$(document).ready(function() {
139+
function setActiveLanguage() {
140+
var path = window.location.pathname;
141+
$('.lang').each(function() {
142+
var lang = $(this).data('lang');
143+
if (path.includes('/' + lang + '/')) {
144+
$(this).addClass('active-lang').css({
145+
"font-weight": "bold",
146+
"color": "red"
147+
});
148+
} else {
149+
$(this).removeClass('active-lang').removeAttr('style');
150+
}
151+
});
152+
}
153+
154+
setActiveLanguage();
155+
156+
function constructNewPath(lang) {
157+
var currentPath = window.location.pathname;
158+
var pathSegments = currentPath.split('/');
159+
var langIndex = pathSegments.findIndex(segment => $('.lang').map(function() { return $(this).data('lang'); }).get().includes(segment));
160+
161+
if (langIndex > -1) {
162+
pathSegments[langIndex] = lang;
163+
} else {
164+
pathSegments.splice(1, 0, lang);
165+
}
166+
167+
return pathSegments.join('/');
168+
}
169+
170+
$('.lang').click(function() {
171+
var lang = $(this).data('lang');
172+
var newPath = constructNewPath(lang);
173+
window.location.pathname = newPath;
174+
175+
setActiveLanguage();
176+
});
177+
});
178+
</script>
179+
121180
<div id="mobileSideBar">
122181
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
123182
</div>

_templates/layout.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@
5959
<script>
6060
const getBarConfig = () => {
6161
const customTheme = ``;
62+
const language = window.location.pathname.includes('/ja/') ? 'ja' : 'en';
6263

6364
return {
6465
customTheme,
6566
env: window.location.hostname.includes('splunk') ? 'prod' : 'dev',
66-
language: 'en',
67+
language: language,
68+
suiLanguage: language,
6769
layoutTemplate: "docsResultLayout",
6870
showSearchButton: false,
6971
searchBarRedirectUrl: 'https://docs.splunk.com/observability/en/search.html',

_templates/search.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,16 @@
9595
eventCallback: parentCallback
9696
}
9797

98+
const language = window.location.pathname.includes('/ja/') ? 'ja' : 'en';
9899
return {
99100
customTheme,
100101
sortOptions,
101102
areas: "docs_observability,dev,main, docs",
102103
facets: "source_name_s,docProduct_s,docVersion_s",
103104
enableDateRangeFilter: true,
104105
env: window.location.hostname.includes('splunk') ? 'prod' : 'dev',
105-
language: "en",
106+
language: language,
107+
suiLanguage: language,
106108
layoutTemplate: "docsResultLayout",
107109
analytics,
108110
analyticsConfig: {

0 commit comments

Comments
 (0)