Skip to content

Commit

Permalink
translate en to fr (#11)
Browse files Browse the repository at this point in the history
* translate en to fr

* re add GeneralPreferencesViewController.xib

* re add devTeam origin && fix path GeneralPreferencesViewController.xib

* fix fail

* re add old dev team
  • Loading branch information
Flayor authored and brianmichel committed Jan 2, 2017
1 parent 54e8f55 commit ee4caec
Show file tree
Hide file tree
Showing 17 changed files with 977 additions and 38 deletions.
20 changes: 20 additions & 0 deletions Juice.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
72DA73691E09FED9003F9262 /* StartOnLaunchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72DA73681E09FED9003F9262 /* StartOnLaunchController.swift */; };
72DA736A1E09FED9003F9262 /* StartOnLaunchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72DA73681E09FED9003F9262 /* StartOnLaunchController.swift */; };
72DA736C1E09FF2E003F9262 /* JuiceHelper.app in Copy JuiceHelper */ = {isa = PBXBuildFile; fileRef = 72DA735A1E09FE19003F9262 /* JuiceHelper.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
AAA3A2A31E0F3F0F0015165E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AAA3A2A51E0F3F0F0015165E /* Localizable.strings */; };
BB1E603B06F7547FED9412FB /* Pods_Juice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89FE5472659FE380046C1766 /* Pods_Juice.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -91,6 +92,10 @@
72DAC54A1E0A0A050036E3BF /* JuiceHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = JuiceHelper.entitlements; sourceTree = "<group>"; };
77622EE75A5C033BF8EAACB4 /* Pods-Juice.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Juice.release.xcconfig"; path = "Pods/Target Support Files/Pods-Juice/Pods-Juice.release.xcconfig"; sourceTree = "<group>"; };
89FE5472659FE380046C1766 /* Pods_Juice.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Juice.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AAA3A2A11E0F3EFF0015165E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/MainMenu.strings; sourceTree = "<group>"; };
AAA3A2A21E0F3F000015165E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/MainMenu.strings; sourceTree = "<group>"; };
AAA3A2A61E0F3F120015165E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
AAA3A2A71E0F3F150015165E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -133,6 +138,7 @@
725AA5B31E05BF3A006E5DDE = {
isa = PBXGroup;
children = (
AAA3A2A51E0F3F0F0015165E /* Localizable.strings */,
72DA73671E09FEA7003F9262 /* Shared */,
725AA5BE1E05BF3A006E5DDE /* Juice */,
72DA735B1E09FE19003F9262 /* JuiceHelper */,
Expand Down Expand Up @@ -375,6 +381,7 @@
7230D7551E05E8C70001F3E9 /* GeneralPreferencesViewController.xib in Resources */,
725AA5E61E05DE22006E5DDE /* PreferencesWindowController.xib in Resources */,
725AA5C21E05BF3A006E5DDE /* Assets.xcassets in Resources */,
AAA3A2A31E0F3F0F0015165E /* Localizable.strings in Resources */,
728EB9441E06661800920B83 /* AboutPreferencesViewController.xib in Resources */,
725AA5C51E05BF3A006E5DDE /* MainMenu.xib in Resources */,
7230D75A1E05F4960001F3E9 /* CreditsPreferencesViewController.xib in Resources */,
Expand Down Expand Up @@ -482,6 +489,7 @@
isa = PBXVariantGroup;
children = (
725AA5C41E05BF3A006E5DDE /* Base */,
AAA3A2A11E0F3EFF0015165E /* fr */,
);
name = MainMenu.xib;
sourceTree = "<group>";
Expand All @@ -490,17 +498,28 @@
isa = PBXVariantGroup;
children = (
72DA73611E09FE19003F9262 /* Base */,
AAA3A2A21E0F3F000015165E /* fr */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
AAA3A2A51E0F3F0F0015165E /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
AAA3A2A61E0F3F120015165E /* en */,
AAA3A2A71E0F3F150015165E /* fr */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
725AA5C71E05BF3A006E5DDE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -551,6 +570,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down
3 changes: 2 additions & 1 deletion Juice/Classes/ChargeScaleDisplay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import Cocoa

protocol ChargeScaleDisplay {
var title: String { get }
Expand Down Expand Up @@ -52,7 +53,7 @@ extension SerializableChargeScaleDisplay where Self: ChargeScaleDisplay {
let data = try PropertyListSerialization.data(fromPropertyList: plistValues, format: .xml, options: .allZeros)
try data.write(to: completeFilePath, options: .atomicWrite)
} catch (let error) {
print("Error serializing scale: \(error)")
print(NSLocalizedString("Error serializing scale", comment: "Error serializing scale") + ": \(error)")
}
}
}
2 changes: 1 addition & 1 deletion Juice/Classes/GeneralPreferencesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class GeneralPreferencesViewController: NSViewController {

statusBarStylePopUp.selectItem(withTitle: preferences.chargeDisplayScale.value.title)

scalesFoundLabel.stringValue = "\(scales.count) Scales Found"
scalesFoundLabel.stringValue = "\(scales.count) " + NSLocalizedString("Scales Found", comment: "Scales Found")
}

