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

18 lines
480 B
Swift
Raw Normal View History

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