mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
*sum: Fix locales fetching from checksum_common after installation
This commit is contained in:
+6
-2
@@ -266,9 +266,13 @@ locales:
|
||||
fi; \
|
||||
done
|
||||
|
||||
|
||||
# Some utils require extra locale files outside of their package:
|
||||
# - *sum binaries need the files from checksum_common
|
||||
INSTALLEES_WITH_EXTRA_LOCALE = \
|
||||
$(INSTALLEES) \
|
||||
$(if $(findstring sum, $(INSTALLEES)),checksum_common, )
|
||||
install-locales:
|
||||
@for prog in $(INSTALLEES); do \
|
||||
@for prog in $(INSTALLEES_WITH_EXTRA_LOCALE); do \
|
||||
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 \
|
||||
|
||||
@@ -144,6 +144,15 @@ fn embed_single_utility_locale(
|
||||
.join(format!("locales/{locale}.ftl"))
|
||||
})?;
|
||||
|
||||
if util_name.ends_with("sum") {
|
||||
embed_component_locales(
|
||||
embedded_file,
|
||||
locales_to_embed,
|
||||
"checksum_common",
|
||||
|locale| project_root.join(format!("src/uu/checksum_common/locales/{locale}.ftl")),
|
||||
)?;
|
||||
}
|
||||
|
||||
// Always embed uucore locale file if it exists
|
||||
embed_component_locales(embedded_file, locales_to_embed, "uucore", |locale| {
|
||||
project_root.join(format!("src/uucore/locales/{locale}.ftl"))
|
||||
|
||||
@@ -261,6 +261,14 @@ fn create_english_bundle_from_embedded(
|
||||
bundle.add_resource_overriding(uucore_resource);
|
||||
}
|
||||
|
||||
// Checksum algorithms need locale messages from checksum_common
|
||||
if util_name.ends_with("sum") {
|
||||
if let Some(uucore_content) = get_embedded_locale("checksum_common/en-US.ftl") {
|
||||
let uucore_resource = parse_fluent_resource(uucore_content)?;
|
||||
bundle.add_resource_overriding(uucore_resource);
|
||||
}
|
||||
}
|
||||
|
||||
// Then, try to load utility-specific strings
|
||||
let locale_key = format!("{util_name}/en-US.ftl");
|
||||
if let Some(ftl_content) = get_embedded_locale(&locale_key) {
|
||||
|
||||
Reference in New Issue
Block a user