Skip to content

Commit af75096

Browse files
authored
Merge pull request #8080 from sylvestre/l10n-uname
l10n: port uname to translation + add french
2 parents 6619a93 + 86357de commit af75096

3 files changed

Lines changed: 51 additions & 16 deletions

File tree

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
uname-about = Print certain system information.
22
With no OPTION, same as -s.
33
uname-usage = uname [OPTION]...
4+
5+
# Error messages
6+
uname-error-cannot-get-system-name = cannot get system name
7+
8+
# Default values
9+
uname-unknown = unknown
10+
11+
# Help text for command-line arguments
12+
uname-help-all = Behave as though all of the options -mnrsvo were specified.
13+
uname-help-kernel-name = print the kernel name.
14+
uname-help-nodename = print the nodename (the nodename may be a name that the system is known by to a communications network).
15+
uname-help-kernel-release = print the operating system release.
16+
uname-help-kernel-version = print the operating system version.
17+
uname-help-machine = print the machine hardware name.
18+
uname-help-os = print the operating system name.
19+
uname-help-processor = print the processor type (non-portable)
20+
uname-help-hardware-platform = print the hardware platform (non-portable)

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
uname-about = Affiche certaines informations système.
2+
Sans OPTION, identique à -s.
3+
uname-usage = uname [OPTION]...
4+
5+
# Messages d'erreur
6+
uname-error-cannot-get-system-name = impossible d'obtenir le nom du système
7+
8+
# Valeurs par défaut
9+
uname-unknown = inconnu
10+
11+
# Texte d'aide pour les arguments de ligne de commande
12+
uname-help-all = Se comporte comme si toutes les options -mnrsvo étaient spécifiées.
13+
uname-help-kernel-name = affiche le nom du noyau.
14+
uname-help-nodename = affiche le nom du nœud (le nom du nœud peut être un nom par lequel le système est connu d'un réseau de communications).
15+
uname-help-kernel-release = affiche la version du système d'exploitation.
16+
uname-help-kernel-version = affiche la version du système d'exploitation.
17+
uname-help-machine = affiche le nom du matériel de la machine.
18+
uname-help-os = affiche le nom du système d'exploitation.
19+
uname-help-processor = affiche le type de processeur (non portable)
20+
uname-help-hardware-platform = affiche la plateforme matérielle (non portable)

src/uu/uname/src/uname.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ impl UNameOutput {
5959
}
6060

6161
pub fn new(opts: &Options) -> UResult<Self> {
62-
let uname =
63-
PlatformInfo::new().map_err(|_e| USimpleError::new(1, "cannot get system name"))?;
62+
let uname = PlatformInfo::new().map_err(|_e| {
63+
USimpleError::new(1, get_message("uname-error-cannot-get-system-name"))
64+
})?;
6465
let none = !(opts.all
6566
|| opts.kernel_name
6667
|| opts.nodename
@@ -90,11 +91,11 @@ impl UNameOutput {
9091

9192
// This option is unsupported on modern Linux systems
9293
// See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
93-
let processor = opts.processor.then(|| "unknown".to_string());
94+
let processor = opts.processor.then(|| get_message("uname-unknown"));
9495

9596
// This option is unsupported on modern Linux systems
9697
// See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
97-
let hardware_platform = opts.hardware_platform.then(|| "unknown".to_string());
98+
let hardware_platform = opts.hardware_platform.then(|| get_message("uname-unknown"));
9899

99100
Ok(Self {
100101
kernel_name,
@@ -151,69 +152,66 @@ pub fn uu_app() -> Command {
151152
Arg::new(options::ALL)
152153
.short('a')
153154
.long(options::ALL)
154-
.help("Behave as though all of the options -mnrsvo were specified.")
155+
.help(get_message("uname-help-all"))
155156
.action(ArgAction::SetTrue),
156157
)
157158
.arg(
158159
Arg::new(options::KERNEL_NAME)
159160
.short('s')
160161
.long(options::KERNEL_NAME)
161162
.alias("sysname") // Obsolescent option in GNU uname
162-
.help("print the kernel name.")
163+
.help(get_message("uname-help-kernel-name"))
163164
.action(ArgAction::SetTrue),
164165
)
165166
.arg(
166167
Arg::new(options::NODENAME)
167168
.short('n')
168169
.long(options::NODENAME)
169-
.help(
170-
"print the nodename (the nodename may be a name that the system \
171-
is known by to a communications network).",
172-
)
170+
.help(get_message("uname-help-nodename"))
173171
.action(ArgAction::SetTrue),
174172
)
175173
.arg(
176174
Arg::new(options::KERNEL_RELEASE)
177175
.short('r')
178176
.long(options::KERNEL_RELEASE)
179177
.alias("release") // Obsolescent option in GNU uname
180-
.help("print the operating system release.")
178+
.help(get_message("uname-help-kernel-release"))
181179
.action(ArgAction::SetTrue),
182180
)
183181
.arg(
184182
Arg::new(options::KERNEL_VERSION)
185183
.short('v')
186184
.long(options::KERNEL_VERSION)
187-
.help("print the operating system version.")
185+
.help(get_message("uname-help-kernel-version"))
188186
.action(ArgAction::SetTrue),
189187
)
190188
.arg(
191189
Arg::new(options::MACHINE)
192190
.short('m')
193191
.long(options::MACHINE)
194-
.help("print the machine hardware name.")
192+
.help(get_message("uname-help-machine"))
195193
.action(ArgAction::SetTrue),
196194
)
197195
.arg(
198196
Arg::new(options::OS)
199197
.short('o')
200198
.long(options::OS)
201-
.help("print the operating system name.")
199+
.help(get_message("uname-help-os"))
202200
.action(ArgAction::SetTrue),
203201
)
204202
.arg(
205203
Arg::new(options::PROCESSOR)
206204
.short('p')
207205
.long(options::PROCESSOR)
208-
.help("print the processor type (non-portable)")
206+
.help(get_message("uname-help-processor"))
209207
.action(ArgAction::SetTrue)
210208
.hide(true),
211209
)
212210
.arg(
213211
Arg::new(options::HARDWARE_PLATFORM)
214212
.short('i')
215213
.long(options::HARDWARE_PLATFORM)
216-
.help("print the hardware platform (non-portable)")
214+
.help(get_message("uname-help-hardware-platform"))
217215
.action(ArgAction::SetTrue)
218216
.hide(true),
219217
)

0 commit comments

Comments
 (0)