English nyaize

This commit is contained in:
syuilo 2019-06-24 22:20:13 +09:00
parent b094df063b
commit 1943c9c7f2

View file

@ -2,6 +2,8 @@ export function nyaize(text: string): string {
return text
// ja-JP
.replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ').replace(/ナ/g, 'ニャ')
// en-US
.replace(/morning/gi, 'mornyan').replace(/everyone/gi, 'everynyan')
// ko-KR
.replace(/[나-낳]/g, match => String.fromCharCode(
match.codePointAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0)