Closed jesiegel1 closed 7 years ago
If the format language is set to English, KosherCocoa adjusts the custom index before doing the lookup. See: https://github.com/MosheBerman/KosherCocoa/blob/master/KosherCocoa/Library/Core/Calendar/Sefira/KCSefiraFormatter.m#L332-L340
_omerCountStringMap
is an internal method, so you shouldn't be calling it directly. Instead, use countStringFromInteger:
or countStringFromInteger:withPrayers:
.
Have you tested this?
Yea - I wasn't calling it directly, I was calling countStringFromInteger:withPrayers:
, but for some reason it wasn't working with English. Once I changed @[[_englishStrings]]
to @[_englishStrings]
, it worked.
As an aside btw, for some reason adding KosherCocoa to my podfile was installing the incomplete version. I had to specify your latest commit in order to install the library. (Also maybe I can work on it, but we should add an option to countStringFromInteger:
for setting attributes - I used a custom font and needed to go in and change the source code to do it.
The way I handle that is by querying the string to get substring ranges after the fact, so the API remains agnostic to the use case. The header words are all pretty unique so you can usually do something like:
This process could be abstracted a little better, perhaps, but that's how I do it. If you file a new issue, we could track it.
@jesiegel1 I just pushed 3.5.1 which should fix this.
https://github.com/MosheBerman/KosherCocoa/blob/master/KosherCocoa/Library/Core/Calendar/Sefira/KCSefiraFormatter.m#L531
The english and hebrew arrays for Sefira strings are of different dimensions, causing the index to be incorrect when querying the english strings and therefore
- (NSString *)countStringFromInteger:(NSInteger)integer
returns an incorrect value (or just nil).