i18n: further work, expr support#8292
Conversation
26a0eee to
644ea84
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
| let mut split = locale_var_str.split(&['.', '@']); | ||
|
|
||
| if let Some(simple) = split.next() { | ||
| let bcp47 = simple.replace("_", "-"); |
There was a problem hiding this comment.
maybe add a comment explaining what means bcp47 :)
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
8ad5eb5 to
4b5b0d1
Compare
src/uu/expr/src/expr.rs
Outdated
| #[error("Unsupported non-utf8 argument passed to match: {}", _0.quote())] | ||
| UnsupportedNonUtf8Match(String), |
There was a problem hiding this comment.
@sylvestre This is a uutils only error at the moment. I am not sure whether adding an error like this or calling expect() at the problematic code path would be better.
Also, because I consider this a bit like an internal error, I didn't bother adding a translation. I will do it if you deem it necessary.
There was a problem hiding this comment.
Hm, so this is a temporary error until we add support for non-utf8 arguments? In this case I would use expect().
There was a problem hiding this comment.
I hope it is only temporary, but this is a pretty big limitation of oniguruma, not sure if we can find a workaround for this
There was a problem hiding this comment.
Ok, so it's probably a permanent error and thus I would keep it as it is. I think it would be beneficial to include a translation, as it's a bit inconsistent to have all but one translated.
There was a problem hiding this comment.
I've added a translation 👍
| let mut opts = CollatorOptions::default(); | ||
| opts.alternate_handling = Some(AlternateHandling::Shifted); // This is black magic | ||
| let _ = try_init_collator(opts); |
There was a problem hiding this comment.
Here, I don't exactly understand how the CollatorOptions affect the collating. I've just toyed with it until #5378 passed. That's why I said it's black magic.
da3c388 to
9660754
Compare
|
GNU testsuite comparison: |
|
There is a conflict :| |
bfb5cc6 to
7987ade
Compare
2b7d214 to
c0538f0
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
- Add locale comparison test (issue uutils#5378) - Implement GNU expr-multibyte test
|
GNU testsuite comparison: |
|
Good work! |
Replaces #7986
Internationalization of
exprlength,substrandindex, which now supportmatchcan't be ported, as the regex engine we use (onig) doesn't handle non UTF-8 input (someday we will Replace Oniguruma #1145)expr-multibyte.plpass at 75%, match tests are still missing. Seeexpris failing with multibyte chars #3132Additions to
uucore::i18ndecimalmodule that allows one to access decimal and grouping separators etc...