https://github.com/mark2b/l10n
https://github.com/mark2b/l10n
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mark2b/l10n
- Owner: mark2b
- License: mit
- Created: 2017-01-20T23:47:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-10T19:34:41.000Z (over 4 years ago)
- Last Synced: 2025-02-06T08:02:23.551Z (over 1 year ago)
- Language: Swift
- Size: 27.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# l10n
[](https://travis-ci.org/Mark Berner/l10n)
[](http://cocoapods.org/pods/l10n)
[](http://cocoapods.org/pods/l10n)
[](http://cocoapods.org/pods/l10n)
**l10n** String extension provides convenient way for strings localization
```swift
"Hello, World !!!".l10n() // Looks for "Hello, World !!!" key in the Localized.strings
"Hello, World !!!".l10n(l.vc1) // Looks for "Hello, World !!!" key in the
// ViewController1.strings (mapped via l10NResources)
"Hello, %@ !!!".l10n(args:"Me") // Looks for "Hello, %@ !!!" key in the Localized.strings
// and replace '%@' by argument
"Hello, %@ !!!".l10n(l.vc1, args:"Me")
extension l10nResources {
public static let vc1 = "ViewController1"
public static let vc2 = "ViewController2"
}
typealias l = l10NResources
```
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
l10n is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "l10n"
```
## Author
Mark Berner, mark2b@gmail.com
## License
l10n is available under the MIT license. See the LICENSE file for more info.