Improve Accessibility by Improve Level Card Button Label
This commit is contained in:
1 parent
214dfb498e
commit
e01e628d94
6 files changed
+40
-10
No files matched your search
@@ -29,4 +29,14 @@ export class TranslationService {
|
||||
readonly translation = new Proxy({} as Translation, {
|
||||
get: (_, prop) => this._translation()[prop as keyof Translation]
|
||||
});
|
||||
|
||||
/**
|
||||
* 문자열 내의 플레이스홀더(예: {{name}})를 실제 값으로 치환합니다.
|
||||
*/
|
||||
interpolate(text: string, params: Record<string, string | number>): string {
|
||||
return Object.entries(params).reduce(
|
||||
(acc, [key, value]) => acc.replace(new RegExp(`{{${key}}}`, 'g'), String(value)),
|
||||
text
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user