Skip to content

Commit

Permalink
add: Localization
Browse files Browse the repository at this point in the history
  • Loading branch information
ObuchiYuki committed Feb 22, 2022
1 parent 6194114 commit 7f5116e
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 33 deletions.
8 changes: 4 additions & 4 deletions DevToys/DevToys.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions DevToys/DevToys/Body/Graphic/Color Picker/ColorPickerView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)

Expand All @@ -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
]))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]))
Expand Down Expand Up @@ -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
Expand All @@ -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()
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
})
}

Expand Down
4 changes: 2 additions & 2 deletions DevToys/DevToys/Body/SettingView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
)
}
}
4 changes: 1 addition & 3 deletions DevToys/DevToys/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>0.0.8.4</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
16 changes: 8 additions & 8 deletions DevToys/DevToys/Model/Tool+Default.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand Down Expand Up @@ -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()
)
}
Expand Down
2 changes: 1 addition & 1 deletion DevToys/DevToys/Model/ToolCategory+Default.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
38 changes: 38 additions & 0 deletions DevToys/DevToys/Resource/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"Information" = "Information";
"Clear" = "Clear";
"Delete" = "Delete";
"Open in Finder" = "Open in Finder";
"Quick Look" = "Quick Look";

// - Category -
"category.home" = "Home";
Expand All @@ -44,6 +46,7 @@
"category.generators" = "Generators";
"category.text" = "Text";
"category.graphic" = "Graphic";
"Media" = "Media";

// - Tool -
"tool.home.title" = "Home";
Expand Down Expand Up @@ -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";
40 changes: 39 additions & 1 deletion DevToys/DevToys/Resource/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"Bytes" = "バイト数";
"Clear" = "クリア";
"Delete" = "削除";
"Open in Finder" = "Finderで開く";
"Quick Look" = "クイックルック";

// - Category -
"category.home" = "ホーム";
Expand All @@ -47,7 +49,8 @@
"category.formatters" = "フォーマット";
"category.generators" = "生成";
"category.text" = "テキスト";
"category.graphic" = "メディア";
"category.graphic" = "画像";
"Media" = "メディア";

// - Tool -
"tool.home.title" = "ホーム";
Expand Down Expand Up @@ -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" = "変換失敗";
13 changes: 12 additions & 1 deletion Release Checklist.md
Original file line number Diff line number Diff line change
@@ -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 `<enclosure url="...">` to release asset URL.

9. Add new `appcast.xml` to git and push.

10. If needed, create `release-note.html` for Sparkle update.

0 comments on commit 7f5116e

Please sign in to comment.