Locale-sensitive operations using U16String and common locale enumeration#2787
Open
kugelbltz wants to merge 1 commit intonitlang:masterfrom
Open
Locale-sensitive operations using U16String and common locale enumeration#2787kugelbltz wants to merge 1 commit intonitlang:masterfrom
U16String and common locale enumeration#2787kugelbltz wants to merge 1 commit intonitlang:masterfrom
Conversation
Delja
reviewed
Aug 22, 2019
lib/core/locale.nit
Outdated
|
|
||
| redef class CString | ||
| # Returns a null `char *` | ||
| new nul `{ return NULL; `} |
Contributor
There was a problem hiding this comment.
If you define the same property in two places, it might be suitable to move it in a shared class.
Member
There was a problem hiding this comment.
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; `} |
Morriar
requested changes
Aug 26, 2019
Member
Morriar
left a comment
There was a problem hiding this comment.
Can we have tests and documentation please?
| `} | ||
|
|
||
| redef class Sys | ||
| fun default_locale: String do |
Member
There was a problem hiding this comment.
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; `} |
Member
There was a problem hiding this comment.
Also: is it the right place to define this?
Signed-off-by: Ana Daouda <anadaouda@gmail.com>
473b630 to
e3ccf28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR works with PR #2773. Operations are prefixed with
uni_Case modification
uni_to_upper,uni_to_loweranduni_to_titleoperations 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
Stringformatting using ICU's number and time formatter structuresLocale
default_locale)Sys(could be unnecessary)