ios - NSLocalizedString for number -


i want translate 1 or 1 chinese or other languages. number can start 0 infinity. how shall translate/show (with nslocalizedstring or other) ?

as trojanfoe suggest stick numbers seems opinion.

if want translate numbers, can done follows :-

nsdecimalnumber *yournumber = [nsdecimalnumber decimalnumberwithstring:@"456"]; nsnumberformatter *formatter = [[nsnumberformatter alloc] init]; nslocale *yourlocale = [[nslocale alloc] initwithlocaleidentifier:@"zh"]; [formatter setlocale: yourlocale]; nslog(@"%@", [formatter stringfromnumber: yournumber]); // logs value in chinese [formatter setlocale:[nslocale currentlocale]]; nslog(@"%@", [formatter stringfromnumber: yournumber]); // logs value in current locale 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -