Skip to content

Commit d06d00c

Browse files
authored
Merge branch 'main' into traversal2
2 parents b393dc8 + 59b9529 commit d06d00c

File tree

34 files changed

+982
-342
lines changed

34 files changed

+982
-342
lines changed

.github/workflows/l10n.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,43 +91,38 @@ jobs:
9191
- name: Find and validate Fluent files
9292
shell: bash
9393
run: |
94-
## Find and validate Fluent files with Mozilla Fluent Linter
9594
96-
# Check if any .ftl files exist
97-
fluent_files=$(find . -name "*.ftl" -type f 2>/dev/null || true)
95+
fluent_dirs=$(find . -name "*.ftl" -type f -exec dirname {} \; | sort | uniq 2>/dev/null || true)
9896
99-
if [ -n "$fluent_files" ]; then
100-
echo "Found Fluent files:"
101-
echo "$fluent_files"
97+
if [ -n "$fluent_dirs" ]; then
98+
echo "Found Fluent directories:"
99+
echo "$fluent_dirs"
100+
101+
# Count total files for informational purposes
102+
total_files=$(find . -name "*.ftl" -type f | wc -l)
103+
echo "Total Fluent files: $total_files"
102104
else
103105
echo "::notice::No Fluent (.ftl) files found in the repository"
104106
exit 0
105107
fi
106108
107-
# Use Mozilla Fluent Linter for comprehensive validation
108-
echo "Running Mozilla Fluent Linter..."
109+
echo "Running Fluent Linter on directories..."
109110
110111
has_errors=false
111112
112-
while IFS= read -r file; do
113-
echo "Checking $file with Mozilla Fluent Linter..."
113+
while IFS= read -r dir; do
114+
echo "Checking directory $dir with Fluent Linter..."
114115
115-
# Run fluent-linter on each file
116-
if ! moz-fluent-lint "$file"; then
117-
echo "::error file=$file::Fluent syntax errors found in $file"
118-
has_errors=true
116+
if ! moz-fluent-lint --config .github/fluent_linter_config.yml "$dir"; then
117+
echo "::error::Fluent syntax errors found in $dir"
118+
exit 1
119119
else
120-
echo "✓ Fluent syntax check passed for $file"
120+
echo "✓ Fluent syntax check passed for directory $dir"
121121
fi
122122
123-
done <<< "$fluent_files"
124-
125-
if [ "$has_errors" = true ]; then
126-
echo "::error::Fluent linting failed - please fix syntax errors"
127-
exit 1
128-
fi
123+
done <<< "$fluent_dirs"
129124
130-
echo "::notice::All Fluent files passed Mozilla Fluent Linter validation"
125+
echo "::notice::All Fluent directories passed Fluent Linter validation"
131126
132127
l10n_clap_error_localization:
133128
name: L10n/Clap Error Localization Test

.vscode/cspell.dictionaries/workspace.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,5 @@ uutils
347347
getcwd
348348

349349
# * other
350+
weblate
350351
algs

Cargo.lock

Lines changed: 21 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
[![CodeCov](https://codecov.io/gh/uutils/coreutils/branch/master/graph/badge.svg)](https://codecov.io/gh/uutils/coreutils)
1717
![MSRV](https://img.shields.io/badge/MSRV-1.85.0-brightgreen)
18+
[![Weblate](https://hosted.weblate.org/widget/rust-coreutils/svg-badge.svg)](https://hosted.weblate.org/projects/rust-coreutils/)
1819

1920
</div>
2021

@@ -41,9 +42,16 @@ cargo install coreutils
4142

4243
## Goals
4344

44-
uutils aims to be a drop-in replacement for the GNU utils. Differences with GNU
45+
uutils coreutils aims to be a drop-in replacement for the GNU utils. Differences with GNU
4546
are treated as bugs.
4647

48+
Our key objectives include:
49+
- Matching GNU's output (stdout and error code) exactly
50+
- Better error messages
51+
- Providing comprehensive internationalization support (UTF-8)
52+
- Improved performances
53+
- [Extensions](docs/src/extensions.md) when relevant (example: --progress)
54+
4755
uutils aims to work on as many platforms as possible, to be able to use the same
4856
utils on Linux, macOS, Windows and other platforms. This ensures, for example,
4957
that scripts can be easily transferred between platforms.
@@ -59,6 +67,7 @@ uutils has both user and developer documentation available:
5967
Both can also be generated locally, the instructions for that can be found in
6068
the [coreutils docs](https://github.com/uutils/uutils.github.io) repository.
6169

70+
Use [weblate/rust-coreutils](https://hosted.weblate.org/projects/rust-coreutils/) to translate the Rust coreutils into your language.
6271

6372
<!-- ANCHOR: build (this mark is needed for mdbook) -->
6473

docs/src/l10n.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This guide explains how localization (L10n) is implemented in the **Rust-based c
1010

1111
- **Main repository**: Contains English (`en-US.ftl`) locale files embedded in binaries
1212
- **Translation repository**: [uutils/coreutils-l10n](https://github.com/uutils/coreutils-l10n) contains all other language translations
13+
- **Online Translation**: [weblate/rust-coreutils](https://hosted.weblate.org/projects/rust-coreutils/) to translate the strings.
14+
1315

1416
---
1517

@@ -30,6 +32,9 @@ Examples:
3032

3133
These files follow Fluent syntax and contain localized message patterns.
3234

35+
The French translation is the only locale with English to be part of the tree. The goal is to be able to run tests with
36+
a different locale to verify that they work.
37+
3338
---
3439

3540
## ⚙️ Initialization

src/uu/cat/locales/en-US.ftl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
cat-about = Concatenate FILE(s), or standard input, to standard output
22
With no FILE, or when FILE is -, read standard input.
33
cat-usage = cat [OPTION]... [FILE]...
4+
5+
# Help messages
6+
cat-help-show-all = equivalent to -vET
7+
cat-help-number-nonblank = number nonempty output lines, overrides -n
8+
cat-help-show-nonprinting-ends = equivalent to -vE
9+
cat-help-show-ends = display $ at end of each line
10+
cat-help-number = number all output lines
11+
cat-help-squeeze-blank = suppress repeated empty output lines
12+
cat-help-show-nonprinting-tabs = equivalent to -vT
13+
cat-help-show-tabs = display TAB characters at ^I
14+
cat-help-show-nonprinting = use ^ and M- notation, except for LF (\n) and TAB (\t)
15+
cat-help-ignored-u = (ignored)
16+
17+
# Error messages
18+
cat-error-unknown-filetype = unknown filetype: { $ft_debug }
19+
cat-error-is-directory = Is a directory
20+
cat-error-input-file-is-output-file = input file is output file
21+
cat-error-too-many-symbolic-links = Too many levels of symbolic links

src/uu/cat/locales/fr-FR.ftl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cat-about = Concaténer les FICHIER(s), ou l'entrée standard, vers la sortie standard
2+
Si aucun FICHIER, ou quand FICHIER est -, lire l'entrée standard.
3+
cat-usage = cat [OPTION]... [FICHIER]...
4+
5+
# Messages d'aide
6+
cat-help-show-all = équivalent à -vET
7+
cat-help-number-nonblank = numéroter les lignes de sortie non vides, remplace -n
8+
cat-help-show-nonprinting-ends = équivalent à -vE
9+
cat-help-show-ends = afficher $ à la fin de chaque ligne
10+
cat-help-number = numéroter toutes les lignes de sortie
11+
cat-help-squeeze-blank = supprimer les lignes vides répétées en sortie
12+
cat-help-show-nonprinting-tabs = équivalent à -vT
13+
cat-help-show-tabs = afficher les caractères TAB comme ^I
14+
cat-help-show-nonprinting = utiliser la notation ^ et M-, sauf pour LF (\n) et TAB (\t)
15+
cat-help-ignored-u = (ignoré)
16+
17+
# Messages d'erreur
18+
cat-error-unknown-filetype = type de fichier inconnu : { $ft_debug }
19+
cat-error-is-directory = Est un répertoire
20+
cat-error-input-file-is-output-file = le fichier d'entrée est le fichier de sortie
21+
cat-error-too-many-symbolic-links = Trop de niveaux de liens symboliques

0 commit comments

Comments
 (0)