mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
👌 Localisation improvements
This commit is contained in:
@ -149,8 +149,10 @@ class PhpEnv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func validVersions(for constraint: String) -> [PhpVersionNumber] {
|
public func validVersions(for constraint: String) -> [PhpVersionNumber] {
|
||||||
return PhpVersionNumberCollection
|
constraint.split(separator: "|").flatMap {
|
||||||
.make(from: self.availablePhpVersions)
|
return PhpVersionNumberCollection
|
||||||
.matching(constraint: constraint)
|
.make(from: self.availablePhpVersions)
|
||||||
|
.matching(constraint: $0.trimmingCharacters(in: .whitespacesAndNewlines))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ struct ComposerJson: Decodable {
|
|||||||
|
|
||||||
// Check if in dependencies
|
// Check if in dependencies
|
||||||
if dependencies?["php"] != nil {
|
if dependencies?["php"] != nil {
|
||||||
return (dependencies!["php"]!, "dependency list")
|
return (dependencies!["php"]!, "require")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unknown!
|
// Unknown!
|
||||||
|
@ -87,19 +87,17 @@ class SiteListCell: NSTableCellView
|
|||||||
alert.informativeText = "alert.composer_php_requirement.info"
|
alert.informativeText = "alert.composer_php_requirement.info"
|
||||||
.localized(site.composerPhpSource)
|
.localized(site.composerPhpSource)
|
||||||
|
|
||||||
alert.addButton(withTitle: "Close")
|
alert.addButton(withTitle: "site_link.close".localized)
|
||||||
|
|
||||||
var mapIndex: Int = NSApplication.ModalResponse.alertSecondButtonReturn.rawValue
|
var mapIndex: Int = NSApplication.ModalResponse.alertSecondButtonReturn.rawValue
|
||||||
var map: [Int: String] = [:]
|
var map: [Int: String] = [:]
|
||||||
|
|
||||||
// Determine which installed versions would be ideal to switch to,
|
// Determine which installed versions would be ideal to switch to,
|
||||||
// but make sure to exclude the currently linked version
|
// but make sure to exclude the currently linked version
|
||||||
site.composerPhp.split(separator: "|").flatMap { string in
|
PhpEnv.shared.validVersions(for: site.composerPhp).filter({ version in
|
||||||
return PhpEnv.shared.validVersions(for: string.trimmingCharacters(in: .whitespacesAndNewlines))
|
|
||||||
}.filter({ version in
|
|
||||||
version.homebrewVersion != PhpEnv.phpInstall.version.short
|
version.homebrewVersion != PhpEnv.phpInstall.version.short
|
||||||
}).forEach { version in
|
}).forEach { version in
|
||||||
alert.addButton(withTitle: "Switch to PHP \(version.homebrewVersion)")
|
alert.addButton(withTitle: "site_link.switch_to_php".localized(version.homebrewVersion))
|
||||||
map[mapIndex] = version.homebrewVersion
|
map[mapIndex] = version.homebrewVersion
|
||||||
mapIndex += 1
|
mapIndex += 1
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,17 @@
|
|||||||
"site_list.confirm_unlink" = "Are you sure you want to unlink '%@'?";
|
"site_list.confirm_unlink" = "Are you sure you want to unlink '%@'?";
|
||||||
"site_link.confirm_link" = "No files will be removed. If needed, the site will need to be relinked via the command line.";
|
"site_link.confirm_link" = "No files will be removed. If needed, the site will need to be relinked via the command line.";
|
||||||
|
|
||||||
|
"site_link.close" = "Close";
|
||||||
|
"site_link.switch_to_php" = "Switch to PHP %@";
|
||||||
|
|
||||||
|
// ADD SITE TO SITE LIST
|
||||||
|
|
||||||
|
"site_list.add.link_folder" = "Link a Folder";
|
||||||
|
"site_list.add.domain_name_placeholder" = "Enter a domain name here";
|
||||||
|
"site_list.add.secure_after_creation" = "Secure %@.%@ after creation";
|
||||||
|
"site_list.add.secure_description" = "Securing a site requires administrative privileges.\nYou will be prompted for your password or Touch ID.";
|
||||||
|
"site_list.add.create_link" = "Create Link";
|
||||||
|
"site_list.add.cancel" = "Cancel";
|
||||||
"site_list.add.folder_available" = "This site will be available via the following URL: %@://%@.%@";
|
"site_list.add.folder_available" = "This site will be available via the following URL: %@://%@.%@";
|
||||||
|
|
||||||
// SITE LIST ACTIONS
|
// SITE LIST ACTIONS
|
||||||
@ -153,8 +164,8 @@ problem manually, using your own Terminal app (this just shows you the output)."
|
|||||||
"alert.composer_success.info" = "Your global Composer dependencies have been successfully updated.";
|
"alert.composer_success.info" = "Your global Composer dependencies have been successfully updated.";
|
||||||
|
|
||||||
// Composer Version
|
// Composer Version
|
||||||
"alert.composer_php_requirement.title" = "`%@` has the following PHP requirement: \"php\": \"%@\".";
|
"alert.composer_php_requirement.title" = "`%@` has the following PHP requirement: \"php\":\n\"%@\".";
|
||||||
"alert.composer_php_requirement.info" = "This required PHP version was determined by checking the %@ in `composer.json` when the list was last refreshed.";
|
"alert.composer_php_requirement.info" = "This required PHP version was determined by checking the `%@` field in the `composer.json` file when the site list was last refreshed.";
|
||||||
|
|
||||||
// Force Reload Started
|
// Force Reload Started
|
||||||
"alert.force_reload.title" = "PHP Monitor will force reload the latest version of PHP";
|
"alert.force_reload.title" = "PHP Monitor will force reload the latest version of PHP";
|
||||||
|
Reference in New Issue
Block a user