vlc | branch: master | Felix Paul Kühne <[email protected]> | Sun Jul 26 15:29:56 2015 +0200| [342acefac1f6122ccbd28e1b4392ade632d8e80e] | committer: Felix Paul Kühne
macosx: fix runtime exception when loading the simple prefs with the Punjabi locale active (closes #15106) > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=342acefac1f6122ccbd28e1b4392ade632d8e80e --- modules/gui/macosx/simple_prefs.m | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m index 8543e7a..4bb36bb 100644 --- a/modules/gui/macosx/simple_prefs.m +++ b/modules/gui/macosx/simple_prefs.m @@ -704,15 +704,30 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam [self setupButton:_input_mkv_preload_dirCheckbox forBoolValue: "mkv-preload-local-dir"]; + /* do not trust translators to do the correct thing, + * so re-build the menu in an unorthodox way (#15106) */ [_input_cachelevelPopup removeAllItems]; - [_input_cachelevelPopup addItemsWithTitles: [NSArray arrayWithObjects:_NS("Custom"), _NS("Lowest latency"), - _NS("Low latency"), _NS("Normal"), _NS("High latency"), _NS("Higher latency"), nil]]; - [[_input_cachelevelPopup itemAtIndex: 0] setTag: 0]; - [[_input_cachelevelPopup itemAtIndex: 1] setTag: 100]; - [[_input_cachelevelPopup itemAtIndex: 2] setTag: 200]; - [[_input_cachelevelPopup itemAtIndex: 3] setTag: 300]; - [[_input_cachelevelPopup itemAtIndex: 4] setTag: 500]; - [[_input_cachelevelPopup itemAtIndex: 5] setTag: 1000]; + NSArray *plainTitles = @[@"Custom", @"Lowest latency", @"Low latency", @"Normal", @"High latency", @"Higher latency"]; + NSMenuItem *workerItem; + [_input_cachelevelPopup addItemsWithTitles: plainTitles]; + workerItem = [_input_cachelevelPopup itemAtIndex: 0]; + [workerItem setTag: 0]; + [workerItem setTitle:_NS("Custom")]; + workerItem = [_input_cachelevelPopup itemAtIndex: 1]; + [workerItem setTag: 100]; + [workerItem setTitle:_NS("Lowest Latency")]; + workerItem = [_input_cachelevelPopup itemAtIndex: 2]; + [workerItem setTag: 200]; + [workerItem setTitle:_NS("Low Latency")]; + workerItem = [_input_cachelevelPopup itemAtIndex: 3]; + [workerItem setTag: 300]; + [workerItem setTitle:_NS("Normal")]; + workerItem = [_input_cachelevelPopup itemAtIndex: 4]; + [workerItem setTag: 500]; + [workerItem setTitle:_NS("Higher Latency")]; + workerItem = [_input_cachelevelPopup itemAtIndex: 5]; + [workerItem setTag: 1000]; + [workerItem setTitle:_NS("Highest Latency")]; #define TestCaC(name, factor) \ cache_equal = cache_equal && \ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
