Skip to content

Commit

Permalink
Merge pull request #1512 from planetary-social/content-flag-assets-an…
Browse files Browse the repository at this point in the history
…d-strings

Add content flag assets and strings
  • Loading branch information
pelumy authored Sep 18, 2024
2 parents 3bd4f82 + cd4e7b1 commit 5aa2613
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Nos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,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 @@ -647,6 +648,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 @@ -1829,6 +1831,8 @@
030742C32B4769F90073839D /* CoreData */,
03E7118B2C936DE5000B6F96 /* OpenGraph */,
C92E7F652C4EFF2600B80638 /* WebSockets */,
5BCA95D12C8A5F0D00A52D1A /* PreviewEventRepository.swift */,
04368D2A2C99A2C400DEAA2E /* FlagOption.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -2421,6 +2425,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
}
}
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
}
}
102 changes: 102 additions & 0 deletions Nos/Assets/Localization/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -4350,6 +4350,94 @@
}
}
},
"flagContentHarassmentDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Harmful and unwanted replies or mentions"
}
}
}
},
"flagContentHarassmentTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Harassment & Profanity"
}
}
}
},
"flagContentIllegalDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Content that violates the law in your country or CSAM"
}
}
}
},
"flagContentIllegalTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Illegal"
}
}
}
},
"flagContentNudityDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nudity, porn, or violent content not appropriate for work"
}
}
}
},
"flagContentOtherDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Items not included above"
}
}
}
},
"flagContentOtherTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Other"
}
}
}
},
"flagContentSpamTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Spam"
}
}
}
},
"flagUser" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -5420,6 +5508,9 @@
}
}
},
"Key" : {
"extractionState" : "manual"
},
"keys" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -11609,6 +11700,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`.

struct FlagOption: Identifiable {
let title: String
let description: String?
var id: String { title }

/// `FlagOption` instances representing different categories of content that can be flagged.
static let flagContentCategories: [FlagOption] = [
FlagOption(
title: String(localized: .localizable.flagContentSpamTitle),
description: nil
),
FlagOption(
title: String(localized: .localizable.flagContentHarassmentTitle),
description: String(localized: .localizable.flagContentHarassmentDescription)
),
FlagOption(
title: "NSFW",
description: String(localized: .localizable.flagContentNudityDescription)
),
FlagOption(
title: String(localized: .localizable.flagContentIllegalTitle),
description: String(localized: .localizable.flagContentIllegalDescription)
),
FlagOption(
title: String(localized: .localizable.flagContentOtherTitle),
description: String(localized: .localizable.flagContentOtherDescription)
)
]
}

0 comments on commit 5aa2613

Please sign in to comment.