Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/GnuTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ jobs:
sudo locale-gen
sudo locale-gen --keep-existing fr_FR
sudo locale-gen --keep-existing fr_FR.UTF-8
sudo locale-gen --keep-existing es_ES.UTF-8
sudo locale-gen --keep-existing sv_SE
sudo locale-gen --keep-existing sv_SE.UTF-8
sudo locale-gen --keep-existing en_US
Expand Down
3 changes: 2 additions & 1 deletion .vscode/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"tests/**/fixtures/**",
"src/uu/dd/test-resources/**",
"vendor/**",
"**/*.svg"
"**/*.svg",
"src/uu/*/locales/*.ftl"
],

"enableGlobDot": true,
Expand Down
30 changes: 28 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PROFILE ?= debug
MULTICALL ?= n
COMPLETIONS ?= y
MANPAGES ?= y
LOCALES ?= y
INSTALL ?= install
ifneq (,$(filter install, $(MAKECMDGOALS)))
override PROFILE:=release
Expand Down Expand Up @@ -300,7 +301,7 @@ else
endif
endif

build-coreutils:
build-coreutils: locales
${CARGO} build ${CARGOFLAGS} --features "${EXES} $(BUILD_SPEC_FEATURE)" ${PROFILE_CMD} --no-default-features

build: build-coreutils build-pkgs
Expand Down Expand Up @@ -396,7 +397,32 @@ else
install-completions:
endif

install: build install-manpages install-completions
ifeq ($(LOCALES),y)
locales:
$(foreach prog, $(INSTALLEES), \
if [ -d "$(BASEDIR)/src/uu/$(prog)/locales" ]; then \
mkdir -p "$(BUILDDIR)/locales/$(prog)"; \
for locale_file in "$(BASEDIR)"/src/uu/$(prog)/locales/*.ftl; do \
$(INSTALL) -v "$$locale_file" "$(BUILDDIR)/locales/$(prog)/"; \
done; \
fi $(newline) \
)


install-locales:
$(foreach prog, $(INSTALLEES), \
if [ -d "$(BASEDIR)/src/uu/$(prog)/locales" ]; then \
mkdir -p "$(DESTDIR)$(DATAROOTDIR)/locales/$(prog)"; \
for locale_file in "$(BASEDIR)"/src/uu/$(prog)/locales/*.ftl; do \
$(INSTALL) -v "$$locale_file" "$(DESTDIR)$(DATAROOTDIR)/locales/$(prog)/"; \
done; \
fi $(newline) \
)
else
install-locales:
endif

install: build install-manpages install-completions install-locales
mkdir -p $(INSTALLDIR_BIN)
ifeq (${MULTICALL}, y)
$(INSTALL) $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
Expand Down
11 changes: 0 additions & 11 deletions src/uu/arch/arch.md

This file was deleted.

5 changes: 5 additions & 0 deletions src/uu/arch/locales/en-US.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Error message when system architecture information cannot be retrieved
cannot-get-system = cannot get system name

arch-about = Display machine architecture
arch-after-help = Determine architecture name for current machine.
5 changes: 5 additions & 0 deletions src/uu/arch/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Error message when system architecture information cannot be retrieved
cannot-get-system = impossible d'obtenir le nom du système

arch-about = Afficher l'architecture de la machine
arch-after-help = Déterminer le nom de l'architecture pour la machine actuelle.
13 changes: 6 additions & 7 deletions src/uu/arch/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ use platform_info::*;

use clap::Command;
use uucore::error::{UResult, USimpleError};
use uucore::{help_about, help_section};

static ABOUT: &str = help_about!("arch.md");
static SUMMARY: &str = help_section!("after help", "arch.md");
use uucore::locale::{self, get_message};

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
locale::setup_localization(uucore::util_name())?;
uu_app().try_get_matches_from(args)?;

let uts = PlatformInfo::new().map_err(|_e| USimpleError::new(1, "cannot get system name"))?;
let uts =
PlatformInfo::new().map_err(|_e| USimpleError::new(1, get_message("cannot-get-system")))?;

println!("{}", uts.machine().to_string_lossy().trim());
Ok(())
Expand All @@ -25,7 +24,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(uucore::crate_version!())
.about(ABOUT)
.after_help(SUMMARY)
.about(get_message("arch-about"))
.after_help(get_message("arch-after-help"))
.infer_long_args(true)
}
Loading
Loading