onesky / plugin-ios-ota

Over the air plugin
50 stars 8 forks source link

Add "value" parameter not just "key" #16

Closed Tibbs closed 8 years ago

Tibbs commented 8 years ago

The current methods only have key as a parameter and value cannot be set. It means that changing the default language key invalidates all other languages as well

For example, if I have a button and I want to set the title, I cannot update the base language title because it changes the key. If I have this code NSBundle *thisBundle = [NSBundle bundleForClass:[self class]]; UIButton *actionButton = [thisBundle localizedStringForKey:@"actionButton" value:@"Save to Documents" table:@"Buttons"];;

If I want to change the value from "Save to Documents" to @"Save to documents" (documents is not capitalized) I can do it with localizedStringForKey without invalidating all localizations. They will still work with the old localizations.

If I change a single charter in OSLocalizedStringFromTable(@"Save to Documents", @"Buttons", @"Action Button Title") to OSLocalizedStringFromTable(@"Save to documents", @"Buttons", @"Action Button Title") all other languages stop working.

Please add a new method something like OSLocalizedStringFromTableWithValue(key,value, tbl, comment)

bretdabaker commented 8 years ago

Fixed in 0.9.11

OSLocalizedStringWithDefaultValue(key, tbl, val, comment)