summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-04-13 21:22:36 +0200
committerJulian Andres Klode <jak@debian.org>2024-04-13 21:22:36 +0200
commitcf71004551eca23f6d73648bc19f65e8b2a08ce9 (patch)
treef582926b4e7b36df5f2b7190a4b1b46342fe2b61
parent979a018c2fd3fa253c7edc05f35f202f631c2d05 (diff)
Hide nice subtree character and indentation of summary from translations
Also allow us to have utf-8 characters in xgettext, but msgcomm still fails so ugh. This avoids translations messing up the formatting a bit more, at least, and makes apt build again
-rw-r--r--CMake/Translations.cmake1
-rw-r--r--apt-private/private-install.cc8
-rw-r--r--apt-private/private-output.cc14
3 files changed, 15 insertions, 8 deletions
diff --git a/CMake/Translations.cmake b/CMake/Translations.cmake
index 24925105c..a7fe6c95b 100644
--- a/CMake/Translations.cmake
+++ b/CMake/Translations.cmake
@@ -16,6 +16,7 @@ function(apt_add_translation_domain)
set(domain ${NLS_DOMAIN})
set(xgettext_params
--add-comments
+ --from-code=utf-8
--foreign
--package-name=${PROJECT_NAME}
--package-version=${PACKAGE_VERSION}
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index a7fa54f31..13c90c6fc 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -345,16 +345,18 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo
struct statvfs st;
if (statvfs("/usr", &st) == 0)
{
+ ioprintf(c1out, " ");
// TRANSLATOR: The required space between number and unit is already included
// in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
- ioprintf(c1out, _(" Space needed: %sB / approx. %sB available\n"),
- SizeToStr(Cache->UsrSize()).c_str(), SizeToStr((st.f_bsize * st.f_bavail)).c_str());
+ ioprintf(c1out, _("Space needed: %sB / approx. %sB available\n"),
+ SizeToStr(Cache->UsrSize() + InitrdSize).c_str(), SizeToStr((st.f_bsize * st.f_bavail)).c_str());
}
else
{
// TRANSLATOR: The required space between number and unit is already included
// in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
- ioprintf(c1out, _(" Space needed: %sB\n"), SizeToStr(Cache->UsrSize()).c_str());
+ ioprintf(c1out, " ");
+ ioprintf(c1out, _("Space needed: %sB\n"), SizeToStr(Cache->UsrSize()).c_str());
}
}
}
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index bbf50397f..30db3d5e7 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -758,9 +758,11 @@ void Stats(ostream &out, pkgDepCache &Dep, APT::PackageVector const &HeldBackPac
if (Dep[I].Delete() == false && (Dep[I].iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall)
ReInstall++;
}
- if (outVer >= 30)
- ioprintf(out, _("Summary:\n"));
- ioprintf(out,outVer < 30 ? _("%lu upgraded, %lu newly installed, ") : _(" Upgrading: %lu, Installing: %lu, "),
+ if (outVer >= 30) {
+ ioprintf(out, _("Summary:"));
+ ioprintf(out, "\n ");
+ }
+ ioprintf(out,outVer < 30 ? _("%lu upgraded, %lu newly installed, ") : _("Upgrading: %lu, Installing: %lu, "),
Upgrade,Install);
if (ReInstall != 0)
@@ -771,10 +773,12 @@ void Stats(ostream &out, pkgDepCache &Dep, APT::PackageVector const &HeldBackPac
ioprintf(out, outVer < 30 ? _("%lu to remove and %lu not upgraded.\n") : _("Removing: %lu, Not Upgrading: %lu\n"),
Dep.DelCount(), HeldBackPackages.size());
- // FIXME: outVer
- if (Dep.BadCount() != 0)
+ if (Dep.BadCount() != 0) {
+ if (outVer >= 30)
+ ioprintf(out, " ");
ioprintf(out,_("%lu not fully installed or removed.\n"),
Dep.BadCount());
+ }
}
/*}}}*/
// YnPrompt - Yes No Prompt. /*{{{*/