Skip to content

Commit

Permalink
Fix warnings for native packages, OS and Runtime updates (#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
meisenzahl authored Jan 28, 2023
1 parent 9a60ef9 commit 37a734a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/Core/Package.vala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public enum RuntimeStatus {

public class AppCenterCore.Package : Object {
public const string APPCENTER_PACKAGE_ORIGIN = "appcenter";
private const string ELEMENTARY_STABLE_PACKAGE_ORIGIN = "elementary-stable-focal-main";
private const string ELEMENTARY_STABLE_PACKAGE_ORIGIN = "elementary-stable-jammy-main";

public RuntimeStatus runtime_status { get; set; default = RuntimeStatus.UP_TO_DATE; }

Expand Down
78 changes: 41 additions & 37 deletions src/Views/AppInfoView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -169,48 +169,52 @@ namespace AppCenter.Views {
};
content_warning_clamp.add (oars_flowbox_revealer);

if (!package.is_os_updates && !package.is_runtime_updates) {
#if CURATED
if (!package.is_native && !package.is_os_updates && !package.is_runtime_updates) {
var uncurated = new ContentType (
_("Non-Curated"),
_("Not reviewed by elementary for security, privacy, or system integration"),
"security-low-symbolic"
);

oars_flowbox.add (uncurated);
}
#endif

var percent_translated = package_component.get_language (
// Expects language without locale
package_component.get_active_locale ().split ("_")[0]
);

if (percent_translated < 100) {
if (percent_translated == -1) {
var locale = new ContentType (
_("May Not Be Translated"),
_("This app does not provide language information"),
"metainfo-locale"
if (!package.is_native) {
var uncurated = new ContentType (
_("Non-Curated"),
_("Not reviewed by elementary for security, privacy, or system integration"),
"security-low-symbolic"
);

oars_flowbox.add (locale);
} else if (percent_translated == 0) {
var locale = new ContentType (
_("Not Translated"),
_("This app is not available in your language"),
"metainfo-locale"
);

oars_flowbox.add (locale);
} else {
var locale = new ContentType (
_("Not Fully Translated"),
_("This app is %i%% translated in your language").printf (percent_translated),
"metainfo-locale"
oars_flowbox.add (uncurated);
}
#endif
var active_locale = package_component.get_active_locale ();
if (active_locale != "en_US") {
var percent_translated = package_component.get_language (
// Expects language without locale
active_locale.split ("_")[0]
);

oars_flowbox.add (locale);
if (percent_translated < 100) {
if (percent_translated == -1) {
var locale = new ContentType (
_("May Not Be Translated"),
_("This app does not provide language information"),
"metainfo-locale"
);

oars_flowbox.add (locale);
} else if (percent_translated == 0) {
var locale = new ContentType (
_("Not Translated"),
_("This app is not available in your language"),
"metainfo-locale"
);

oars_flowbox.add (locale);
} else {
var locale = new ContentType (
_("Not Fully Translated"),
_("This app is %i%% translated in your language").printf (percent_translated),
"metainfo-locale"
);

oars_flowbox.add (locale);
}
}
}
}

Expand Down

0 comments on commit 37a734a

Please sign in to comment.