Create GitHub section in About

Leave README and CHANGELOG untranslated.
This commit is contained in:
Davide De Rosa 2019-04-27 09:21:49 +02:00
parent bd14b9e617
commit ffb273ce23
6 changed files with 25 additions and 18 deletions

View File

@ -33,14 +33,15 @@ class AboutViewController: UITableViewController, TableModelHost {
let model: TableModel<SectionType, RowType> = { let model: TableModel<SectionType, RowType> = {
let model: TableModel<SectionType, RowType> = TableModel() let model: TableModel<SectionType, RowType> = TableModel()
model.add(.info) model.add(.info)
model.add(.moreInfo) model.add(.github)
model.add(.web) model.add(.web)
model.add(.share) model.add(.share)
model.setHeader("", for: .info) model.setHeader("", for: .info)
model.setHeader("GitHub", for: .github)
model.setHeader(L10n.About.Sections.Web.header, for: .web) model.setHeader(L10n.About.Sections.Web.header, for: .web)
model.setHeader(L10n.About.Sections.Share.header, for: .share) model.setHeader(L10n.About.Sections.Share.header, for: .share)
model.set([.version], in: .info) model.set([.version, .credits], in: .info)
model.set([.seeChangelog, .seeCredits], in: .moreInfo) model.set([.readme, .changelog], in: .github)
model.set([.website, .faq, .disclaimer, .privacyPolicy], in: .web) model.set([.website, .faq, .disclaimer, .privacyPolicy], in: .web)
model.set([.shareTwitter, .shareGeneric], in: .share) model.set([.shareTwitter, .shareGeneric], in: .share)
return model return model
@ -95,7 +96,7 @@ extension AboutViewController {
enum SectionType: Int { enum SectionType: Int {
case info case info
case moreInfo case github
case web case web
@ -105,9 +106,11 @@ extension AboutViewController {
enum RowType: Int { enum RowType: Int {
case version case version
case seeChangelog case credits
case seeCredits case readme
case changelog
case website case website
@ -153,12 +156,15 @@ extension AboutViewController {
cell.leftText = L10n.Version.title cell.leftText = L10n.Version.title
cell.rightText = Utils.versionString() cell.rightText = Utils.versionString()
case .seeChangelog: case .credits:
cell.leftText = L10n.About.Cells.Changelog.caption
case .seeCredits:
cell.leftText = L10n.About.Cells.Credits.caption cell.leftText = L10n.About.Cells.Credits.caption
case .readme:
cell.leftText = "README"
case .changelog:
cell.leftText = "CHANGELOG"
case .website: case .website:
cell.leftText = L10n.About.Cells.Website.caption cell.leftText = L10n.About.Cells.Website.caption
@ -185,12 +191,15 @@ extension AboutViewController {
case .version: case .version:
showVersion() showVersion()
case .seeChangelog: case .credits:
visit(AppConstants.URLs.changelog)
case .seeCredits:
openCredits() openCredits()
case .readme:
visit(AppConstants.URLs.readme)
case .changelog:
visit(AppConstants.URLs.changelog)
case .website: case .website:
visit(AppConstants.URLs.website) visit(AppConstants.URLs.website)

View File

@ -246,7 +246,6 @@
"about.title" = "Über"; "about.title" = "Über";
"about.sections.web.header" = "Web"; "about.sections.web.header" = "Web";
"about.sections.share.header" = "Teilen"; "about.sections.share.header" = "Teilen";
"about.cells.changelog.caption" = "Changelog";
"about.cells.credits.caption" = "Credits"; "about.cells.credits.caption" = "Credits";
"about.cells.website.caption" = "Homepage"; "about.cells.website.caption" = "Homepage";
"about.cells.faq.caption" = "FAQ"; "about.cells.faq.caption" = "FAQ";

View File

@ -244,7 +244,6 @@
"about.title" = "About"; "about.title" = "About";
"about.sections.web.header" = "Web"; "about.sections.web.header" = "Web";
"about.sections.share.header" = "Share"; "about.sections.share.header" = "Share";
"about.cells.changelog.caption" = "Changelog";
"about.cells.credits.caption" = "Credits"; "about.cells.credits.caption" = "Credits";
"about.cells.website.caption" = "Home page"; "about.cells.website.caption" = "Home page";
"about.cells.faq.caption" = "FAQ"; "about.cells.faq.caption" = "FAQ";

View File

@ -246,7 +246,6 @@
"about.title" = "Informazioni su"; "about.title" = "Informazioni su";
"about.sections.web.header" = "Web"; "about.sections.web.header" = "Web";
"about.sections.share.header" = "Condividi"; "about.sections.share.header" = "Condividi";
"about.cells.changelog.caption" = "Changelog";
"about.cells.credits.caption" = "Credits"; "about.cells.credits.caption" = "Credits";
"about.cells.website.caption" = "Home page"; "about.cells.website.caption" = "Home page";
"about.cells.faq.caption" = "FAQ"; "about.cells.faq.caption" = "FAQ";

View File

@ -250,7 +250,6 @@
"about.title" = "Sobre"; "about.title" = "Sobre";
"about.sections.web.header" = "Web"; "about.sections.web.header" = "Web";
"about.sections.share.header" = "Compartilhar"; "about.sections.share.header" = "Compartilhar";
"about.cells.changelog.caption" = "Changelog";
"about.cells.credits.caption" = "Créditos"; "about.cells.credits.caption" = "Créditos";
"about.cells.website.caption" = "Home page"; "about.cells.website.caption" = "Home page";
"about.cells.faq.caption" = "FAQ"; "about.cells.faq.caption" = "FAQ";

View File

@ -171,6 +171,8 @@ public class AppConstants {
public static let privacyPolicy = website.appendingPathComponent("privacy") public static let privacyPolicy = website.appendingPathComponent("privacy")
public static let readme = Repos.ios.appendingPathComponent("blob/master/README.md")
public static let changelog = Repos.ios.appendingPathComponent("blob/master/CHANGELOG.md") public static let changelog = Repos.ios.appendingPathComponent("blob/master/CHANGELOG.md")
public static let subreddit = URL(string: "https://www.reddit.com/r/passepartout")! public static let subreddit = URL(string: "https://www.reddit.com/r/passepartout")!