Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: improve handling of incomplete locales #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Sources/WireGuardApp/LocalizationHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@

import Foundation

/// Gets the English string from Base.lproj as a fallback for missing translations.
func tr_base(_ key: String) -> String {
let baseBundlePath: String? = Bundle.main.path(forResource: "Base", ofType: "lproj")
let baseBundle: Bundle? = Bundle(path: baseBundlePath ?? "") ?? nil
return baseBundle?.localizedString(forKey: key, value: nil, table: nil) ?? key
}

func tr(_ key: String) -> String {
return NSLocalizedString(key, comment: "")
return NSLocalizedString(key, value: tr_base(key), comment: "")
}

func tr(format: String, _ arguments: CVarArg...) -> String {
return String(format: NSLocalizedString(format, comment: ""), arguments: arguments)
return String(format: NSLocalizedString(format, value: tr_base(format), comment: ""), arguments: arguments)
}
178 changes: 0 additions & 178 deletions Sources/WireGuardApp/ca.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -95,181 +95,3 @@
"macMenuManageTunnels" = "Gestiona túnels";
"macMenuCut" = "Talla";
"macMenuCopy" = "Copia";
"newTunnelViewTitle" = "New configuration";
"macMenuDeleteSelected" = "Delete Selected";
"alertSystemErrorMessageTunnelConfigurationInvalid" = "The configuration is invalid.";
"tunnelPeerEndpoint" = "Endpoint";
"tunnelInterfaceMTU" = "MTU";
"alertInvalidInterfaceMessageListenPortInvalid" = "Interface’s listen port must be between 0 and 65535, or unspecified";
"addPeerButtonTitle" = "Add peer";
"tunnelHandshakeTimestampSystemClockBackward" = "(System clock wound backwards)";
"macMenuTitle" = "WireGuard";
"macAlertNoInterface" = "Configuration must have an ‘Interface’ section.";
"macNameFieldExportZip" = "Export tunnels to:";
"editTunnelViewTitle" = "Edit configuration";
"alertSystemErrorMessageTunnelConfigurationUnknown" = "Unknown system error.";
"macEditDiscard" = "Discard";
"macSheetButtonExportZip" = "Save";
"macWindowTitleManageTunnels" = "Manage WireGuard Tunnels";
"tunnelsListTitle" = "WireGuard";
"macConfirmAndQuitAlertInfo" = "If you close the tunnels manager, WireGuard will continue to be available from the menu bar icon.";
"macUnusableTunnelInfo" = "In case this tunnel was created by another user, only that user can view, edit, or activate this tunnel.";
"alertTunnelActivationErrorTunnelIsNotInactiveMessage" = "The tunnel is already active or in the process of being activated";
"alertTunnelActivationSetNetworkSettingsMessage" = "Unable to apply network settings to tunnel object.";
"macMenuExportTunnels" = "Export Tunnels to Zip…";
"macMenuShowAllApps" = "Show All";
"alertCantOpenInputConfFileTitle" = "Unable to import from file";
"macMenuHideApp" = "Hide WireGuard";
"macDeleteTunnelConfirmationAlertInfo" = "You cannot undo this action.";
"macDeleteTunnelConfirmationAlertButtonTitleDeleting" = "Deleting…";
"tunnelPeerPersistentKeepalive" = "Persistent keepalive";
"alertSystemErrorMessageTunnelConnectionFailed" = "The connection failed.";
"macButtonEdit" = "Edit";
"macAlertPublicKeyInvalid" = "Public key is invalid";
"tunnelOnDemandOptionWiFiOnly" = "Wi-Fi only";
"macNameFieldExportLog" = "Save log to:";
"alertSystemErrorOnAddTunnelTitle" = "Unable to create tunnel";
"macConfirmAndQuitAlertMessage" = "Do you want to close the tunnels manager or quit WireGuard entirely?";
"alertTunnelActivationSavedConfigFailureMessage" = "Unable to retrieve tunnel information from the saved configuration.";
"tunnelOnDemandOptionOff" = "Off";
"tunnelOnDemandSectionTitleSelectedSSIDs" = "SSIDs";
"macAlertInfoUnrecognizedInterfaceKey" = "Valid keys are: ‘PrivateKey’, ‘ListenPort’, ‘Address’, ‘DNS’ and ‘MTU’.";
"macLogColumnTitleTime" = "Time";
"actionOK" = "OK";
"alertTunnelNameEmptyMessage" = "Cannot create tunnel with an empty name";
"alertInvalidInterfaceMessageMTUInvalid" = "Interface’s MTU must be between 576 and 65535, or unspecified";
"tunnelOnDemandWiFi" = "Wi-Fi";
"alertTunnelNameEmptyTitle" = "No name provided";
"alertUnableToWriteLogMessage" = "Unable to write logs to file";
"macToggleStatusButtonActivating" = "Activating…";
"macMenuQuit" = "Quit WireGuard";
"macMenuAddEmptyTunnel" = "Add Empty Tunnel…";
"tunnelStatusDeactivating" = "Deactivating";
"alertInvalidInterfaceTitle" = "Invalid interface";
"tunnelSectionTitleStatus" = "Status";
"macDeleteTunnelConfirmationAlertButtonTitleDelete" = "Delete";
"alertTunnelActivationFailureTitle" = "Activation failure";
"macLogButtonTitleClose" = "Close";
"tunnelOnDemandSSIDViewTitle" = "SSIDs";
"tunnelOnDemandOptionCellularOnly" = "Cellular only";
"tunnelEditPlaceholderTextOptional" = "Optional";
"settingsExportZipButtonTitle" = "Export zip archive";
"tunnelSectionTitleOnDemand" = "On-Demand Activation";
"deleteTunnelsConfirmationAlertButtonTitle" = "Delete";
"alertInvalidInterfaceMessageNameRequired" = "Interface name is required";
"tunnelEditPlaceholderTextAutomatic" = "Automatic";
"macViewPrivateData" = "view tunnel private keys";
"alertInvalidPeerMessageEndpointInvalid" = "Peer’s endpoint must be of the form ‘host:port’ or ‘[host]:port’";
"alertTunnelActivationErrorTunnelIsNotInactiveTitle" = "Activation in progress";
"addTunnelMenuImportFile" = "Create from file or archive";
"deletePeerConfirmationAlertButtonTitle" = "Delete";
"addTunnelMenuQRCode" = "Create from QR code";
"alertInvalidPeerMessagePreSharedKeyInvalid" = "Peer’s preshared key must be a 32-byte key in base64 encoding";
"macAppExitingWithActiveTunnelInfo" = "The tunnel will remain active after exiting. You may disable it by reopening this application or through the Network panel in System Preferences.";
"macMenuEdit" = "Edit";
"donateLink" = "♥ Donate to the WireGuard Project";
"macMenuWindow" = "Window";
"tunnelStatusRestarting" = "Restarting";
"tunnelHandshakeTimestampNow" = "Now";
"alertTunnelActivationFailureMessage" = "The tunnel could not be activated. Please ensure that you are connected to the Internet.";
"tunnelInterfaceListenPort" = "Listen port";
"tunnelOnDemandOptionEthernetOnly" = "Ethernet only";
"macMenuHideOtherApps" = "Hide Others";
"alertCantOpenInputZipFileMessage" = "The zip archive could not be read.";
"alertInvalidInterfaceMessagePrivateKeyInvalid" = "Interface’s private key must be a 32-byte key in base64 encoding";
"deleteTunnelButtonTitle" = "Delete tunnel";
"alertInvalidInterfaceMessageDNSInvalid" = "Interface’s DNS servers must be a list of comma-separated IP addresses";
"tunnelStatusInactive" = "Inactive";
"macAlertPrivateKeyInvalid" = "Private key is invalid.";
"deleteTunnelConfirmationAlertMessage" = "Delete this tunnel?";
"macDeleteTunnelConfirmationAlertButtonTitleCancel" = "Cancel";
"alertSystemErrorMessageTunnelConfigurationDisabled" = "The configuration is disabled.";
"alertInvalidPeerMessagePersistentKeepaliveInvalid" = "Peer’s persistent keepalive must be between 0 to 65535, or unspecified";
"macMenuNetworksNone" = "Networks: None";
"tunnelOnDemandSSIDsKey" = "SSIDs";
"alertCantOpenOutputZipFileForWritingMessage" = "Could not open zip file for writing.";
"macMenuSelectAll" = "Select All";
"alertInvalidPeerMessagePublicKeyInvalid" = "Peer’s public key must be a 32-byte key in base64 encoding";
"tunnelOnDemandCellular" = "Cellular";
"macConfirmAndQuitAlertQuitWireGuard" = "Quit WireGuard";
"alertSystemErrorOnRemoveTunnelTitle" = "Unable to remove tunnel";
"macFieldOnDemand" = "On-Demand:";
"macMenuCloseWindow" = "Close Window";
"macSheetButtonExportLog" = "Save";
"tunnelOnDemandOptionWiFiOrCellular" = "Wi-Fi or cellular";
"alertSystemErrorOnModifyTunnelTitle" = "Unable to modify tunnel";
"alertSystemErrorMessageTunnelConfigurationReadWriteFailed" = "Reading or writing the configuration failed.";
"macMenuEditTunnel" = "Edit…";
"macButtonImportTunnels" = "Import tunnel(s) from file";
"macAppExitingWithActiveTunnelMessage" = "WireGuard is exiting with an active tunnel";
"alertSystemErrorMessageTunnelConfigurationStale" = "The configuration is stale.";
"tunnelPeerPreSharedKey" = "Preshared key";
"alertTunnelDNSFailureMessage" = "One or more endpoint domains could not be resolved.";
"alertInvalidInterfaceMessageAddressInvalid" = "Interface addresses must be a list of comma-separated IP addresses, optionally in CIDR notation";
"alertNoTunnelsInImportedZipArchiveTitle" = "No tunnels in zip archive";
"alertTunnelDNSFailureTitle" = "DNS resolution failure";
"macLogButtonTitleSave" = "Save…";
"macMenuToggleStatus" = "Toggle Status";
"macMenuMinimize" = "Minimize";
"deletePeerButtonTitle" = "Delete peer";
"alertCantOpenInputZipFileTitle" = "Unable to read zip archive";
"alertSystemErrorOnListingTunnelsTitle" = "Unable to list tunnels";
"settingsVersionKeyWireGuardForIOS" = "WireGuard for iOS";
"macMenuPaste" = "Paste";
"macAlertMultipleInterfaces" = "Configuration must have only one ‘Interface’ section.";
"macAppStoreUpdatingAlertMessage" = "App Store would like to update WireGuard";
"macUnusableTunnelMessage" = "The configuration for this tunnel cannot be found in the keychain.";
"macToolTipEditTunnel" = "Edit tunnel (⌘E)";
"tunnelEditPlaceholderTextStronglyRecommended" = "Strongly recommended";
"macMenuZoom" = "Zoom";
"alertBadArchiveTitle" = "Unable to read zip archive";
"macExportPrivateData" = "export tunnel private keys";
"alertTunnelAlreadyExistsWithThatNameTitle" = "Name already exists";
"iosViewPrivateData" = "Authenticate to view tunnel private keys.";
"tunnelPeerLastHandshakeTime" = "Latest handshake";
"macAlertPreSharedKeyInvalid" = "Preshared key is invalid";
"alertBadConfigImportTitle" = "Unable to import tunnel";
"macEditSave" = "Save";
"macConfirmAndQuitAlertCloseWindow" = "Close Tunnels Manager";
"macMenuFile" = "File";
"tunnelStatusActivating" = "Activating";
"macToolTipToggleStatus" = "Toggle status (⌘T)";
"macTunnelsMenuTitle" = "Tunnels";
"alertTunnelActivationSystemErrorTitle" = "Activation failure";
"alertInvalidInterfaceMessagePrivateKeyRequired" = "Interface’s private key is required";
"alertNoTunnelsToExportTitle" = "Nothing to export";
"scanQRCodeTipText" = "Tip: Generate with `qrencode -t ansiutf8 < tunnel.conf`";
"alertNoTunnelsToExportMessage" = "There are no tunnels to export";
"macMenuImportTunnels" = "Import Tunnel(s) from File…";
"macMenuViewLog" = "View Log";
"macAlertInfoUnrecognizedPeerKey" = "Valid keys are: ‘PublicKey’, ‘PresharedKey’, ‘AllowedIPs’, ‘Endpoint’ and ‘PersistentKeepalive’";
"tunnelOnDemandNoSSIDs" = "No SSIDs";
"deleteTunnelConfirmationAlertButtonTitle" = "Delete";
"tunnelEditPlaceholderTextOff" = "Off";
"addTunnelMenuHeader" = "Add a new WireGuard tunnel";
"macUnusableTunnelButtonTitleDeleteTunnel" = "Delete tunnel";
"tunnelEditPlaceholderTextRequired" = "Required";
"tunnelStatusReasserting" = "Reactivating";
"macMenuTunnel" = "Tunnel";
"alertTunnelAlreadyExistsWithThatNameMessage" = "A tunnel with that name already exists";
"macLogColumnTitleLogMessage" = "Log message";
"iosExportPrivateData" = "Authenticate to export tunnel private keys.";
"macMenuAbout" = "About WireGuard";
"macSheetButtonImport" = "Import";
"alertScanQRCodeNamePromptTitle" = "Please name the scanned tunnel";
"alertUnableToRemovePreviousLogMessage" = "The pre-existing log could not be cleared";
"alertTunnelActivationBackendFailureMessage" = "Unable to turn on Go backend library.";
"settingsSectionTitleExportConfigurations" = "Export configurations";
"alertBadArchiveMessage" = "Bad or corrupt zip archive.";
"settingsVersionKeyWireGuardGoBackend" = "WireGuard Go Backend";
"macFieldOnDemandSSIDs" = "SSIDs:";
"deletePeerConfirmationAlertMessage" = "Delete this peer?";
"alertCantOpenOutputZipFileForWritingTitle" = "Unable to create zip archive";
"tunnelStatusActive" = "Active";
"tunnelStatusWaiting" = "Waiting";
"alertNoTunnelsInImportedZipArchiveMessage" = "No .conf tunnel files were found inside the zip archive.";
"alertTunnelActivationFileDescriptorFailureMessage" = "Unable to determine TUN device file descriptor.";
"addTunnelMenuFromScratch" = "Create from scratch";
"tunnelOnDemandOptionWiFiOrEthernet" = "Wi-Fi or ethernet";
"macToggleStatusButtonActivate" = "Activate";
"macAlertNameIsEmpty" = "Name is required";
1 change: 0 additions & 1 deletion Sources/WireGuardApp/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,3 @@
// Donation

