[TIMOB-27891] Android: Add Intl.Collator support
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-07-19T14:16:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.1.0 |
Components | Android |
Labels | Collator, Intl, android, locale, localization, parity |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-05-08T18:41:55.000+0000 |
Updated | 2020-07-27T13:43:30.000+0000 |
Description
*Summary:*
On Android, we should add support for the JavaScript
Intl.Collator
class.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator
A collator is used to do localized string comparisons. This allows an app to correct sort text for the current locale/language.
This is already supported on iOS. We should add it to Android for parity.
*Note:*
To add official Intl
support to V8, we would have to #if
it in, but this involves adding the ICU (International Components for Unicode) C++ library which is about 20 MB per architecture. This is too big and is not mobile friendly. Especially since Google Play has a 100 MB limit on APKs. So, the most reasonable solution is to implement this ourselves in Java.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11698
manually rebase/merged to master, 9_1_X, 9_3_X
*Closing ticket*. Fix verified in SDK version
9.1.0.v20200724110711
,9.2.0.v20200724112452
and9.3.0.v20200724114100
. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11698 *Test Environment*