-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locale-sensitive operations using U16String
and common locale enumeration
#2787
base: master
Are you sure you want to change the base?
Conversation
lib/core/locale.nit
Outdated
|
||
redef class CString | ||
# Returns a null `char *` | ||
new nul `{ return NULL; `} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you define the same property in two places, it might be suitable to move it in a shared class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: is it the right place to define this?
lib/core/text/u16_string.nit
Outdated
|
||
redef class CString | ||
# Returns a null `char *` | ||
new nul `{ return NULL; `} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have tests and documentation please?
`} | ||
|
||
redef class Sys | ||
fun default_locale: String do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be in an object itself added to Sys
as to not clutter it more than it already is?
class Locales
fun chinese_locale: String do return "zh"
fun english_locale: String do return "en"
# ...
end
redef class Sys
fun locales do return new Locales
end
@privat WDYT?
lib/core/locale.nit
Outdated
|
||
redef class CString | ||
# Returns a null `char *` | ||
new nul `{ return NULL; `} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: is it the right place to define this?
Signed-off-by: Ana Daouda <[email protected]>
473b630
to
e3ccf28
Compare
This PR works with PR #2773. Operations are prefixed with
uni_
Case modification
uni_to_upper
,uni_to_lower
anduni_to_title
operations using ICU operations.String sorting
uni_compare_to
: unicode and locale aware string comparison using ICU's collator structureArray[String]
sorter (StrSorter
)Formatting
Locale aware time/number to
String
formatting using ICU's number and time formatter structuresLocale
default_locale
)Sys
(could be unnecessary)