Skip to content
Snippets Groups Projects
Commit 107cb154 authored by Johannes Grothe's avatar Johannes Grothe
Browse files

#113 Added localization for "Add Feed" view

parent 5fe51330
No related branches found
No related tags found
No related merge requests found
......@@ -36,16 +36,16 @@ struct AddFeedView: View {
VStack {
VStack {
HStack {
Button("Close") { self.presentationMode.wrappedValue.dismiss() }
Button("close_btn_title".localized) { self.presentationMode.wrappedValue.dismiss() }
Spacer()
Text("Add Feeds")
Text("add_feed_title".localized)
Spacer()
Button("Scan") { detector.detect(text, deep_scan: true) }
Button("scan_btn_title".localized) { detector.detect(text, deep_scan: true) }
}
HStack {
HStack {
TextField(
"Enter URL",
"url_textfield".localized,
text: $text
)
......@@ -132,7 +132,7 @@ struct DetectedFeedEntry: View {
.foregroundColor(.red)
}
.alert(isPresented: $showing_alert) {
Alert(title: Text("Removing Feed"), message: Text(getWaringTextForFeedRemoval(detected_feed!)), primaryButton: .default(Text("Okay"), action: {
Alert(title: Text("feed_delete_alert_title".localized), message: Text(getWaringTextForFeedRemoval(detected_feed!)), primaryButton: .default(Text("ok_btn_title".localized), action: {
model.removeFeed(detected_feed!)
}),secondaryButton: .cancel())
}
......
......@@ -31,6 +31,8 @@
"edit_btn_title" = "Ändern";
"done_btn_title" = "Fertig";
"ok_btn_title" = "OK";
"close_btn_title" = "Schließen";
"scan_btn_title" = "Suchen";
// Filter Options
"all_filter" = "Alle";
......@@ -38,9 +40,16 @@
// Alerts
"general_warning_phrase" = "ACHTUNG";
"app_reset_alert_title" = "Daten zurücksetzen";
"app_reset_alert_text" = "Diese Aktion setzt alle Daten der App zurück!";
"feed_delete_alert_title" = "Feed löschen";
"feed_delete_general_text" = "Diese Aktion wird das ausgewählte Feed und all seine Artikel unwiederruflich löschen.";
"feed_delete_bookmarked_part_1" = "Du hast";
"feed_delete_bookmarked_part_2" = "Artikel dieses Feeds gesichert. Auch diese werden gelöscht.";
// Textfield Defaults
"add_collection_textfield" = "Name der neuen Sammlung...";
"search_bar_textfield" = "Suchen...";
"url_textfield" = "URL eingeben...";
......@@ -31,6 +31,8 @@
"edit_btn_title" = "Edit";
"done_btn_title" = "Done";
"ok_btn_title" = "Okay";
"close_btn_title" = "Close";
"scan_btn_title" = "Scan";
// Filter Options
"all_filter" = "All";
......@@ -38,9 +40,16 @@
// Alerts
"general_warning_phrase" = "WARNING";
"app_reset_alert_title" = "Reset Data";
"app_reset_alert_text" = "This action will irreversible delete all Data!";
"feed_delete_alert_title" = "Delete Feed";
"feed_delete_general_text" = "This action will irreversible delete the feed and all of its articles.";
"feed_delete_bookmarked_part_1" = "You have";
"feed_delete_bookmarked_part_2" = "bookmarked articles in this feed.";
// Textfield Defaults
"add_collection_textfield" = "Add a new collection name...";
"search_bar_textfield" = "Search...";
"url_textfield" = "Enter URL...";
......@@ -12,9 +12,9 @@ import Foundation
/// - Returns: The alert text
func getWaringTextForFeedRemoval(_ feed: NewsFeed) -> String {
let bookmarked_articles = feed.getAmountOfBookmarkedArticles()
var out_text = "WARNING: This action will irreversible delete the feed and all of its articles."
var out_text = "\("general_warning_phrase".localized): \("feed_delete_general_text".localized)"
if bookmarked_articles != 0 {
out_text += "\n\nYou have \(bookmarked_articles) bookmarked articles in this feed."
out_text += "\n\n\("feed_delete_bookmarked_part_1".localized) \(bookmarked_articles) \("feed_delete_bookmarked_part_2".localized)"
}
return out_text
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment