Skip to content

Commit cc44620

Browse files
committed
fix: failed to open preview settings in other languages
1 parent 42002a6 commit cc44620

32 files changed

Lines changed: 66 additions & 35 deletions

src/components/settingsPage.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ function listItems($list, items, callback) {
194194
const $items = [];
195195

196196
// sort settings by text before rendering
197-
items.sort((acc, cur) => acc.text.localeCompare(cur.text));
197+
items.sort((acc, cur) => {
198+
if (!acc?.text || !cur?.text) return 0;
199+
return acc.text.localeCompare(cur.text);
200+
});
198201
items.forEach((item) => {
199202
const $setting = new Ref();
200203
const $settingName = new Ref();
@@ -212,7 +215,7 @@ function listItems($list, items, callback) {
212215
></span>
213216
<div ref={$setting} className="container">
214217
<div ref={$settingName} className="text">
215-
{item.text.capitalize(0)}
218+
{item.text?.capitalize?.(0) ?? item.text}
216219
</div>
217220
</div>
218221
</div>

src/lang/ar-ye.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,6 @@
390390
"import project zip": "Import Project(zip)",
391391
"changelog": "Change Log",
392392
"notifications": "Notifications",
393-
"no_unread_notifications": "No unread notifications"
393+
"no_unread_notifications": "No unread notifications",
394+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
394395
}

src/lang/be-by.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,5 +391,6 @@
391391
"import project zip": "Імпартаваць праект(zip)",
392392
"changelog": "Журнал змен",
393393
"notifications": "Апавяшчэнні",
394-
"no_unread_notifications": "Няма непрачытаных апавяшчэнняў"
394+
"no_unread_notifications": "Няма непрачытаных апавяшчэнняў",
395+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
395396
}

src/lang/bn-bd.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,6 @@
390390
"import project zip": "Import Project(zip)",
391391
"changelog": "Change Log",
392392
"notifications": "Notifications",
393-
"no_unread_notifications": "No unread notifications"
393+
"no_unread_notifications": "No unread notifications",
394+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
394395
}

src/lang/cs-cz.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,6 @@
390390
"import project zip": "Import Project(zip)",
391391
"changelog": "Change Log",
392392
"notifications": "Notifications",
393-
"no_unread_notifications": "No unread notifications"
393+
"no_unread_notifications": "No unread notifications",
394+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
394395
}

src/lang/de-de.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,6 @@
390390
"import project zip": "Projekt(-Zip) importieren",
391391
"changelog": "Änderungsbericht",
392392
"notifications": "Notifications",
393-
"no_unread_notifications": "No unread notifications"
393+
"no_unread_notifications": "No unread notifications",
394+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
394395
}

src/lang/en-us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,5 +391,6 @@
391391
"import project zip": "Import Project(zip)",
392392
"changelog": "Change Log",
393393
"notifications": "Notifications",
394-
"no_unread_notifications": "No unread notifications"
394+
"no_unread_notifications": "No unread notifications",
395+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
395396
}

src/lang/es-sv.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,6 @@
390390
"import project zip": "Import Project(zip)",
391391
"changelog": "Change Log",
392392
"notifications": "Notifications",
393-
"no_unread_notifications": "No unread notifications"
393+
"no_unread_notifications": "No unread notifications",
394+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
394395
}

src/lang/fr-fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,6 @@
390390
"import project zip": "Import Project(zip)",
391391
"changelog": "Change Log",
392392
"notifications": "Notifications",
393-
"no_unread_notifications": "No unread notifications"
393+
"no_unread_notifications": "No unread notifications",
394+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
394395
}

src/lang/hi-in.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,5 +391,6 @@
391391
"import project zip": "Import Project(zip)",
392392
"changelog": "Change Log",
393393
"notifications": "Notifications",
394-
"no_unread_notifications": "No unread notifications"
394+
"no_unread_notifications": "No unread notifications",
395+
"should_use_current_file_for_preview": "Should use Current File For preview instead of default (index.html)"
395396
}

0 commit comments

Comments
 (0)