diff --git a/resources/lang/en.json b/resources/lang/en.json
index 36bf22cce..9210f20f8 100644
--- a/resources/lang/en.json
+++ b/resources/lang/en.json
@@ -198,6 +198,14 @@
"fixed": "fixed",
"remove": "Remove",
"color": "Color",
+ "paste_ctmfg_placeholder": "Paste ctmfg code here...",
+ "error_invalid_code": "This is not a valid custom flag code.",
+ "error_invalid_elements": "This flag contains invalid layers or colors.",
+ "error_restricted_or_exceed": "This custom flag contains restricted elements or exceeds the allowed number of layers.",
+ "paste_code": "Paste custom code",
+ "current_code": "Current Code",
+ "copy_code": "Copy Code",
+ "apply_ctmfg_code": "Apply custom code",
"layers": {
"frame": "Frame",
"full": "Full Background",
diff --git a/resources/lang/ja.json b/resources/lang/ja.json
index 96345fc76..6c1a12ba2 100644
--- a/resources/lang/ja.json
+++ b/resources/lang/ja.json
@@ -190,6 +190,14 @@
"fixed": "固定",
"remove": "削除",
"color": "色",
+ "paste_ctmfg_placeholder": "カスタム旗コードをここに貼り付けてください...",
+ "error_invalid_code": "無効なカスタム旗コードです。",
+ "error_invalid_elements": "不正なレイヤーまたは色が含まれています。",
+ "error_restricted_or_exceed": "権限のない要素が含まれているか、レイヤー数が上限を超えています。",
+ "paste_code": "コードを貼り付け",
+ "current_code": "現在のコード",
+ "copy_code": "コードをコピー",
+ "apply_ctmfg_code": "コードを適用",
"layers": {
"frame": "フレーム",
"full": "背景",
diff --git a/src/client/FlagInputModal.ts b/src/client/FlagInputModal.ts
index 122917b4b..782b9e9d5 100644
--- a/src/client/FlagInputModal.ts
+++ b/src/client/FlagInputModal.ts
@@ -29,6 +29,7 @@ export class FlagInputModal extends LitElement {
}
@state() private flag: string = "";
+ @state() private errorMessage: string = "";
@state() private search: string = "";
@state() private showModal: boolean = false;
@state() private activeTab: "real" | "custom" = "real";
@@ -116,7 +117,6 @@ export class FlagInputModal extends LitElement {
this.flag = flag;
this.showModal = false;
this.storeFlag(flag);
- this.close();
const el = document.querySelector("flag-input") as FlagInput;
el.flag = this.flag;
el.requestUpdate();
@@ -276,7 +276,10 @@ export class FlagInputModal extends LitElement {
).map(
(country) => html`
+
+
+ ${this.errorMessage
+ ? html`
+
+ ${this.errorMessage}
+
+ `
+ : null}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
${translateText("flag_input.layer")}
(${this.customLayers.length})