Skip to content

Commit 1c56704

Browse files
authored
Merge pull request #6 from Dialogue-Bot/DIAL-9-Feat-Add-i18n-for-server
Dial 9 feat add i18n for server
2 parents 33ecdbf + a7f40a2 commit 1c56704

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

client/src/lib/http-client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ELang } from '@/types/share';
12
import axios from 'axios';
23

34
const http_client = axios.create({
@@ -10,6 +11,11 @@ const http_client = axios.create({
1011

1112
http_client.interceptors.request.use(
1213
function (config) {
14+
const lang = localStorage.getItem('lang') || ELang.EN;
15+
16+
config.headers['Accept-Language'] = lang;
17+
config.headers['lang'] = lang;
18+
1319
return config;
1420
},
1521
function (error) {

0 commit comments

Comments
 (0)