Skip to content

Conversation

sylvestre
Copy link
Contributor

Improve the fallback + remove the default + add tests

@sylvestre sylvestre requested a review from Copilot May 24, 2025 18:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances locale support by improving fallback behavior, removing the default locale configuration, and adding tests to cover these changes.

  • Updated locale generation commands to include Spanish UTF-8 support.
  • Adjusted workflow configurations to improve locale fallback consistency.

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/arch. tests/misc/arch is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre marked this pull request as draft May 24, 2025 20:52
fn format(&self, id: &str, args: Option<&FluentArgs>, default: &str) -> String {
match self.bundle.get_message(id).and_then(|m| m.value()) {
Some(value) => {
fn format(&self, id: &str, args: Option<&FluentArgs>) -> String {
Copy link
Contributor

@cakebaker cakebaker May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more logical to return an Option<String> to distinguish between found/not found.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not found, i think we should just return the id instead of an empty string.
it isn't ideal but better than an empty string
no ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it wouldn't be an empty string but None.

@sylvestre sylvestre force-pushed the locale2 branch 2 times, most recently from 888542f to 8882cd8 Compare May 26, 2025 19:55
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/arch. tests/misc/arch is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/arch. tests/misc/arch is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/arch. tests/misc/arch is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/arch. tests/misc/arch is passing on 'main'. Maybe you have to rebase?

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/arch. tests/misc/arch is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

@sylvestre sylvestre marked this pull request as ready for review May 27, 2025 11:14
@sylvestre sylvestre requested a review from cakebaker May 27, 2025 11:15
* remove the default value. Avoid duplication of the english string + facilitate translation
* have english as a default. Load english when the translated string isn't available
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre requested a review from cakebaker May 29, 2025 07:01
@cakebaker cakebaker merged commit 869660b into uutils:main May 29, 2025
74 checks passed
@cakebaker
Copy link
Contributor

cakebaker commented May 29, 2025

Good job, now we have the first (partially) bilingual util :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants