From b336e30b30717576570f3cd8a8886f10776406cb Mon Sep 17 00:00:00 2001 From: tisfeng Date: Sun, 7 Jan 2024 17:13:04 +0800 Subject: [PATCH 1/2] perf: update Localizable.xcstrings --- Easydict/App/Localizable.xcstrings | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Easydict/App/Localizable.xcstrings b/Easydict/App/Localizable.xcstrings index 0ee5bae52..160e6409b 100644 --- a/Easydict/App/Localizable.xcstrings +++ b/Easydict/App/Localizable.xcstrings @@ -884,10 +884,24 @@ } }, "Easydict" : { - + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } + } + } }, "Easydict 🍃" : { - + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } + } + } }, "enable_beta_new_app" : { "localizations" : { @@ -1420,7 +1434,7 @@ }, "zh-Hans" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "请前往服务官网注册申请个人的 API key。" } } @@ -2440,7 +2454,14 @@ } }, "Tisfeng" : { - + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } + } + } }, "toggle_languages" : { "localizations" : { From 9433ee31b14e0a9f6e3d6a351e60bf0d57be5156 Mon Sep 17 00:00:00 2001 From: phlpsong <103433299+phlpsong@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:48:58 +0800 Subject: [PATCH 2/2] bugfix: remove increaseMenuItemHeight func (#318) --- .../Feature/StatusItem/EZMenuItemManager.m | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/Easydict/Feature/StatusItem/EZMenuItemManager.m b/Easydict/Feature/StatusItem/EZMenuItemManager.m index ca784ad32..7f87b5103 100644 --- a/Easydict/Feature/StatusItem/EZMenuItemManager.m +++ b/Easydict/Feature/StatusItem/EZMenuItemManager.m @@ -98,7 +98,6 @@ - (void)setup { self.versionItem.title = self.versionTitle; NSArray *items = @[self.versionItem, self.settingsItem, self.checkForUpdateItem, self.helpItem, self.quitItem]; - [self increaseMenuItemsHeight:items lineHeightRatio:kTitleMenuItemHeightRatio]; [self updateVersionItem]; } @@ -308,8 +307,6 @@ - (void)menuWillOpen:(NSMenu *)menu { item.keyEquivalent = @""; item.keyEquivalentModifierMask = 0; } - - [self increaseMenuItemHeight:item lineHeightRatio:kImageMenuItemHeightRatio]; }; configItemShortcut(self.selectionItem, EZSelectionShortcutKey); @@ -319,24 +316,6 @@ - (void)menuWillOpen:(NSMenu *)menu { configItemShortcut(self.screenshotOCRItem, EZScreenshotOCRShortcutKey); } -#pragma mark - - -/// Increase menu item height. Ref: https://stackoverflow.com/questions/18031666/nsmenuitem-height -- (void)increaseMenuItemHeight:(NSMenuItem *)item lineHeightRatio:(CGFloat)lineHeightRatio { - NSFont *font = [NSFont systemFontOfSize:[NSFont systemFontSize]]; - CGFloat fontLineHeight = (font.ascender + fabs(font.descender)); - CGFloat lineHeight = fontLineHeight * lineHeightRatio; - // Ref stackoverflow: https://stackoverflow.com/a/18034142/8378840 - NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(1, lineHeight)]; - [item setImage:image]; -} - -- (void)increaseMenuItemsHeight:(NSArray *)itmes lineHeightRatio:(CGFloat)lineHeightRatio { - for (NSMenuItem *item in itmes) { - [self increaseMenuItemHeight:item lineHeightRatio:lineHeightRatio]; - } -} - #pragma mark - Fetch Github Repo Info - (void)updateVersionItem { @@ -347,7 +326,6 @@ - (void)updateVersionItem { versionTitle = [NSString stringWithFormat:@"%@ (✨ %@)", self.versionTitle, lastestVersion]; } self.versionItem.title = versionTitle; - [self increaseMenuItemHeight:self.versionItem lineHeightRatio:kTitleMenuItemHeightRatio]; }]; }