@IBAction func addNewScale(_ sender: Any) {
Expand Down
15 changes: 8 additions & 7 deletions Juice/Classes/PowerSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import IOKit.ps
import Cocoa

enum PowerSourceState: String {
case unknown = "Unknown"
Expand All @@ -17,13 +18,13 @@ enum PowerSourceState: String {
var displayValue: String {
switch self {
case .unknown:
return "Unknown"
return NSLocalizedString("Unknown", comment: "Unknown")
case .offLine:
return "Off Line"
return NSLocalizedString("Off Line", comment: "Off Line")
case .ac:
return "Power Adapter"
return NSLocalizedString("Power Adapter", comment: "Power Adapter")
case .battery:
return "Battery"
return NSLocalizedString("Battery", comment: "Battery")
}
}
}
Expand All @@ -36,11 +37,11 @@ enum PowerSourceType: String {
var displayValue: String {
switch self {
case .unknown:
return "Unknown"
return NSLocalizedString("Unknown", comment: "Unknown")
case .battery:
return "Battery"
return NSLocalizedString("Battery", comment: "Battery")
case .ups:
return "External Power"
return NSLocalizedString("External Power", comment: "External Power")
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions Juice/Classes/PreferencesCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import AppKit
import Cocoa

final class PreferencesCoordinator: PreferencesWindowControllerDelegate {

Expand All @@ -24,13 +25,13 @@ final class PreferencesCoordinator: PreferencesWindowControllerDelegate {

case PreferencesWindowController.Identifiers.General:
windowController.contentViewController = GeneralPreferencesViewController()
windowController.window?.title = "General"
windowController.window?.title = NSLocalizedString("General", comment: "General")
case PreferencesWindowController.Identifiers.Credits:
windowController.contentViewController = CreditsPreferencesViewController()
windowController.window?.title = "Credits"
windowController.window?.title = NSLocalizedString("Credits", comment: "Credits")
case PreferencesWindowController.Identifiers.Tip:
windowController.contentViewController = AboutPreferencesViewController()
windowController.window?.title = "About"
windowController.window?.title = NSLocalizedString("About", comment: "About")
default:
break
}
Expand Down
2 changes: 1 addition & 1 deletion Juice/Classes/PreferencesStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class PreferencesStorage {
self?.chargeDisplayScale.value = scale
}
} catch (let error) {
print("Error scanning application support directory: \(error)")
print(NSLocalizedString("Error scanning application support directory", comment: "Error scanning application support directory") + ": \(error)")
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions Juice/Classes/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,27 @@ final class PreferencesWindowController: NSWindowController, NSToolbarDelegate {
switch itemIdentifier {
case Identifiers.General:
return customToolbarItem(itemForItemIdentifier: Identifiers.General,
label: "General",
paletteLabel: "General",
toolTip: "General Settings",
label: NSLocalizedString("General", comment: "General"),
paletteLabel: NSLocalizedString("General", comment: "General"),
toolTip: NSLocalizedString("General Settings", comment: "General Settings"),
target: self,
itemContent: NSImage(named: "General Icon"),
action: #selector(generalToolbarItemClicked),
menu: nil)
case Identifiers.Credits:
return customToolbarItem(itemForItemIdentifier: Identifiers.Credits,
label: "Credits",
paletteLabel: "Credits",
toolTip: "Credits for this app",
label: NSLocalizedString("Credits", comment: "Credits"),
paletteLabel: NSLocalizedString("Credits", comment: "Credits"),
toolTip: NSLocalizedString("Credits for this app", comment: "Credits for this app"),
target: self,
itemContent: NSImage(named: "Credits Icon"),
action: #selector(creditsToolbarItemClicked),
menu: nil)
case Identifiers.Tip:
return customToolbarItem(itemForItemIdentifier: Identifiers.Tip,
label: "About",
paletteLabel: "About",
toolTip: "Version Information",
label: NSLocalizedString("About", comment: "About"),
paletteLabel: NSLocalizedString("About", comment: "About"),
toolTip: NSLocalizedString("Version Information", comment: "Version Information"),
target: self,
itemContent: NSImage(named: "Tip Icon"),
action: #selector(tipToolbarItemClicked),
Expand Down
14 changes: 7 additions & 7 deletions Juice/Classes/StatusItemMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ final class StatusMenuItem: NSMenu {
override init(title: String) {
super.init(title: title)

percentageItem.toolTip = "Indicates the current battery charge percentage"
percentageItem.toolTip = NSLocalizedString("Indicates the current battery charge percentage", comment: "Indicates the current battery charge percentage")

addItem(percentageItem)
addItem(sourceTypeItem)
addItem(NSMenuItem.separator())
addItem(withTitle: "Preferences...", action: #selector(preferencesClicked), keyEquivalent: "").target = self
addItem(withTitle: NSLocalizedString("Preferences", comment: "Preferences"), action: #selector(preferencesClicked), keyEquivalent: "").target = self
addItem(NSMenuItem.separator())
addItem(withTitle: "Quit Juice", action: #selector(quitClicked), keyEquivalent: "q").target = self
addItem(withTitle: NSLocalizedString("Quit Juice", comment: "Quit Juice"), action: #selector(quitClicked), keyEquivalent: "q").target = self
}

required init(coder decoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
fatalError("init(coder:) " + NSLocalizedString("has not been implemented", comment: "has not been implemented"))
}

func update(from source: PowerSource) {
if source.charging {
percentageItem.title = "\(source.chargedPercentage)% Charged"
percentageItem.title = "\(source.chargedPercentage)% " + NSLocalizedString("Charged", comment: "Charged")
}
else {
percentageItem.title = "\(source.chargedPercentage)% Remaining"
percentageItem.title = "\(source.chargedPercentage)% " + NSLocalizedString("Remaining", comment: "Remaining")
}
sourceTypeItem.title = "Power Source: \(source.state.displayValue)"
sourceTypeItem.title = NSLocalizedString("Power Source", comment: "Power Source") + ": \(source.state.displayValue)"
}

@objc private func preferencesClicked() {
Expand Down
21 changes: 21 additions & 0 deletions Juice/Classes/en.lproj/GeneralPreferencesViewController.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

/* Class = "NSTextFieldCell"; title = "Rescan For Scales:"; ObjectID = "0hr-m8-QTZ"; */
"0hr-m8-QTZ.title" = "Rescan For Scales:";

/* Class = "NSTextFieldCell"; title = "0 Scales Found"; ObjectID = "1EL-UD-CHx"; */
"1EL-UD-CHx.title" = "0 Scales Found";

/* Class = "NSTextFieldCell"; title = "Launch:"; ObjectID = "3wZ-4R-SJn"; */
"3wZ-4R-SJn.title" = "Launch:";

/* Class = "NSButtonCell"; title = "Rescan"; ObjectID = "M2Y-9t-TVn"; */
"M2Y-9t-TVn.title" = "Rescan";

/* Class = "NSButtonCell"; title = "Atomatically on system start"; ObjectID = "Q6i-XV-814"; */
"Q6i-XV-814.title" = "Atomatically on system start";

/* Class = "NSTextFieldCell"; title = "Current Scale:"; ObjectID = "pSb-PT-l5y"; */
"pSb-PT-l5y.title" = "Current Scale:";

/* Class = "NSButtonCell"; title = "Add Scale"; ObjectID = "xXL-NV-2xU"; */
"xXL-NV-2xU.title" = "Add Scale";
21 changes: 21 additions & 0 deletions Juice/Classes/fr.lproj/GeneralPreferencesViewController.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

/* Class = "NSTextFieldCell"; title = "Rescan For Scales:"; ObjectID = "0hr-m8-QTZ"; */
"0hr-m8-QTZ.title" = "Rescan For Scales:";

/* Class = "NSTextFieldCell"; title = "0 Scales Found"; ObjectID = "1EL-UD-CHx"; */
"1EL-UD-CHx.title" = "0 Scales Found";

/* Class = "NSTextFieldCell"; title = "Launch:"; ObjectID = "3wZ-4R-SJn"; */
"3wZ-4R-SJn.title" = "Launch:";

/* Class = "NSButtonCell"; title = "Rescan"; ObjectID = "M2Y-9t-TVn"; */
"M2Y-9t-TVn.title" = "Rescan";

/* Class = "NSButtonCell"; title = "Atomatically on system start"; ObjectID = "Q6i-XV-814"; */
"Q6i-XV-814.title" = "Démarrer Juice à la connexion";

/* Class = "NSTextFieldCell"; title = "Current Scale:"; ObjectID = "pSb-PT-l5y"; */
"pSb-PT-l5y.title" = "Current Scale:";

/* Class = "NSButtonCell"; title = "Add Scale"; ObjectID = "xXL-NV-2xU"; */
"xXL-NV-2xU.title" = "Add Scale";
Loading

0 comments on commit ee4caec

Please sign in to comment.