fix: apply sentence case to UI text for Obsidian plugin validation

- Remove eslint-disable comment and emoji from status bar text
- Convert gradient names, time rules, and dropdown labels to sentence case
- Fix Title Case violations in i18n/en.ts, wallhaven.ts, unsplash.ts, pixabay.ts, default-settings.ts
This commit is contained in:
sean2077 2026-01-05 10:42:05 +08:00
parent 3dc1a506cc
commit 72f8ba22d8
No known key found for this signature in database
GPG key ID: 620E0A47DDC73C4E
8 changed files with 27 additions and 26 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
# AI tools
.serena
.claude
CLAUDE.md
.internal/

View file

@ -29,7 +29,7 @@ export default [
"@typescript-eslint/no-misused-promises": "error",
// 项目特定覆盖
"obsidianmd/ui/sentence-case": ["warn", { enforceCamelCaseLower: false }],
// "obsidianmd/ui/sentence-case": ["warn", { enforceCamelCaseLower: false }],
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },

View file

@ -140,7 +140,7 @@ function genDefaultSettings(): DTBSettings {
wallpaperApis: [
{
id: "api-wallhaven-default",
name: "Wallhaven API (Default)",
name: "Wallhaven API (default)",
type: WallpaperApiType.Wallhaven,
baseUrl: apiRegistry.getDefaultBaseUrl(WallpaperApiType.Wallhaven) || "",
enabled: false,
@ -148,7 +148,7 @@ function genDefaultSettings(): DTBSettings {
},
{
id: "api-qihoo360-default",
name: "360壁纸 API (Default)",
name: "360壁纸 API (default)",
type: WallpaperApiType.Qihoo360,
baseUrl: apiRegistry.getDefaultBaseUrl(WallpaperApiType.Qihoo360) || "",
enabled: false,

View file

@ -1,6 +1,6 @@
export default {
// ===== 设置标题 =====
settings_title: "Dynamic Theme Background",
settings_title: "Dynamic theme background",
version: "Version: ",
author: "Author: ",
homepage: "Homepage: ",
@ -13,7 +13,7 @@ export default {
enable_status_bar_name: "Enable status bar",
enable_status_bar_desc: "Turn the status bar feature on or off.",
status_bar_title:
"🖱Left Click: Switch random wallpaper\n🖱Middle Click: Open settings tab\n🖱Right Click: Save current background",
"🖱Left click: Switch random wallpaper\n🖱Middle click: Open settings tab\n🖱Right click: Save current background",
// ===== 外观设置 =====
appearance_settings_title: "Appearance",
@ -167,19 +167,19 @@ export default {
// ===== 默认配置相关 =====
default_morning_rule: "Morning",
default_later_morning_rule: "Later Morning",
default_later_morning_rule: "Later morning",
default_noon_rule: "Noon",
default_afternoon_rule: "Afternoon",
default_dusk_rule: "Dusk",
default_evening_rule: "Evening",
default_night_rule: "Night",
blue_purple_gradient_bg: "Blue Purple Gradient",
pink_gradient_bg: "Pink Gradient",
blue_cyan_gradient_bg: "Blue Cyan Gradient",
green_cyan_gradient_bg: "Green Cyan Gradient",
pink_yellow_gradient_bg: "Pink Yellow Gradient",
cyan_pink_gradient_bg: "Cyan Pink Gradient",
dark_blue_gray_gradient_bg: "Dark Blue Gray Gradient",
blue_purple_gradient_bg: "Blue purple gradient",
pink_gradient_bg: "Pink gradient",
blue_cyan_gradient_bg: "Blue cyan gradient",
green_cyan_gradient_bg: "Green cyan gradient",
pink_yellow_gradient_bg: "Pink yellow gradient",
cyan_pink_gradient_bg: "Cyan pink gradient",
dark_blue_gray_gradient_bg: "Dark blue gray gradient",
// ===== Notice 消息 =====
notice_all_fields_required: "⚠️ DTB: Please provide all required fields",

View file

@ -122,7 +122,7 @@ export default class DynamicThemeBackgroundPlugin extends Plugin {
activateStatusBar() {
this.deactivateStatusBar();
this.statusBar = this.addStatusBarItem();
this.statusBar.setText("🌈 DTB"); // eslint-disable-line obsidianmd/ui/sentence-case -- acronym
this.statusBar.setText("DTB");
this.statusBar.addClass("dtb-status-bar");
this.statusBar.setAttribute("title", t("status_bar_title"));
this.statusBar.addEventListener("click", (evt) => {

View file

@ -151,7 +151,7 @@ export class PixabayApi extends BaseWallpaperApi {
defaultValue: "",
description: "Filter results by category",
options: [
{ value: "", label: "All Categories" },
{ value: "", label: "All categories" },
{ value: "backgrounds", label: "Backgrounds" },
{ value: "fashion", label: "Fashion" },
{ value: "nature", label: "Nature" },

View file

@ -111,7 +111,7 @@ export class UnsplashApi extends BaseWallpaperApi {
description: "Filter results by color",
options: [
{ value: "", label: "Any" },
{ value: "black_and_white", label: "Black and White" },
{ value: "black_and_white", label: "Black and white" },
{ value: "black", label: "Black" },
{ value: "white", label: "White" },
{ value: "yellow", label: "Yellow" },
@ -131,8 +131,8 @@ export class UnsplashApi extends BaseWallpaperApi {
defaultValue: defaultParams.content_filter,
description: "Limit results by content safety",
options: [
{ value: "low", label: "Low (Default)" },
{ value: "high", label: "High (More restrictive)" },
{ value: "low", label: "Low (default)" },
{ value: "high", label: "High (more restrictive)" },
],
},
{

View file

@ -140,12 +140,12 @@ export class WallhavenApi extends BaseWallpaperApi {
defaultValue: defaultParams.sorting,
description: "How to sort the results",
options: [
{ value: "date_added", label: "Date Added" },
{ value: "date_added", label: "Date added" },
{ value: "relevance", label: "Relevance" },
{ value: "random", label: "Random" },
{ value: "views", label: "Views" },
{ value: "favorites", label: "Favorites" },
{ value: "toplist", label: "Top List" },
{ value: "toplist", label: "Top list" },
],
},
{
@ -166,12 +166,12 @@ export class WallhavenApi extends BaseWallpaperApi {
defaultValue: defaultParams.topRange,
description: "Time range for top wallpapers. (Sorting MUST be set to 'toplist')",
options: [
{ value: "1W", label: "Last Week" },
{ value: "1M", label: "Last Month" },
{ value: "3M", label: "Last 3 Months" },
{ value: "6M", label: "Last 6 Months" },
{ value: "1Y", label: "Last Year" },
{ value: "all", label: "All Time" },
{ value: "1W", label: "Last week" },
{ value: "1M", label: "Last month" },
{ value: "3M", label: "Last 3 months" },
{ value: "6M", label: "Last 6 months" },
{ value: "1Y", label: "Last year" },
{ value: "all", label: "All time" },
],
},
{