Skip to content

Commit

Permalink
Release 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Decybel07 committed May 23, 2017
1 parent ed5fade commit 9526fc1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# Change Log

## [2.0.4](https://github.com/Decybel07/L10n-swift/tree/2.0.4) (2017-05-23)
* Support for display integer with leading zeros

## [2.0.3](https://github.com/Decybel07/L10n-swift/tree/2.0.3) (2017-05-20)
* Create example for mac

Expand Down
4 changes: 4 additions & 0 deletions Example/L10n Tests/L10n_EnglishLanguage_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class L10n_EnglishLanguage_Tests: XCTestCase {
XCTAssertEqual(1.l10n(), "1")
XCTAssertEqual(15.l10n(), "15")
XCTAssertEqual(7_215_633.l10n(), "7,215,633")

XCTAssertEqual(0.l10n(minIntegerDigits: 3), "000")
XCTAssertEqual(1.l10n(minIntegerDigits: 2), "01")
XCTAssertEqual(15.l10n(minIntegerDigits: 1), "15")
}

func testDouble() {
Expand Down
4 changes: 4 additions & 0 deletions Example/L10n Tests/L10n_PolishLanguage_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class L10n_PolishLanguage_Tests: XCTestCase {
XCTAssertEqual(1.l10n(), "1")
XCTAssertEqual(15.l10n(), "15")
XCTAssertEqual(7_215_633.l10n(), "7 215 633")

XCTAssertEqual(0.l10n(minIntegerDigits: 3), "000")
XCTAssertEqual(1.l10n(minIntegerDigits: 2), "01")
XCTAssertEqual(15.l10n(minIntegerDigits: 1), "15")
}

func testDouble() {
Expand Down
4 changes: 4 additions & 0 deletions Example/L10n Tests/L10n_UnsupportedLanguage_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class L10n_UnsupportedLanguage_Tests: XCTestCase {
XCTAssertEqual(1.l10n(), "1")
XCTAssertEqual(15.l10n(), "15")
XCTAssertEqual(7_215_633.l10n(), "7215633")

XCTAssertEqual(0.l10n(minIntegerDigits: 3), "000")
XCTAssertEqual(1.l10n(minIntegerDigits: 2), "01")
XCTAssertEqual(15.l10n(minIntegerDigits: 1), "15")
}

func testDouble() {
Expand Down
2 changes: 1 addition & 1 deletion L10n-swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|
s.name = 'L10n-swift'
s.module_name = 'L10n'
s.version = '2.0.3'
s.version = '2.0.4'
s.summary = 'Localization of an application with ability to change language "on the fly" and support for plural forms in any language.'

s.description = <<-DESC
Expand Down
9 changes: 9 additions & 0 deletions Source/Extensions/Int+l10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@ extension Int {
public func l10n() -> String {
return L10n.shared.string(format: "%d", self)
}

/**
Returns a localized self description value with leading zeros.

- returns: A localized self description value with leading zeros.
*/
public func l10n(minIntegerDigits: Int) -> String {
return L10n.shared.string(format: "%0\(minIntegerDigits)d", self)
}
}

0 comments on commit 9526fc1

Please sign in to comment.