Localization improvements

8b82325d3099e0e2bb565820bf59b4eb0080799e

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +13 -12Ignore whitespace
public/locales/ru-ru.json+1 -0
@@ -965,6 +965,7 @@
965965 "char_import_5": "Персонаж с AICharacterCards.com (прямая ссылка или ID)",
966966 "char_import_6": "Прямая ссылка на PNG-файл (список разрешённых хостов находится в",
967967 "char_import_7": ")",
968+ "char_import_9": "Персонаж с Soulkyn (прямая ссылка)",
968969 "Grammar String": "Грамматика",
969970 "GBNF or EBNF, depends on the backend in use. If you're using this you should know which.": "GBNF или EBNF, зависит от бэкенда. Если вы это используете, то, скорее всего, сами знаете, какой именно.",
970971 "Account": "Аккаунт",
public/script.js+12 -12
@@ -673,16 +673,8 @@ export const extension_prompt_roles = {
673673
674674export const MAX_INJECTION_DEPTH = 10000;
675675
676-const SAFETY_CHAT = [
676+// Initialized in getSystemMessages()
677- {
677+const SAFETY_CHAT = [];
678- name: systemUserName,
679- force_avatar: system_avatar,
680- is_system: true,
681- is_user: false,
682- create_date: 0,
683- mes: () => t`You deleted a character/chat and arrived back here for safety reasons! Pick another character!`,
684- },
685-];
686678
687679export let system_messages = {};
688680
@@ -769,6 +761,16 @@ async function getSystemMessages() {
769761 },
770762 },
771763 };
764+
765+ const safetyMessage = {
766+ name: systemUserName,
767+ force_avatar: system_avatar,
768+ is_system: true,
769+ is_user: false,
770+ create_date: 0,
771+ mes: t`You deleted a character/chat and arrived back here for safety reasons! Pick another character!`,
772+ };
773+ SAFETY_CHAT.splice(0, SAFETY_CHAT.length, safetyMessage);
772774}
773775
774776async function getClientVersion() {
@@ -6747,8 +6749,6 @@ export function resetChatState() {
67476749 name2 = (this_chid === undefined && neutralCharacterName) ? neutralCharacterName : systemUserName;
67486750 //unsets expected chid before reloading (related to getCharacters/printCharacters from using old arrays)
67496751 setCharacterId(undefined);
6750- // translate system user's message before diaplaying
6751- SAFETY_CHAT[0].mes = SAFETY_CHAT[0].mes();
67526752 // sets up system user to tell user about having deleted a character
67536753 chat.splice(0, chat.length, ...SAFETY_CHAT);
67546754 // resets chat metadata