FIX: Monster bar
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 1m38s
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 1m38s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { listCurrentLanguage } from "@/lib/constant";
|
||||
import { AvatarHakushiType } from "@/types";
|
||||
import { AvatarHakushiType, EnemyHakushiType } from "@/types";
|
||||
|
||||
|
||||
export function getNameChar(locale: string, data: AvatarHakushiType | undefined): string {
|
||||
@@ -22,6 +22,21 @@ export function getNameChar(locale: string, data: AvatarHakushiType | undefined)
|
||||
return text
|
||||
}
|
||||
|
||||
export function getNameEnemy(locale: string, data: EnemyHakushiType | undefined): string {
|
||||
if (!data) {
|
||||
return ""
|
||||
}
|
||||
if (!listCurrentLanguage.hasOwnProperty(locale)) {
|
||||
return ""
|
||||
}
|
||||
|
||||
let text = data.lang.get(listCurrentLanguage[locale as keyof typeof listCurrentLanguage].toLowerCase()) ?? "";
|
||||
if (!text) {
|
||||
text = data.lang.get("en") ?? "";
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
export function parseRuby(text: string): string {
|
||||
const rubyRegex = /\{RUBY_B#(.*?)\}(.*?)\{RUBY_E#\}/gs;
|
||||
return text.replace(rubyRegex, (_match, furigana, kanji) => {
|
||||
|
||||
Reference in New Issue
Block a user