ClashX.Meta/ClashX/Basic/String+Localized.swift

18 lines
480 B
Swift

//
// String+Localized.swift
// ClashX
//
// Created by on 2018/10/8.
// Copyright © 2018 west2online. All rights reserved.
//
import Foundation
// to use english as showing language
// defaults write com.west2online.ClashX AppleLanguages '("en-US")'
extension String {
func localized(bundle: Bundle = .main, tableName: String = "Localizable") -> String {
return NSLocalizedString(self, tableName: tableName, value: "\(self)", comment: "")
}
}