All checks were successful
release-tag / release-image (push) Successful in 2m17s
Co-authored-by: itoshi <kkzemeow@gmail.com> Co-authored-by: Spynder <19329095+Spynder@users.noreply.github.com> Reviewed-on: #12 Co-authored-by: Alexander Lazarenko <kerblif@unprism.ru> Co-committed-by: Alexander Lazarenko <kerblif@unprism.ru>
34 lines
599 B
TypeScript
34 lines
599 B
TypeScript
import { makeAutoObservable } from "mobx";
|
|
|
|
export type Languages = "en" | "ru" | "zh";
|
|
class LanguageStore {
|
|
language: Languages = "ru";
|
|
|
|
constructor() {
|
|
makeAutoObservable(this);
|
|
}
|
|
|
|
setLanguageAction = (language: Languages) => {
|
|
this.language = language;
|
|
};
|
|
}
|
|
|
|
export const languageStore = new LanguageStore();
|
|
|
|
export const META_LANGUAGE = (language: Languages) => {
|
|
return {
|
|
meta: {
|
|
headers: {
|
|
"Accept-Language": language,
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
export const EVERY_LANGUAGE = (data: any) => {
|
|
return {
|
|
"en": data,
|
|
"ru": data,
|
|
"zh": data,
|
|
}
|
|
} |