"donateLink" = "♥ Spende an das WireGuard Projekt";
"macTunnelsMenuTitle" = "Tunnels";
36 changes: 0 additions & 36 deletions Sources/WireGuardApp/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -356,39 +356,3 @@
// Donation

"donateLink" = "♥ Donar al Proyecto WireGuard";
"macAlertNoInterface" = "Configuration must have an ‘Interface’ section.";
"macConfirmAndQuitAlertInfo" = "If you close the tunnels manager, WireGuard will continue to be available from the menu bar icon.";
"macUnusableTunnelInfo" = "In case this tunnel was created by another user, only that user can view, edit, or activate this tunnel.";
"alertTunnelActivationErrorTunnelIsNotInactiveMessage" = "The tunnel is already active or in the process of being activated";
"alertTunnelActivationSetNetworkSettingsMessage" = "Unable to apply network settings to tunnel object.";
"macMenuExportTunnels" = "Export Tunnels to Zip…";
"alertCantOpenInputConfFileTitle" = "Unable to import from file";
"macConfirmAndQuitAlertMessage" = "Do you want to close the tunnels manager or quit WireGuard entirely?";
"macAlertInfoUnrecognizedInterfaceKey" = "Valid keys are: ‘PrivateKey’, ‘ListenPort’, ‘Address’, ‘DNS’ and ‘MTU’.";
"alertTunnelNameEmptyMessage" = "Cannot create tunnel with an empty name";
"alertTunnelNameEmptyTitle" = "No name provided";
"macMenuAddEmptyTunnel" = "Add Empty Tunnel…";
"macViewPrivateData" = "view tunnel private keys";
"alertTunnelActivationErrorTunnelIsNotInactiveTitle" = "Activation in progress";
"macAppExitingWithActiveTunnelInfo" = "The tunnel will remain active after exiting. You may disable it by reopening this application or through the Network panel in System Preferences.";
"macMenuHideOtherApps" = "Hide Others";
"macAlertPrivateKeyInvalid" = "Private key is invalid.";
"macMenuNetworksNone" = "Networks: None";
"alertSystemErrorMessageTunnelConfigurationReadWriteFailed" = "Reading or writing the configuration failed.";
"macAppExitingWithActiveTunnelMessage" = "WireGuard is exiting with an active tunnel";
"alertSystemErrorMessageTunnelConfigurationStale" = "The configuration is stale.";
"alertTunnelDNSFailureMessage" = "One or more endpoint domains could not be resolved.";
"alertSystemErrorOnListingTunnelsTitle" = "Unable to list tunnels";
"macAlertMultipleInterfaces" = "Configuration must have only one ‘Interface’ section.";
"macMenuZoom" = "Zoom";
"macExportPrivateData" = "export tunnel private keys";
"alertTunnelAlreadyExistsWithThatNameTitle" = "Name already exists";
"iosViewPrivateData" = "Authenticate to view tunnel private keys.";
"macTunnelsMenuTitle" = "Tunnels";
"alertTunnelAlreadyExistsWithThatNameMessage" = "A tunnel with that name already exists";
"iosExportPrivateData" = "Authenticate to export tunnel private keys.";
"alertTunnelActivationBackendFailureMessage" = "Unable to turn on Go backend library.";
"settingsVersionKeyWireGuardGoBackend" = "WireGuard Go Backend";
"alertNoTunnelsInImportedZipArchiveMessage" = "No .conf tunnel files were found inside the zip archive.";
"alertTunnelActivationFileDescriptorFailureMessage" = "Unable to determine TUN device file descriptor.";
"macAlertNameIsEmpty" = "Name is required";
Loading