Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

[MNY-24]: Language localized formatted string #26

Merged
merged 24 commits into from
Nov 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bb6577c
[MNY-25]: Renames _CurrencyType to ISOCurrencyType
danthorpe Nov 22, 2015
e8e1535
[MNY-25]: Adds formattedForLanguageId extension
danthorpe Nov 22, 2015
76c3f15
[MNY-24]: Adds Locale type
danthorpe Nov 22, 2015
6213d08
[MNY-24]: Removes unneeded constant
danthorpe Nov 22, 2015
ee27da0
[MNY-24]: Fixes test for current locale
danthorpe Nov 22, 2015
551c90f
[MNY-24]: Fixes some locale/formatter issues
danthorpe Nov 22, 2015
4e95d58
[MNY-24]: Adds start of autogenerated unit tests.
danthorpe Nov 23, 2015
28fd425
[MNY-24]: Few tweaks to generator
danthorpe Nov 23, 2015
6c9b291
[MNY-24]: Adds tests for autogenerated test Locale enum
danthorpe Nov 23, 2015
8757cdb
[MNY-24]: More work refactoring formatting methods into Currency type
danthorpe Nov 23, 2015
24ba86b
[MNY-24]: Resets formatter state
danthorpe Nov 23, 2015
930c44d
[MNY-24]: Updates the custom currencies
danthorpe Nov 23, 2015
d2a3d86
[MNY-24]: Updates Custom Money pods
danthorpe Nov 23, 2015
c86426b
[MNY-24]: Updates Money Tests
danthorpe Nov 23, 2015
e7e1131
[MNY-25]: More fixes for tests
danthorpe Nov 23, 2015
eef42b1
[MNY-24]: Updates tests
danthorpe Nov 23, 2015
279911b
[MNY-24]: Updating fastlane
danthorpe Nov 23, 2015
159a5d7
[MNY-24]: Re-generates the local unit tests slightly different.
danthorpe Nov 23, 2015
e5bca1e
[MNY-24]: Updates README
danthorpe Nov 23, 2015
c29e8ca
[MNY-24]: Fixes spelling mistakes in the README
danthorpe Nov 23, 2015
f2e42f4
[MNY-24]: Updates README for custom currency protocol
danthorpe Nov 23, 2015
7ee3180
[MNY-24]: Sorts out horizontal lines
danthorpe Nov 23, 2015
62462f3
[MNY-24]: Removes an internal link which was broken.
danthorpe Nov 23, 2015
9faba9f
[MNY-24]: More README tweaks.
danthorpe Nov 23, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Examples/Custom Money/Custom Money/Currencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,40 @@
import Foundation
import Money

protocol MyCustomCurrencyType: CurrencyType { }
protocol MyCustomCurrencyType: CustomCurrencyType { }

extension Currency {

final class Heart: MyCustomCurrencyType {

static let code: String = "HEARTS"
static let symbol: String = "❤️"
static let scale: Int = 0
static let formatter: NSNumberFormatter = {
let fmtr = NSNumberFormatter()
fmtr.numberStyle = .CurrencyStyle
fmtr.maximumFractionDigits = Currency.Heart.scale
fmtr.currencySymbol = Currency.Heart.symbol
fmtr.currencySymbol = "❤️"
fmtr.internationalCurrencySymbol = Currency.Heart.code
let locale = NSLocale.currentLocale()
fmtr.currencyGroupingSeparator = locale.currencyGroupingSeparator
fmtr.currencyDecimalSeparator = locale.currencyDecimalSeparator
return fmtr
}()
}

final class Bee: MyCustomCurrencyType {

static let code: String = "BEES"
static let symbol: String = "🐝"
static let scale: Int = 0
static let formatter: NSNumberFormatter = {
let fmtr = NSNumberFormatter()
fmtr.numberStyle = .CurrencyStyle
fmtr.maximumFractionDigits = Currency.Bee.scale
fmtr.currencySymbol = Currency.Bee.symbol
fmtr.currencySymbol = "🐝"
fmtr.internationalCurrencySymbol = Currency.Bee.code
let locale = NSLocale.currentLocale()
fmtr.currencyGroupingSeparator = locale.currencyGroupingSeparator
fmtr.currencyDecimalSeparator = locale.currencyDecimalSeparator
return fmtr
}()
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/Custom Money/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Money (1.2.1):
- Money (1.3.0):
- Result (= 0.6.0-beta.6)
- SwiftyJSON
- ValueCoding
Expand All @@ -15,7 +15,7 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
Money: 7bf4b32f795e1eb867c2fcebaaf90b3249824438
Money: 80739aa547740640fd960128baa40a28a22cc91b
Result: dc390d0b58f9ec43fcd536f1ebdd130803cc6cbc
SwiftyJSON: 592b53bee5ef3dd9b3bebc6b9cb7ee35426ae8c3
ValueCoding: 54486fde2d7b1c2f1eb46de260b95340abed5bde
Expand Down
4 changes: 2 additions & 2 deletions Examples/Custom Money/Pods/Local Podspecs/Money.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Examples/Custom Money/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

605 changes: 299 additions & 306 deletions Examples/Custom Money/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions Examples/Custom Money/Pods/Target Support Files/Money/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions Examples/Custom Money/Pods/Target Support Files/Result/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GEM
faraday (>= 0.7.4, < 0.10)
fastimage (1.6.8)
addressable (~> 2.3, >= 2.3.5)
fastlane (1.41.0)
fastlane (1.41.1)
addressable (~> 2.3.8)
cert (>= 1.2.3, < 2.0.0)
credentials_manager (>= 0.10.0, < 1.0.0)
Expand Down
Loading