Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings for native packages, OS and Runtime updates #1977

Merged
merged 3 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
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
58 changes: 30 additions & 28 deletions src/Views/AppInfoView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -181,36 +181,38 @@ namespace AppCenter.Views {
}
#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"
);

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"
);
if (!package.is_native && !package.is_os_updates && !package.is_runtime_updates) {
danirabbit marked this conversation as resolved.
Show resolved Hide resolved
var percent_translated = package_component.get_language (
// Expects language without locale
package_component.get_active_locale ().split ("_")[0]
);

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"
);
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);
oars_flowbox.add (locale);
}
}
}

Expand Down