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

Add content flag assets and strings #1512

Merged
merged 8 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 4 additions & 0 deletions Nos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
03FE3F7D2C87AC9900D25810 /* Event+InlineMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03FE3F7B2C87AC9900D25810 /* Event+InlineMetadata.swift */; };
03FE3F8C2C87BC9500D25810 /* text_note_multiple_media.json in Resources */ = {isa = PBXBuildFile; fileRef = 03FE3F8A2C87BC9500D25810 /* text_note_multiple_media.json */; };
042406F32C907A15008F2A21 /* NosToggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042406F22C907A15008F2A21 /* NosToggle.swift */; };
04368D2B2C99A2C400DEAA2E /* FlagOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04368D2A2C99A2C400DEAA2E /* FlagOption.swift */; };
2D06BB9D2AE249D70085F509 /* ThreadRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D06BB9C2AE249D70085F509 /* ThreadRootView.swift */; };
2D4010A22AD87DF300F93AD4 /* KnownFollowersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D4010A12AD87DF300F93AD4 /* KnownFollowersView.swift */; };
3A1C296F2B2A537C0020B753 /* Moderation.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 3A1C296E2B2A537C0020B753 /* Moderation.xcstrings */; };
Expand Down Expand Up @@ -621,6 +622,7 @@
03FE3F7B2C87AC9900D25810 /* Event+InlineMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Event+InlineMetadata.swift"; sourceTree = "<group>"; };
03FE3F8A2C87BC9500D25810 /* text_note_multiple_media.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = text_note_multiple_media.json; sourceTree = "<group>"; };
042406F22C907A15008F2A21 /* NosToggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NosToggle.swift; sourceTree = "<group>"; };
04368D2A2C99A2C400DEAA2E /* FlagOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlagOption.swift; sourceTree = "<group>"; };
2D06BB9C2AE249D70085F509 /* ThreadRootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThreadRootView.swift; sourceTree = "<group>"; };
2D4010A12AD87DF300F93AD4 /* KnownFollowersView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KnownFollowersView.swift; sourceTree = "<group>"; };
3A1C296E2B2A537C0020B753 /* Moderation.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Moderation.xcstrings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1754,6 +1756,7 @@
030742C32B4769F90073839D /* CoreData */,
C92E7F652C4EFF2600B80638 /* WebSockets */,
5BCA95D12C8A5F0D00A52D1A /* PreviewEventRepository.swift */,
04368D2A2C99A2C400DEAA2E /* FlagOption.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -2337,6 +2340,7 @@
C9B5C78E2C24AF650070445B /* MockRelaySubscriptionManager.swift in Sources */,
C960C57129F3236200929990 /* LikeButton.swift in Sources */,
C97797B9298AA19A0046BD25 /* RelayService.swift in Sources */,
04368D2B2C99A2C400DEAA2E /* FlagOption.swift in Sources */,
C99721CB2AEBED26004EBEAB /* String+Empty.swift in Sources */,
C9C097252C13537900F78EC3 /* DatabaseCleaner.swift in Sources */,
C959DB762BD01DF4008F3627 /* GiftWrapper.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x29",
"green" : "0x12",
"red" : "0x1B"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x25",
"green" : "0x10",
"red" : "0x18"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x0C",
"green" : "0x04",
"red" : "0x07"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x7D",
"green" : "0x39",
"red" : "0x45"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest renaming this radio-button-selected-bottom (and the other radio-button-selected-top).

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x75",
"green" : "0x3F",
"red" : "0xF4"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x08",
"green" : "0x85",
"red" : "0xF0"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
91 changes: 91 additions & 0 deletions Nos/Assets/Localization/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -5054,6 +5054,28 @@
}
}
},
"harassmentFlagContentDescription" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd switch the words around a bit, so all of them are sorted together in the file. So this one would be:

Suggested change
"harassmentFlagContentDescription" : {
"flagContentHarassmentDescription" : {

And then all the others would be similar, starting with flagContent and then the type and then Title or Description at the end.

"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Harmful and unwanted replies or mentions"
}
}
}
},
"harassmentFlagContentTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Harassment & Profanity"
}
}
}
},
"homeFeed" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -5266,6 +5288,28 @@
}
}
},
"illegalFlagContentDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Content that violates the law in your country or CSAM"
}
}
}
},
"illegalFlagContentTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Illegal"
}
}
}
},
"invalidKey" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -5420,6 +5464,9 @@
}
}
},
"Key" : {
"extractionState" : "manual"
},
"keys" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -8292,6 +8339,17 @@
}
}
},
"nudityFlagContentDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nudity, porn, or violent content not appropriate for work"
}
}
}
},
"ok" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -8517,6 +8575,28 @@
}
}
},
"otherFlagContentDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Items not included above"
}
}
}
},
"others" : {
pelumy marked this conversation as resolved.
Show resolved Hide resolved
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Others"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"value" : "Others"
"value" : "Other"

}
}
}
},
"outsideNetwork" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -11609,6 +11689,17 @@
}
}
},
"spam" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Spam"
}
}
}
},
"start" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
36 changes: 36 additions & 0 deletions Nos/Models/FlagOption.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Foundation

/// A model representing a flagging option used in content moderation.
/// - `title`: The title of the flagging option.
/// - `description`: An optional description that provides more detail about the flagging option.
/// - `id`: A unique identifier for the flagging option, based on the `title`.

pelumy marked this conversation as resolved.
Show resolved Hide resolved
struct FlagOption: Identifiable {
let title: String
let description: String?
var id: String { title }

// `FlagOption` instances representing different categories of content that can be flagged.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// `FlagOption` instances representing different categories of content that can be flagged.
/// `FlagOption` instances representing different categories of content that can be flagged.

If you make this a triple-slash (HeaderDoc comment) it will show up in the documentation pane (right hand pane of Xcode) or when this variable is option-clicked!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching these @mplorentz

static let flagContentCategories: [FlagOption] = [
FlagOption(
title: String(localized: .localizable.spam),
description: nil
),
FlagOption(
title: String(localized: .localizable.harassmentFlagContentTitle),
description: String(localized: .localizable.harassmentFlagContentDescription)
),
FlagOption(
title: "NSFW",
description: String(localized: .localizable.nudityFlagContentDescription)
),
FlagOption(
title: String(localized: .localizable.illegalFlagContentTitle),
description: String(localized: .localizable.illegalFlagContentDescription)
),
FlagOption(
title: String(localized: .localizable.others),
description: String(localized: .localizable.otherFlagContentDescription)
)
]
}
Loading