|
| 1 | +// SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | + |
| 3 | +/** |
| 4 | + * Detail information screens navigated to from the About tab. |
| 5 | + */ |
| 6 | + |
| 7 | +import SwiftUI |
| 8 | + |
| 9 | +enum AboutInfoSection { |
| 10 | + case wikimedia |
| 11 | + case privacyPolicy |
| 12 | + case licenses |
| 13 | +} |
| 14 | + |
| 15 | +struct AboutInfoView: View { |
| 16 | + let section: AboutInfoSection |
| 17 | + |
| 18 | + private var title: String { |
| 19 | + switch section { |
| 20 | + case .wikimedia: |
| 21 | + return NSLocalizedString( |
| 22 | + "i18n.app.about.community.wikimedia", value: "Wikimedia and Scribe", comment: "") |
| 23 | + case .privacyPolicy: |
| 24 | + return NSLocalizedString( |
| 25 | + "i18n._global.privacy_policy", value: "Privacy policy", comment: "") |
| 26 | + case .licenses: |
| 27 | + return NSLocalizedString( |
| 28 | + "i18n.app.about.legal.third_party", value: "Third-party licenses", comment: "") |
| 29 | + } |
| 30 | + } |
| 31 | + |
| 32 | + private var caption: String { |
| 33 | + switch section { |
| 34 | + case .wikimedia: |
| 35 | + return NSLocalizedString( |
| 36 | + "i18n.app.about.community.wikimedia.caption", value: "How we work together", |
| 37 | + comment: "") |
| 38 | + case .privacyPolicy: |
| 39 | + return NSLocalizedString( |
| 40 | + "i18n.app.about.legal.privacy_policy.caption", value: "Keeping you safe", |
| 41 | + comment: "") |
| 42 | + case .licenses: |
| 43 | + return NSLocalizedString( |
| 44 | + "i18n.app.about.legal.third_party.caption", value: "Whose code we used", |
| 45 | + comment: "") |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + private var bodyText: String { |
| 50 | + switch section { |
| 51 | + case .wikimedia: return wikimediaBodyText |
| 52 | + case .privacyPolicy: return privacyPolicyBodyText |
| 53 | + case .licenses: return thirdPartyLicensesBodyText |
| 54 | + } |
| 55 | + } |
| 56 | + |
| 57 | + var body: some View { |
| 58 | + ScrollView { |
| 59 | + VStack(alignment: .leading, spacing: 0) { |
| 60 | + VStack(alignment: .leading, spacing: 16) { |
| 61 | + Text(caption) |
| 62 | + .font(.title2) |
| 63 | + .fontWeight(.bold) |
| 64 | + .foregroundColor(.primary) |
| 65 | + |
| 66 | + Text(bodyText) |
| 67 | + .font(.body) |
| 68 | + .foregroundColor(.primary) |
| 69 | + .tint(Color("linkBlue")) |
| 70 | + } |
| 71 | + .padding(20) |
| 72 | + .background(Color("lightWhiteDarkBlack")) |
| 73 | + .cornerRadius(12) |
| 74 | + .padding(.horizontal, 20) |
| 75 | + .padding(.top, 16) |
| 76 | + } |
| 77 | + .padding(.bottom, 32) |
| 78 | + } |
| 79 | + .background(Color("scribeAppBackground").ignoresSafeArea()) |
| 80 | + .navigationTitle(title) |
| 81 | + .navigationBarTitleDisplayMode(.large) |
| 82 | + } |
| 83 | +} |
| 84 | + |
| 85 | +// MARK: - Body text |
| 86 | + |
| 87 | +private let wikimediaBodyText: String = { |
| 88 | + let t1 = NSLocalizedString( |
| 89 | + "i18n.app.about.community.wikimedia.text_1", |
| 90 | + value: "Scribe would not be possible without countless contributions by Wikimedia contributors to the many projects that they support. Specifically Scribe makes use of data from the Wikidata Lexicographical data community, as well as data from Wikipedia for each language that Scribe supports.", |
| 91 | + comment: "") |
| 92 | + let t2 = NSLocalizedString( |
| 93 | + "i18n.app.about.community.wikimedia.text_2", |
| 94 | + value: "Wikidata is a collaboratively edited multilingual knowledge graph hosted by the Wikimedia Foundation. It provides freely available data that anyone can use under a Creative Commons Public Domain license (CC0). Scribe uses language data from Wikidata to provide users with verb conjugations, noun-form annotations, noun plurals, and many other features.", |
| 95 | + comment: "") |
| 96 | + let t3 = NSLocalizedString( |
| 97 | + "i18n.app.about.community.wikimedia.text_3", |
| 98 | + value: "Wikipedia is a multilingual free online encyclopedia written and maintained by a community of volunteers through open collaboration and a wiki-based editing system. Scribe uses data from Wikipedia to produce autosuggestions by deriving the most common words in a language as well as the most common words that follow them.", |
| 99 | + comment: "") |
| 100 | + return [t1, t2, t3].joined(separator: "\n\n") |
| 101 | +}() |
| 102 | + |
| 103 | +private let privacyPolicyBodyText: String = NSLocalizedString( |
| 104 | + "i18n.app.about.legal.privacy_policy.text", |
| 105 | + value: """ |
| 106 | + Please note that the English version of this policy takes precedence over all other versions. |
| 107 | +
|
| 108 | + The Scribe developers (SCRIBE) built the iOS application "Scribe - Language Keyboards" (SERVICE) as an open-source application. This SERVICE is provided by SCRIBE at no cost and is intended for use as is. |
| 109 | +
|
| 110 | + This privacy policy (POLICY) is used to inform the reader of the policies for the access, tracking, collection, retention, use, and disclosure of personal information (USER INFORMATION) and usage data (USER DATA) for all individuals who make use of this SERVICE (USERS). |
| 111 | +
|
| 112 | + USER INFORMATION is specifically defined as any information related to the USERS themselves or the devices they use to access the SERVICE. |
| 113 | +
|
| 114 | + USER DATA is specifically defined as any text that is typed or actions that are done by the USERS while using the SERVICE. |
| 115 | +
|
| 116 | + 1. Policy Statement |
| 117 | +
|
| 118 | + This SERVICE does not access, track, collect, retain, use, or disclose any USER INFORMATION or USER DATA. |
| 119 | +
|
| 120 | + 2. Do Not Track |
| 121 | +
|
| 122 | + USERS contacting SCRIBE to ask that their USER INFORMATION and USER DATA not be tracked will be provided with a copy of this POLICY as well as a link to all source codes as proof that they are not being tracked. |
| 123 | +
|
| 124 | + 3. Third-Party Data |
| 125 | +
|
| 126 | + This SERVICE makes use of third-party data. All data used in the creation of this SERVICE comes from sources that allow its full use in the manner done so by the SERVICE. Specifically, the data for this SERVICE comes from Wikidata, Wikipedia and Unicode. Wikidata states that, "All structured data in the main, property and lexeme namespaces is made available under the Creative Commons CC0 License; text in other namespaces is made available under the Creative Commons Attribution-Share Alike License." The policy detailing Wikidata data usage can be found at https://www.wikidata.org/wiki/Wikidata:Licensing. Wikipedia states that text data, the type of data used by the SERVICE, "… can be used under the terms of the Creative Commons Attribution Share-Alike license". The policy detailing Wikipedia data usage can be found at https://en.wikipedia.org/wiki/Wikipedia:Reusing_Wikipedia_content. Unicode provides permission, "… free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction…" The policy detailing Unicode data usage can be found at https://www.unicode.org/license.txt. |
| 127 | +
|
| 128 | + 4. Third-Party Source Code |
| 129 | +
|
| 130 | + This SERVICE was based on third-party code. All source code used in the creation of this SERVICE comes from sources that allow its full use in the manner done so by the SERVICE. Specifically, the basis of this project was the project Custom Keyboard by Ethan Sarif-Kattan. Custom Keyboard was released under an MIT license, with this license being available at https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE. |
| 131 | +
|
| 132 | + 5. Third-Party Services |
| 133 | +
|
| 134 | + This SERVICE makes use of third-party services to manipulate some of the third-party data. Specifically, data has been translated using models from Hugging Face transformers. This service is covered by an Apache License 2.0, which states that it is available for commercial use, modification, distribution, patent use, and private use. The license for the aforementioned service can be found at https://github.com/huggingface/transformers/blob/master/LICENSE. |
| 135 | +
|
| 136 | + 6. Third-Party Links |
| 137 | +
|
| 138 | + This SERVICE contains links to external websites. If USERS click on a third-party link, they will be directed to a website. Note that these external websites are not operated by this SERVICE. Therefore, USERS are strongly advised to review the privacy policy of these websites. This SERVICE has no control over and assumes no responsibility for the content, privacy policies, or practices of any third-party sites or services. |
| 139 | +
|
| 140 | + 7. Third-Party Images |
| 141 | +
|
| 142 | + This SERVICE contains images that are copyrighted by third-parties. Specifically, this app includes a copy of the logos of GitHub, Inc and Wikidata, trademarked by Wikimedia Foundation, Inc. The terms by which the GitHub logo can be used are found on https://github.com/logos, and the terms for the Wikidata logo are found on the following Wikimedia page: https://foundation.wikimedia.org/wiki/Policy:Trademark_policy. This SERVICE uses the copyrighted images in a way that matches these criteria, with the only deviation being a rotation of the GitHub logo that is common in the open-source community to indicate that there is a link to the GitHub website. |
| 143 | +
|
| 144 | + 8. Content Notice |
| 145 | +
|
| 146 | + This SERVICE allows USERS to access linguistic content (CONTENT). Some of this CONTENT could be deemed inappropriate for children and legal minors. Accessing CONTENT using the SERVICE is done in a way that the information is unavailable unless explicitly known. Specifically, USERS "can" translate words, conjugate verbs, and access other grammatical features of CONTENT that may be sexual, violent, or otherwise inappropriate in nature. USERS "cannot" translate words, conjugate verbs, and access other grammatical features of CONTENT that may be sexual, violent, or otherwise inappropriate in nature if they do not already know about the nature of this CONTENT. SCRIBE takes no responsibility for the access of such CONTENT. |
| 147 | +
|
| 148 | + 9. Changes |
| 149 | +
|
| 150 | + This POLICY is subject to change. Updates to this POLICY will replace all prior instances, and if deemed material will further be clearly stated in the next applicable update to the SERVICE. SCRIBE encourages USERS to periodically review this POLICY for the latest information on our privacy practices and to familiarize themselves with any changes. |
| 151 | +
|
| 152 | + 10. Contact |
| 153 | +
|
| 154 | + If you have any questions, concerns, or suggestions about this POLICY, do not hesitate to visit https://github.com/scribe-org or contact SCRIBE at scribe.langauge@gmail.com. The person responsible for such inquiries is Andrew Tavis McAllister. |
| 155 | +
|
| 156 | + 11. Effective Date |
| 157 | +
|
| 158 | + This POLICY is effective as of the 24th of May, 2022. |
| 159 | + """, |
| 160 | + comment: "" |
| 161 | +) |
| 162 | + |
| 163 | +private let thirdPartyLicensesBodyText: String = { |
| 164 | + let intro = NSLocalizedString( |
| 165 | + "i18n.app.about.legal.third_party.text", |
| 166 | + value: "The Scribe developers (SCRIBE) built the iOS application \"Scribe - Language Keyboards\" (SERVICE) using third party code. All source code used in the creation of this SERVICE comes from sources that allow its full use in the manner done so by the SERVICE. This section lists the source code on which the SERVICE was based as well as the coinciding licenses of each.\n\nThe following is a list of all used source code, the main author or authors of the code, the license under which it was released at time of usage, and a link to the license.", |
| 167 | + comment: "") |
| 168 | + let entry1 = NSLocalizedString( |
| 169 | + "i18n.app.about.legal.third_party.entry_custom_keyboard", |
| 170 | + value: "Custom Keyboard\n• Author: EthanSK\n• License: MIT\n• Link: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE", |
| 171 | + comment: "") |
| 172 | + let entry2 = NSLocalizedString( |
| 173 | + "i18n.app.about.legal.third_party.entry_simple_keyboard", |
| 174 | + value: "Simple Keyboard\n• Author: Simple Mobile Tools\n• License: GPL-3.0\n• Link: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE", |
| 175 | + comment: "") |
| 176 | + return "\(intro)\n\n1. \(entry1)\n\n2. \(entry2)" |
| 177 | +}() |
0 commit comments