Localize "Default" string

This commit is contained in:
Davide De Rosa 2021-01-03 17:37:36 +01:00
parent bcffd9fd4a
commit 4575d660b1
21 changed files with 26 additions and 18 deletions

View File

@ -551,6 +551,8 @@ internal enum L10n {
internal enum Values {
/// Automatic
internal static let automatic = L10n.tr("Core", "global.values.automatic")
/// Default
internal static let `default` = L10n.tr("Core", "global.values.default")
/// Disabled
internal static let disabled = L10n.tr("Core", "global.values.disabled")
/// Enabled

View File

@ -514,7 +514,7 @@ extension NetworkSettingsViewController {
case .mtuBytes:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Core.NetworkSettings.Mtu.Cells.Bytes.caption
cell.rightText = networkSettings.mtuBytes?.description ?? "Default"
cell.rightText = networkSettings.mtuBytes?.description ?? L10n.Core.Global.Values.default
return cell
}
}
@ -616,7 +616,7 @@ extension NetworkSettingsViewController {
vc.options = ProfileNetworkSettings.mtuOptions
vc.descriptionBlock = {
guard $0 != 0 else {
return "Default"
return L10n.Core.Global.Values.default
}
return $0.description
}

View File

@ -232,7 +232,7 @@ extension ProviderPoolViewController: UITableViewDataSource, UITableViewDelegate
vc.title = group.localizedCountry
vc.options = group.pools.sortedPools()
vc.selectedOption = currentPool
vc.descriptionBlock = { !$0.secondaryId.isEmpty ? $0.secondaryId : "Default" }
vc.descriptionBlock = { !$0.secondaryId.isEmpty ? $0.secondaryId : L10n.Core.Global.Values.default }
vc.selectionBlock = {
self.currentPool = $0
self.delegate?.providerPoolController(self, didSelectPool: $0)

View File

@ -35,12 +35,6 @@ internal enum L10n {
internal static let `protocol` = L10n.tr("App", "endpoint.cells.protocol")
}
}
internal enum Global {
internal enum Values {
/// Default
internal static let `default` = L10n.tr("App", "global.values.default")
}
}
internal enum Menu {
internal enum ActiveProfile {
internal enum Items {
@ -547,6 +541,8 @@ internal enum L10n {
internal enum Values {
/// Automatic
internal static let automatic = L10n.tr("Core", "global.values.automatic")
/// Default
internal static let `default` = L10n.tr("Core", "global.values.default")
/// Disabled
internal static let disabled = L10n.tr("Core", "global.values.disabled")
/// Enabled

View File

@ -306,7 +306,7 @@ class StatusMenu: NSObject {
let infrastructure = providerProfile.infrastructure
for category in infrastructure.categories {
let title = category.name.isEmpty ? L10n.App.Global.Values.default : category.name.capitalized
let title = category.name.isEmpty ? L10n.Core.Global.Values.default : category.name.capitalized
let submenu = NSMenu()
let item = NSMenuItem(title: title, action: nil, keyEquivalent: "")
item.indentationLevel = 1
@ -325,7 +325,7 @@ class StatusMenu: NSObject {
itemGroup.state = .on
}
let title = !pool.secondaryId.isEmpty ? pool.secondaryId : "Default"
let title = !pool.secondaryId.isEmpty ? pool.secondaryId : L10n.Core.Global.Values.default
let item = NSMenuItem(title: title, action: #selector(connectToPool(_:)), keyEquivalent: "")
if let extraCountry = pool.extraCountries?.first {
item.image = extraCountry.image

View File

@ -131,7 +131,7 @@ class ConfigurationViewController: NSViewController, ProfileCustomization {
popupCompressionFraming.isEnabled = false
popupCompressionAlgorithm.isEnabled = false
} else {
popupPreset.addItem(withTitle: L10n.App.Global.Values.default)
popupPreset.addItem(withTitle: L10n.Core.Global.Values.default)
popupPreset.isEnabled = false
}

View File

@ -67,7 +67,7 @@ class MTUViewController: NSViewController, ProfileCustomization {
labelMTUCaption.stringValue = L10n.Core.NetworkSettings.Mtu.Cells.Bytes.caption.asCaption
popupMTU.removeAllItems()
for opt in ProfileNetworkSettings.mtuOptions {
popupMTU.addItem(withTitle: (opt != 0) ? opt.description : "Default")
popupMTU.addItem(withTitle: (opt != 0) ? opt.description : L10n.Core.Global.Values.default)
}
loadSettings(from: currentChoice ?? ProfileNetworkChoices.defaultChoice)
}
@ -115,7 +115,7 @@ class MTUViewController: NSViewController, ProfileCustomization {
popupMTU.isEnabled = (currentChoice == .manual)
for (i, opt) in popupMTU.itemTitles.enumerated() {
if opt == "Default" {
if opt == L10n.Core.Global.Values.default {
if bytes == nil {
popupMTU.selectItem(at: i)
break

View File

@ -153,7 +153,7 @@ class ProviderServiceView: NSView {
categories.forEach {
let categoryTitle: String
if $0.name.isEmpty {
categoryTitle = L10n.App.Global.Values.default
categoryTitle = L10n.Core.Global.Values.default
} else {
categoryTitle = $0.name.capitalized
}
@ -228,7 +228,7 @@ class ProviderServiceView: NSView {
guard !$0.secondaryId.isEmpty || currentSortedPools.count > 1 else {
return
}
let title = !$0.secondaryId.isEmpty ? $0.secondaryId : "Default"
let title = !$0.secondaryId.isEmpty ? $0.secondaryId : L10n.Core.Global.Values.default
let item = NSMenuItem(title: title, action: nil, keyEquivalent: "")
if let extraCountry = $0.extraCountries?.first {
item.image = extraCountry.image

View File

@ -23,8 +23,6 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
"global.values.default" = "Default";
"vpn.unused" = "Off";
"organizer.title" = "%@";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Dieses Profil verwenden";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Χρησιμοποιήστε αυτό το προφίλ";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -30,6 +30,7 @@
"global.host.title_input.message" = "Acceptable characters are alphanumerics plus dash \"-\", underscore \"_\" and dot \".\".";
"global.host.title_input.placeholder" = "My profile";
"global.email_not_configured" = "No e-mail account is configured.";
"global.values.default" = "Default";
"global.captions.address" = "Address";
"global.captions.port" = "Port";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Usar este perfil";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Utiliser ce profile";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Usa questo profilo";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Gebruik dit profiel";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -39,6 +39,7 @@
"global.values.none" = "Brak";
"global.values.automatic" = "Automatycznie";
"global.values.manual" = "Ręcznie";
"global.values.default" = "Default";
"reddit.title" = "Reddit";
"reddit.message" = "Wiedziałeś/łaś, że Passepartout ma swój subreddit? Subskrybuj dla aktualizacji, dyskusji o funkcjonalności, nowych platformach lub o czymkolwiek zechcesz.\n\nTo również świetny sposób na okazanie zainteresowania projektem.";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Usar esse perfil";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Использовать это профиль.";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "байты";
"global.values.default" = "По умолчанию";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "Använd den här profilen";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "Default";

View File

@ -238,3 +238,4 @@
"service.cells.use_profile.caption" = "使用此配置";
"network_settings.mtu.title" = "MTU";
"network_settings.mtu.cells.bytes.caption" = "Bytes";
"global.values.default" = "默认";