Skip to content

Commit a298ecc

Browse files
committed
Fix loc display and strings
1 parent b4f6d90 commit a298ecc

3 files changed

Lines changed: 38 additions & 7 deletions

File tree

src/AppInstallerCLICore/Resources.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ namespace AppInstaller::CLI::Resource
310310
WINGET_DEFINE_RESOURCE_STRINGID(FontFaces);
311311
WINGET_DEFINE_RESOURCE_STRINGID(FontFamily);
312312
WINGET_DEFINE_RESOURCE_STRINGID(FontFamilyNameArgumentDescription);
313-
WINGET_DEFINE_RESOURCE_STRINGID(FontFilesArgumentDescription);
314313
WINGET_DEFINE_RESOURCE_STRINGID(FontFileNotSupported);
314+
WINGET_DEFINE_RESOURCE_STRINGID(FontFilesArgumentDescription);
315315
WINGET_DEFINE_RESOURCE_STRINGID(FontFilePaths);
316316
WINGET_DEFINE_RESOURCE_STRINGID(FontInstallCommandLongDescription);
317317
WINGET_DEFINE_RESOURCE_STRINGID(FontInstallCommandShortDescription);
@@ -320,6 +320,10 @@ namespace AppInstaller::CLI::Resource
320320
WINGET_DEFINE_RESOURCE_STRINGID(FontListCommandShortDescription);
321321
WINGET_DEFINE_RESOURCE_STRINGID(FontPackage);
322322
WINGET_DEFINE_RESOURCE_STRINGID(FontRollbackFailed);
323+
WINGET_DEFINE_RESOURCE_STRINGID(FontStatus);
324+
WINGET_DEFINE_RESOURCE_STRINGID(FontStatusCorrupt);
325+
WINGET_DEFINE_RESOURCE_STRINGID(FontStatusOK);
326+
WINGET_DEFINE_RESOURCE_STRINGID(FontStatusUnknown);
323327
WINGET_DEFINE_RESOURCE_STRINGID(FontTitle);
324328
WINGET_DEFINE_RESOURCE_STRINGID(FontUninstallCommandLongDescription);
325329
WINGET_DEFINE_RESOURCE_STRINGID(FontUninstallCommandShortDescription);

src/AppInstallerCLICore/Workflows/FontFlow.cpp

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ namespace AppInstaller::CLI::Workflow
3838

3939
struct InstalledFontFilesTableLine
4040
{
41-
InstalledFontFilesTableLine(Utility::LocIndString title, Utility::LocIndString packageName, Utility::LocIndString winGetInstalled, std::filesystem::path filePath)
42-
: Title(title), PackageName(packageName), WinGetInstalled(winGetInstalled), FilePath(filePath) {
41+
InstalledFontFilesTableLine(Utility::LocIndString title, Utility::LocIndString packageName, Resource::LocString fontStatus, std::filesystem::path filePath)
42+
: Title(title), PackageName(packageName), FontStatus(fontStatus), FilePath(filePath) {
4343
}
4444

4545
Utility::LocIndString Title;
4646
Utility::LocIndString PackageName;
47-
Utility::LocIndString WinGetInstalled;
47+
Resource::LocString FontStatus;
4848
std::filesystem::path FilePath;
4949
};
5050

@@ -81,7 +81,7 @@ namespace AppInstaller::CLI::Workflow
8181

8282
void OutputInstalledFontFilesTable(Execution::Context& context, const std::vector<InstalledFontFilesTableLine>& lines)
8383
{
84-
Execution::TableOutput<4> table(context.Reporter, { Resource::String::FontTitle, Resource::String::FontPackage, Resource::String::FontWinGetSupported, Resource::String::FontFilePaths });
84+
Execution::TableOutput<4> table(context.Reporter, { Resource::String::FontTitle, Resource::String::FontPackage, Resource::String::FontStatus, Resource::String::FontFilePaths });
8585

8686
bool anonymizePath = Settings::User().Get<Settings::Setting::AnonymizePathForDisplay>();
8787

@@ -92,7 +92,7 @@ namespace AppInstaller::CLI::Workflow
9292
AppInstaller::Runtime::ReplaceProfilePathsWithEnvironmentVariable(line.FilePath);
9393
}
9494

95-
table.OutputLine({ line.Title, line.PackageName, line.WinGetInstalled, line.FilePath.u8string() });
95+
table.OutputLine({ line.Title, line.PackageName, line.FontStatus, line.FilePath.u8string() });
9696
}
9797

9898
table.Complete();
@@ -144,11 +144,24 @@ namespace AppInstaller::CLI::Workflow
144144
std::vector<InstalledFontFilesTableLine> lines;
145145
for (const auto& fontFile : fontFiles)
146146
{
147+
Resource::LocString status;
148+
switch (fontFile.Status)
149+
{
150+
case FontStatus::OK:
151+
status = Resource::LocString(Resource::String::FontStatusOK);
152+
break;
153+
case FontStatus::Corrupt:
154+
status = Resource::LocString(Resource::String::FontStatusCorrupt);
155+
break;
156+
default:
157+
status = Resource::LocString(Resource::String::FontStatusUnknown);
158+
break;
159+
}
147160

148161
InstalledFontFilesTableLine line(
149162
Utility::LocIndString(Utility::ConvertToUTF8(fontFile.Title)),
150163
Utility::LocIndString(Utility::ConvertToUTF8(fontFile.PackageIdentifier.value_or(L" "))),
151-
Utility::LocIndString(Utility::ConvertToUTF8(fontFile.Status == Fonts::FontStatus::OK ? L"OK" : L"Missing")),
164+
status,
152165
fontFile.FilePath.u8string());
153166

154167
lines.push_back(std::move(line));

src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3430,4 +3430,18 @@ Please specify one of them using the --source option to proceed.</value>
34303430
<data name="FontUninstallCommandShortDescription" xml:space="preserve">
34313431
<value>Uninstall a font package</value>
34323432
</data>
3433+
<data name="FontStatusOK" xml:space="preserve">
3434+
<value>OK</value>
3435+
<comment>"OK" means the font is in a good healthy state</comment>
3436+
</data>
3437+
<data name="FontStatusCorrupt" xml:space="preserve">
3438+
<value>Corrupt</value>
3439+
<comment>"Corrupt" refers to an install that is in a corrupted or bad state, and needs repair.</comment>
3440+
</data>
3441+
<data name="FontStatus" xml:space="preserve">
3442+
<value>Status</value>
3443+
</data>
3444+
<data name="FontStatusUnknown" xml:space="preserve">
3445+
<value>Unknown</value>
3446+
</data>
34333447
</root>

0 commit comments

Comments
 (0)