From 7f5116e2f68464187d67dece05451ef46fb733fe Mon Sep 17 00:00:00 2001 From: Obuchi Yuki Date: Wed, 23 Feb 2022 00:08:37 +0900 Subject: [PATCH] add: Localization --- DevToys/DevToys.xcodeproj/project.pbxproj | 8 ++-- .../Color Picker/ColorPickerView+.swift | 10 ++--- .../Movie to Gif/GifConverterView+.swift | 8 ++-- .../Audio Converter/AudioConverterView+.swift | 7 ++-- DevToys/DevToys/Body/SettingView+.swift | 4 +- DevToys/DevToys/Info.plist | 4 +- DevToys/DevToys/Model/Tool+Default.swift | 16 ++++---- .../DevToys/Model/ToolCategory+Default.swift | 2 +- .../Resource/en.lproj/Localizable.strings | 38 ++++++++++++++++++ .../Resource/ja.lproj/Localizable.strings | 40 ++++++++++++++++++- Release Checklist.md | 13 +++++- 11 files changed, 117 insertions(+), 33 deletions(-) diff --git a/DevToys/DevToys.xcodeproj/project.pbxproj b/DevToys/DevToys.xcodeproj/project.pbxproj index 746f0c4..c00c7c8 100644 --- a/DevToys/DevToys.xcodeproj/project.pbxproj +++ b/DevToys/DevToys.xcodeproj/project.pbxproj @@ -1042,7 +1042,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 0.0.9; DEVELOPMENT_TEAM = T5HMUWWK5R; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = DevToys/Info.plist; @@ -1057,7 +1057,7 @@ "$(PROJECT_DIR)/DevToys/Body/Media/Image\\ Optimizer", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.0.8.4; + MARKETING_VERSION = 0.0.9; PRODUCT_BUNDLE_IDENTIFIER = com.yuki.DevToys; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ENFORCE_EXCLUSIVE_ACCESS = off; @@ -1075,7 +1075,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 0.0.9; DEVELOPMENT_TEAM = T5HMUWWK5R; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = DevToys/Info.plist; @@ -1090,7 +1090,7 @@ "$(PROJECT_DIR)/DevToys/Body/Media/Image\\ Optimizer", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.0.8.4; + MARKETING_VERSION = 0.0.9; PRODUCT_BUNDLE_IDENTIFIER = com.yuki.DevToys; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ENFORCE_EXCLUSIVE_ACCESS = off; diff --git a/DevToys/DevToys/Body/Graphic/Color Picker/ColorPickerView+.swift b/DevToys/DevToys/Body/Graphic/Color Picker/ColorPickerView+.swift index 845d333..52c5b3f 100644 --- a/DevToys/DevToys/Body/Graphic/Color Picker/ColorPickerView+.swift +++ b/DevToys/DevToys/Body/Graphic/Color Picker/ColorPickerView+.swift @@ -190,7 +190,7 @@ enum ColorPickerType: String, TextItem { case hsbCircle = "HSB Circle" case hsbCircleAndBars = "HSB Circle and Bars" - var title: String { rawValue } + var title: String { rawValue.localized() } } enum ColorCopyType: String, TextItem { @@ -259,7 +259,7 @@ final private class ColorPickerView: Page { } override func onAwake() { - self.addSection(Area(icon: R.Image.settings, title: "Picker Type", control: pickerTypePicker)) + self.addSection(Area(icon: R.Image.settings, title: "Picker Type".localized(), control: pickerTypePicker)) self.pickerPlaceholder.contentView = circleBarsHSBPicker self.addSection(pickerPlaceholder) @@ -272,12 +272,12 @@ final private class ColorPickerView: Page { self.addSection(componentsStack) - self.addSection(Section(title: "Color Hex", orientation: .horizontal, fillWidth: false, items: [ + self.addSection(Section(title: "Color Hex".localized(), orientation: .horizontal, fillWidth: false, items: [ hex3TextField, hex6TextField, hex8TextField ])) - self.addSection(Section(title: "Color Copy", items: [ - Area(icon: R.Image.copy, title: "Type", control: colorCopyTypePicker), + self.addSection(Section(title: "Color Copy".localized(), items: [ + Area(icon: R.Image.copy, title: "Color Copy Type".localized(), control: colorCopyTypePicker), self.colorCopyPlaceholder ])) diff --git a/DevToys/DevToys/Body/Graphic/Movie to Gif/GifConverterView+.swift b/DevToys/DevToys/Body/Graphic/Movie to Gif/GifConverterView+.swift index aef4f10..48dc9f7 100644 --- a/DevToys/DevToys/Body/Graphic/Movie to Gif/GifConverterView+.swift +++ b/DevToys/DevToys/Body/Graphic/Movie to Gif/GifConverterView+.swift @@ -92,7 +92,7 @@ final private class GifConverterView: Page { self.registerForDraggedTypes([.fileURL]) self.addSection(Section(title: "Configuration".localized(), items: [ - Area(icon: R.Image.spacing, title: "Width".localized(), message: "The width of the Gif file (height will be determined)".localized(), control: widthField), + Area(icon: R.Image.spacing, title: "Width".localized(), message: "The width of the Gif file".localized(), control: widthField), Area(icon: R.Image.paramators, title: "FPS".localized(), message: "FPS of the Gif file to be exported".localized(), control: fpsField), Area(icon: R.Image.paramators, title: "Remove source file".localized(), message: "Whether to delete the source file after exporting a Gif".localized(), control: removeFileSwitch) ])) @@ -179,7 +179,7 @@ extension GifConvertListView: NSTableViewDataSource, NSTableViewDelegate { let task = convertTasks[row] cell.titleLabel.stringValue = task.title - cell.infoLabel.stringValue = "Starting..." + cell.infoLabel.stringValue = "Starting...".localized() cell.thumbnailImageView.image = task.thumbnail task.fftask @@ -197,10 +197,10 @@ extension GifConvertListView: NSTableViewDataSource, NSTableViewDelegate { task.complete .receive(on: .main) .sink({ - cell.infoLabel.stringValue = "Complete" + cell.infoLabel.stringValue = "Complete".localized() }, { error in cell.infoLabel.textColor = .systemRed - cell.infoLabel.stringValue = "Convert Failed \(error)" + cell.infoLabel.stringValue = "Convert Failed".localized() }) } diff --git a/DevToys/DevToys/Body/Media/Audio Converter/AudioConverterView+.swift b/DevToys/DevToys/Body/Media/Audio Converter/AudioConverterView+.swift index a18165f..8e187a9 100644 --- a/DevToys/DevToys/Body/Media/Audio Converter/AudioConverterView+.swift +++ b/DevToys/DevToys/Body/Media/Audio Converter/AudioConverterView+.swift @@ -198,8 +198,7 @@ extension AudioConvertListView: NSTableViewDataSource, NSTableViewDelegate { let task = convertTasks[row] cell.titleLabel.stringValue = task.title - cell.infoLabel.stringValue = "Starting..." -// cell.thumbnailImageView.image = task.thumbnail + cell.infoLabel.stringValue = "Starting...".localized() task.fftask .receive(on: .main) @@ -216,10 +215,10 @@ extension AudioConvertListView: NSTableViewDataSource, NSTableViewDelegate { task.complete .receive(on: .main) .sink({ - cell.infoLabel.stringValue = "Complete" + cell.infoLabel.stringValue = "Complete".localized() }, { error in cell.infoLabel.textColor = .systemRed - cell.infoLabel.stringValue = "Convert Failed \(error)" + cell.infoLabel.stringValue = "Convert Failed".localized() }) } diff --git a/DevToys/DevToys/Body/SettingView+.swift b/DevToys/DevToys/Body/SettingView+.swift index dbf6c3c..e5b7fd4 100644 --- a/DevToys/DevToys/Body/SettingView+.swift +++ b/DevToys/DevToys/Body/SettingView+.swift @@ -24,7 +24,7 @@ final class SettingViewController: NSViewController { extension Settings.AppearanceType: TextItem { static let allCases: [Self] = [.useSystemSettings, .lightMode, .darkMode] - var title: String { rawValue } + var title: String { rawValue.localized() } } final private class SettingView: Page { @@ -33,7 +33,7 @@ final private class SettingView: Page { override func onAwake() { self.addSection( - Area(icon: R.Image.paramators, title: "App Theme", message: "Select which app theme to display", control: appearancePicker) + Area(icon: R.Image.paramators, title: "App Theme".localized(), message: "Select which app theme to display".localized(), control: appearancePicker) ) } } diff --git a/DevToys/DevToys/Info.plist b/DevToys/DevToys/Info.plist index 1ac3526..abd163a 100644 --- a/DevToys/DevToys/Info.plist +++ b/DevToys/DevToys/Info.plist @@ -18,10 +18,8 @@ $(PRODUCT_NAME) CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - $(MARKETING_VERSION) CFBundleVersion - 0.0.8.4 + $(CURRENT_PROJECT_VERSION) LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/DevToys/DevToys/Model/Tool+Default.swift b/DevToys/DevToys/Model/Tool+Default.swift index 1bfe5c9..193cf9e 100644 --- a/DevToys/DevToys/Model/Tool+Default.swift +++ b/DevToys/DevToys/Model/Tool+Default.swift @@ -19,8 +19,8 @@ extension Tool { viewController: SearchViewController() ) static let settings = Tool( - title: "Settings", identifier: "settings", category: .settings, icon: R.Image.Tool.settings, - toolDescription: "Setting of application", showAlways: true, showOnHome: true, showOnSidebar: false, + title: "Settings".localized(), identifier: "settings", category: .settings, icon: R.Image.Tool.settings, + toolDescription: "Setting of application".localized(), showAlways: true, showOnHome: true, showOnSidebar: false, viewController: SettingViewController() ) @@ -131,20 +131,20 @@ extension Tool { viewController: ImageConverterViewController() ) static let colorPicker = Tool( - title: "Color Picker", identifier: "colorpicker", category: .graphic, icon: R.Image.Tool.colorPicker, - sidebarTitle: "Color Picker", toolDescription: "Picker the color and copy components", + title: "Color Picker".localized(), identifier: "colorpicker", category: .graphic, icon: R.Image.Tool.colorPicker, + sidebarTitle: "Color Picker".localized(), toolDescription: "Picker the color and copy components".localized(), viewController: ColorPickerViewController() ) static let gifConverter = Tool( - title: "Gif Converter", identifier: "gifconverter", category: .graphic, icon: R.Image.Tool.gif, - sidebarTitle: "Gif Converter", toolDescription: "Convert movie to animation gif file", + title: "Gif Converter".localized(), identifier: "gifconverter", category: .graphic, icon: R.Image.Tool.gif, + sidebarTitle: "Gif Converter".localized(), toolDescription: "Convert a movie to an animated GIF file".localized(), viewController: GifConverterViewController() ) // MARK: - Media - static let audioConverter = Tool( - title: "Audio Converter", identifier: "audioconverter", category: .media, icon: R.Image.Tool.audioConverter, - sidebarTitle: "Audio Converter", toolDescription: "Convert audio from one format to another", + title: "Audio Converter".localized(), identifier: "audioconverter", category: .media, icon: R.Image.Tool.audioConverter, + sidebarTitle: "Audio Converter".localized(), toolDescription: "Convert audio from one format to another".localized(), viewController: AudioConverterViewController() ) } diff --git a/DevToys/DevToys/Model/ToolCategory+Default.swift b/DevToys/DevToys/Model/ToolCategory+Default.swift index de23dc7..d5b8357 100644 --- a/DevToys/DevToys/Model/ToolCategory+Default.swift +++ b/DevToys/DevToys/Model/ToolCategory+Default.swift @@ -14,5 +14,5 @@ extension ToolCategory { static let text = ToolCategory(name: "category.text".localized(), icon: R.Image.Tool.text, identifier: "text") static let graphic = ToolCategory(name: "category.graphic".localized(), icon: R.Image.Tool.graphic, identifier: "graphic") static let media = ToolCategory(name: "Media".localized(), icon: R.Image.Tool.media, identifier: "media") - static let settings = ToolCategory(name: "Settings", icon: nil, identifier: "settings", shouldHideCategory: true) + static let settings = ToolCategory(name: "Settings".localized(), icon: nil, identifier: "settings", shouldHideCategory: true) } diff --git a/DevToys/DevToys/Resource/en.lproj/Localizable.strings b/DevToys/DevToys/Resource/en.lproj/Localizable.strings index 7e5ee9c..032dfe2 100644 --- a/DevToys/DevToys/Resource/en.lproj/Localizable.strings +++ b/DevToys/DevToys/Resource/en.lproj/Localizable.strings @@ -35,6 +35,8 @@ "Information" = "Information"; "Clear" = "Clear"; "Delete" = "Delete"; +"Open in Finder" = "Open in Finder"; +"Quick Look" = "Quick Look"; // - Category - "category.home" = "Home"; @@ -44,6 +46,7 @@ "category.generators" = "Generators"; "category.text" = "Text"; "category.graphic" = "Graphic"; +"Media" = "Media"; // - Tool - "tool.home.title" = "Home"; @@ -188,3 +191,38 @@ "Converted Images" = "Converted Images"; "Scale" = "Scale"; "Size" = "Size"; + +"Settings" = "Settings"; +"Setting of application" = "Setting of application"; +"App Theme" = "App Theme"; +"Select which app theme to display" = "Select which app theme to display"; +"Use system setting" = "Use system setting"; +"Light mode" = "Light mode"; +"Dark mode" = "Dark mode"; + +"Color Picker" = "Color Picker"; +"Picker the color and copy components" = "Pick a color and copy the formatted color"; +"HSB Box" = "HSB Box"; +"HSB Circle" = "HSB Circle"; +"HSB Circle and Bars" = "HSB Circle and Bars"; +"Pick Color" = "Pick Color"; +"Picker Type" = "Picker Type"; +"Color Hex" = "Color Hex"; +"Color Copy" = "Color Copy"; +"Color Copy Type" = "Type"; + +"Gif Converter" = "Gif Converter"; +"Convert a movie to an animated GIF file" = "Convert a movie to an animated GIF file"; +"Width" = "Width"; +"The width of the Gif file" = "The width of the Gif file (height will be determined)"; +"FPS" = "FPS"; +"FPS of the Gif file to be exported" = "FPS of the Gif file to be exported"; +"Remove source file" = "Remove source file"; +"Whether to delete the source file after exporting a Gif" = "Whether to delete the source file after exporting a Gif"; + +"Audio Converter" = "Audio Converter"; +"Convert audio from one format to another" = "Convert audio from one format to another"; +"Whether to delete the source file after exporting a Audio" = "Whether to delete the source file after exporting a Audio"; +"Starting..." = "Starting..."; +"Complete" = "Complete"; +"Convert Failed" = "Convert Failed"; diff --git a/DevToys/DevToys/Resource/ja.lproj/Localizable.strings b/DevToys/DevToys/Resource/ja.lproj/Localizable.strings index 5fd5109..504177b 100644 --- a/DevToys/DevToys/Resource/ja.lproj/Localizable.strings +++ b/DevToys/DevToys/Resource/ja.lproj/Localizable.strings @@ -39,6 +39,8 @@ "Bytes" = "バイト数"; "Clear" = "クリア"; "Delete" = "削除"; +"Open in Finder" = "Finderで開く"; +"Quick Look" = "クイックルック"; // - Category - "category.home" = "ホーム"; @@ -47,7 +49,8 @@ "category.formatters" = "フォーマット"; "category.generators" = "生成"; "category.text" = "テキスト"; -"category.graphic" = "メディア"; +"category.graphic" = "画像"; +"Media" = "メディア"; // - Tool - "tool.home.title" = "ホーム"; @@ -184,3 +187,38 @@ "Converted Images" = "変換した画像"; "Scale" = "大きさの変換"; "Size" = "サイズ"; + +"Settings" = "設定"; +"Setting of application" = "アプリの設定を行います"; +"App Theme" = "アプリのテーマ"; +"Select which app theme to display" = "表示に用いるテーマの選択"; +"Use system setting" = "自動"; +"Light mode" = "ライト"; +"Dark mode" = "ダーク"; + +"Color Picker" = "カラーピッカー"; +"Picker the color and copy components" = "色を選択してフォーマットした文字列をコピーします"; +"HSB Box" = "HSBボックス"; +"HSB Circle" = "HSBサークル"; +"HSB Circle and Bars" = "HSB バー&サークル"; +"Pick Color" = "色を選択"; +"Picker Type" = "選択のタイプ"; +"Color Hex" = "Hex値"; +"Color Copy" = "色をコピー"; +"Color Copy Type" = "型"; + +"Gif Converter" = "Gifへの変換"; +"Convert a movie to an animated GIF file" = "動画をアニメーションGifに変換します"; +"Width" = "幅"; +"The width of the Gif file" = "Gifファイルの横幅 (高さは自動決定されます)"; +"FPS" = "FPS"; +"FPS of the Gif file to be exported" = "書き出すGifファイルのFPS"; +"Remove source file" = "元ファイルを削除"; +"Whether to delete the source file after exporting a Gif" = "Gifファイル書き出し後に元ファイルを削除するか"; + +"Audio Converter" = "音声フォーマット変換"; +"Convert audio from one format to another" = "音声ファイルのフォーマット・音質の変更を行います"; +"Whether to delete the source file after exporting a Audio" = "ファイル書き出し後に元ファイルを削除するか"; +"Starting..." = "初期化中..."; +"Complete" = "完了"; +"Convert Failed" = "変換失敗"; diff --git a/Release Checklist.md b/Release Checklist.md index 2d9f099..2ce1145 100644 --- a/Release Checklist.md +++ b/Release Checklist.md @@ -1,18 +1,29 @@ -# Checklist for release +# Release Checklist This is the procedure for doing a release. 1. Update the project version from Xcode's project pane + + Update both Version and Build (Sparkle seems to be referring to the build.) + 2. Archive and Notarize app - With Distribute App > Developer ID + 3. Create a tag for the release and push that tag. + 4. Create a Github release page. + 5. Create a zip file of the nolarized app on **local** (not the github page) and upload it to Asset. - The checksum of the zip file will be requested by appcast. + 6. Generate appcast file with `generate_appcast` command. + 7. Publish release on GitHub. + 8. Update generated `appcast.xml` 's `` to release asset URL. + 9. Add new `appcast.xml` to git and push. + 10. If needed, create `release-note.html` for Sparkle update. \ No newline at end of file