ios - Localizing apps for non-standard locales -


i writing app should support language not in list of available (40?) languages on device, region format is. want localize name of days "yesterday...". problem is, days (monday,...) fetched using nslocale , therefore work on device, words "yesterday" have localised language amongst 40 or so. though xcode lets me localize wanted region, device uses standard language, in case danish.

the result (like in call app) "yesterday" shows in english (since can't localize specific region, kamba-kenya), day names translated fine. there way around except hard-coding?

i doubt have hard-code of these data ios supported locales. take effort able avoid hard-coding locales @ all.

ios heavily utilizes locale-sensitive data cldr , locale supported, don't have localize these strings since translations these relative date names (which category in cldr terminology covering words such "today", "yesterday", , "tomorrow") planned part of locale data. example showing data german compared english:

<fields>    ...    <field type='day'>     <displayname>day</displayname>     <relative type='-1'>yesterday</relative>     <relative type='0'>today</relative>     <relative type='1'>tomorrow</relative>    </field>    ...   </fields>   <fields>    ...    <field type='day'>     <displayname>tag</displayname>     <relative type='-2'>vorgestern</relative>     <relative type='-1'>gestern</relative>     <relative type='0'>heute</relative>     <relative type='1'>morgen</relative>     <relative type='2'>Übermorgen</relative>    </field>    ...   </fields> 

also, found out nsdateformatter has 2 attributes called setdoesrelativedateformatting , doesrelativedateformatting give need supported locales. i'm not ios developer can't certainty.

although data ka-ke available in cldr, since locale not yet supported ios, have go through hoops make work; e.g. build icu ios covered in detail in this answer or using static build available here.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -