Browse Source

localize special category feed titles

Andrew Dolgov 6 months ago
parent
commit
01bb5ae29d

+ 1 - 1
org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java

@@ -117,7 +117,7 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
 					sortCats();
 
 					if (!specialCatFound) {
-						m_cats.add(0, new FeedCategory(-1, "Special", 0));
+						m_cats.add(0, new FeedCategory(-1, getString(R.string.cat_special), 0));
 					}
 
 					m_adapter.notifyDataSetChanged();

+ 25 - 0
org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java

@@ -115,6 +115,31 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
 								m_feeds.add(f);
 								catUnread += f.unread;
 							}
+
+							// localize special feed names
+							// TODO: join with shortcut title lookup by id?
+							if (m_activeCategory != null && m_activeCategory.id == -1) {
+								switch (f.id) {
+									case -1:
+										f.title = getString(R.string.feed_starred_articles);
+										break;
+									case -2:
+										f.title = getString(R.string.feed_published_articles);
+										break;
+									case -3:
+										f.title = getString(R.string.fresh_articles);
+										break;
+									case -4:
+										f.title = getString(R.string.feed_all_articles);
+										break;
+									case -6:
+										f.title = getString(R.string.feed_recently_read);
+										break;
+									case 0:
+										f.title = getString(R.string.feed_archived_articles);
+										break;
+								}
+							}
 						}
 
 					sortFeeds();

+ 4 - 0
org.fox.ttrss/src/main/res/values/strings.xml

@@ -205,7 +205,11 @@
     <string name="headlines_sort_title">Title</string>
     <string name="headlines_sort_articles_title">Sort articles</string>
     <string name="fresh_articles">Fresh articles</string>
+    <string name="cat_special">Special</string>
     <string name="feed_starred_articles">Starred articles</string>
+    <string name="feed_published_articles">Published articles</string>
+    <string name="feed_archived_articles">Archived articles</string>
+    <string name="feed_recently_read">Recently read</string>
     <string name="feed_all_articles">All articles</string>
     <string name="prefs_enable_fab">Enable FAB</string>
     <string name="prefs_enable_fab_long">Show floating action button when reading</string>