Skip to content

Commit

Permalink
fix translation mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
joethei committed Jun 27, 2022
1 parent 223c2d0 commit 78631d6
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 59 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "rss-reader",
"name": "RSS Reader",
"version": "1.2.1",
"version": "1.2.2",
"minAppVersion": "0.13.33",
"description": "Read RSS Feeds from within obsidian",
"author": "Johannes Theiner",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rss-reader",
"version": "1.2.1",
"version": "1.2.2",
"description": "Read RSS Feeds from inside obsidian",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/l10n/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default {
from_feeds: "Aus Feeds: ",
with_tags: "Mit Tags: ",


no_feed_with_name: "Es existiert kein Feed mit diesem Namen",
invalid_tag: "Dieser Tag ist nicht gültig",

note_exists: "Es existiert bereits eine Notiz mit diesem Namen",
Expand Down
17 changes: 9 additions & 8 deletions src/l10n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export default {
//commands
open: "Open",
refresh_feeds: "Refresh feeds",
create_all: "Create wallabag.xml",
create_all: "Create all",

//folder actions
mark_all_as_read: "Mark wallabag.xml as read",
add_tags_to_all: "Add tags to wallabag.xml entries",
mark_all_as_read: "Mark all as read",
add_tags_to_all: "Add tags to all entries",

filtered_folders: "Filtered Folders",
folders: "Folders",
Expand Down Expand Up @@ -76,7 +76,7 @@ export default {
invalid_feed: "This feed does not have any entries",

//filter types
filter_tags: "wallabag.xml articles with tags",
filter_tags: "All articles with tags",
filter_unread: "All unread articles(from folders)",
filter_read: "All read articles(from folders)",
filter_favorites: "Favorites(from folders)",
Expand Down Expand Up @@ -105,6 +105,7 @@ export default {
from_feeds: "from feeds: ",
with_tags: "with tags: ",

no_feed_with_name: "There is no feed with this name",
invalid_tag: "This is not a valid tag",

note_exists: "there is already a note with that name",
Expand Down Expand Up @@ -166,15 +167,15 @@ export default {

//cleanup modal
cleanup: "Cleanup articles",
cleanup_help: "Removes wallabag.xml entries which fit the criteria specified below.",
cleanup_help2: "Keep in mind that wallabag.xml articles that still exist in the feed will reappear on the next refresh",
cleanup_help: "Removes entries which fit the criteria specified below.",
cleanup_help2: "Keep in mind that articles that still exist in the feed will reappear on the next refresh",
perform_cleanup: "Perform cleanup",
all: "all",
from_feed: "from feed",
older_than: "older than X Days",
older_than_help: "keep empty for wallabag.xml, will be ignored if there is no publishing date associated with entry",
older_than_help: "keep empty for all, will be ignored if there is no publishing date associated with entry",
advanced: "Advanced",
remove_wrong_feed: "Remove wallabag.xml articles that are in the incorrect feed",
remove_wrong_feed: "Remove all articles that are in the incorrect feed",
remove_wrong_feed_help: "This might have happened due to a bug in versions pre 0.8",
scanning_items: "Scanning Articles (%1 / %2)",

Expand Down
81 changes: 37 additions & 44 deletions src/modals/FilteredFolderModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export enum SortOrder {
ALPHABET_INVERTED
}

export interface FilteredFolder{
export interface FilteredFolder {
name: string;
filterTags: string[];
ignoreTags: string[];
Expand Down Expand Up @@ -55,7 +55,7 @@ export class FilteredFolderModal extends BaseModal {
super(plugin.app);
this.plugin = plugin;

if(folder) {
if (folder) {
this.name = folder.name;
this.sortOrder = folder.sortOrder;
this.filterTags = folder.filterTags;
Expand All @@ -70,8 +70,8 @@ export class FilteredFolderModal extends BaseModal {
}
}

async display() : Promise<void> {
const { contentEl } = this;
async display(): Promise<void> {
const {contentEl} = this;

contentEl.empty();

Expand Down Expand Up @@ -122,8 +122,8 @@ export class FilteredFolderModal extends BaseModal {
const sorting = new Setting(contentEl)
.setName(t("sort"))
.addDropdown((dropdown: DropdownComponent) => {
for(const order in SortOrder) {
if(order.length > 1) {
for (const order in SortOrder) {
if (order.length > 1) {
// @ts-ignore
dropdown.addOption(order, t("sort_" + order.toLowerCase()));
}
Expand Down Expand Up @@ -157,7 +157,7 @@ export class FilteredFolderModal extends BaseModal {
.addExtraButton((button) => {
button
.setTooltip(t("delete"))
.setIcon("feather-trash")
.setIcon("trash")
.onClick(() => {
this.filterFolders = this.filterFolders.filter(e => e !== this.filterFolders[folder]);
this.display();
Expand Down Expand Up @@ -238,22 +238,16 @@ export class FilteredFolderModal extends BaseModal {
feedsDiv.createEl("p", {text: t("filter_feed_help")});

const feeds = this.plugin.settings.feeds.filter(feed => {
if(this.filterFolders.length === 0)
if (this.filterFolders.length === 0)
return true;
return this.filterFolders.contains(feed.folder);
}).map((feed) => feed.name);

for (const feed in this.filterFeeds) {
new Setting(feedsDiv)
.addSearch(async (search: SearchComponent) => {
new ArraySuggest(this.app, search.inputEl, new Set(feeds));
search
.setValue(this.filterFeeds[feed])
.onChange(async (value: string) => {
this.removeValidationError(search);
this.filterFeeds = this.filterFeeds.filter(e => e !== this.filterFeeds[feed]);
this.filterFeeds.push(value);
});
.addText(text => {
text.setDisabled(true)
.setValue(this.filterFeeds[feed]);
})
.addExtraButton((button) => {
button
Expand All @@ -273,13 +267,21 @@ export class FilteredFolderModal extends BaseModal {
new ArraySuggest(this.app, search.inputEl, new Set(feeds));
search
.onChange(async (value: string) => {
const feeds = this.plugin.settings.feeds.filter(feed => feed.name === feedIgnoreValue).length;
if(feeds !== 1) {
this.setValidationError(search, t("no_feed_with_name"));
return;
}
feedValue = value;
});
}).addExtraButton(button => {
button
.setTooltip(t("add"))
.setIcon("plus")
.onClick(() => {
const feeds = this.plugin.settings.feeds.filter(feed => feed.name === feedIgnoreValue).length;
if(feeds !== 1) return;

this.filterFeeds.push(feedValue);
this.display();
});
Expand All @@ -289,24 +291,18 @@ export class FilteredFolderModal extends BaseModal {
feedsDiv.createEl("p", {text: t("filter_feed_ignore_help")});

//ignore feeds
for (const folder in this.ignoreFeeds) {
for (const feed in this.ignoreFeeds) {
new Setting(feedsDiv)
.addSearch(async (search: SearchComponent) => {
new ArraySuggest(this.app, search.inputEl, new Set(feeds));
search
.setValue(this.ignoreFeeds[folder])
.onChange(async (value: string) => {
this.removeValidationError(search);
this.ignoreFeeds = this.ignoreFeeds.filter(e => e !== this.ignoreFeeds[folder]);
this.ignoreFeeds.push(value);
});
.addText(text => {
text.setDisabled(true)
.setValue(this.ignoreFeeds[feed]);
})
.addExtraButton((button) => {
button
.setTooltip(t("delete"))
.setIcon("trash")
.onClick(() => {
this.ignoreFeeds = this.ignoreFeeds.filter(e => e !== this.ignoreFeeds[folder]);
this.ignoreFeeds = this.ignoreFeeds.filter(e => e !== this.ignoreFeeds[feed]);
this.display();
});

Expand All @@ -319,13 +315,21 @@ export class FilteredFolderModal extends BaseModal {
new ArraySuggest(this.app, search.inputEl, new Set(feeds));
search
.onChange(async (value: string) => {
const feeds = this.plugin.settings.feeds.filter(feed => feed.name === feedIgnoreValue).length;
if (feeds !== 1) {
this.setValidationError(search, t("no_feed_with_name"));
return;
}
feedIgnoreValue = value;
});
}).addExtraButton(button => {
button
.setTooltip(t("add"))
.setIcon("plus")
.onClick(() => {
const feeds = this.plugin.settings.feeds.filter(feed => feed.name === feedIgnoreValue).length;
if (feeds !== 1) return;

this.ignoreFeeds.push(feedIgnoreValue);
this.display();
});
Expand All @@ -339,19 +343,9 @@ export class FilteredFolderModal extends BaseModal {

for (const tag in this.filterTags) {
new Setting(tagDiv)
.addSearch(async (search: SearchComponent) => {
new ArraySuggest(this.app, search.inputEl, get(tagsStore));
search
.addText(text => {
text.setDisabled(true)
.setValue(this.filterTags[tag])
.onChange(async (value: string) => {
this.removeValidationError(search);
if (!value.match(TAG_REGEX) || value.match(NUMBER_REGEX) || value.contains(" ") || value.contains('#')) {
this.setValidationError(search, t("invalid_tag"));
return;
}
this.filterTags = this.filterTags.filter(e => e !== this.filterTags[tag]);
this.filterTags.push(value);
});
})
.addExtraButton((button) => {
button
Expand Down Expand Up @@ -463,12 +457,12 @@ export class FilteredFolderModal extends BaseModal {
.setIcon("checkmark")
.onClick(async () => {
let error = false;
if(!nameText.getValue().length) {
if (!nameText.getValue().length) {
this.setValidationError(nameText, t("invalid_name"));
error = true;
}

if(error) {
if (error) {
new Notice(t("fix_errors"));
return;
}
Expand All @@ -489,8 +483,7 @@ export class FilteredFolderModal extends BaseModal {
}



async onOpen() : Promise<void> {
async onOpen(): Promise<void> {
await this.display();
}
}
1 change: 0 additions & 1 deletion src/parser/rssParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export async function getFeedItems(feed: RssFeed): Promise<RssFeedContent> {
try {
const rawData = await requestFeed(feed);
data = new window.DOMParser().parseFromString(rawData, "text/xml");
console.log(data);
} catch (e) {
console.error(e);
return Promise.resolve(undefined);
Expand Down
4 changes: 2 additions & 2 deletions src/settings/FilterSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ export function displayFilterSettings(plugin: RssReaderPlugin, containerEl: HTML
const folders = filter.filterFolders.join(",");
message += "; " + t("from_folders") + folders;
}
if (filter.filterFeeds.length > 0) {
if (filter.filterFeeds !== undefined && filter.filterFeeds.length > 0) {
const feeds = filter.filterFeeds.join(",");
message += "; " + t("from_feeds") + feeds;
}
if (filter.filterTags.length > 0) {
if (filter.filterTags !== undefined && filter.filterTags.length > 0) {
const tags = filter.filterTags.join(",");
message += "; " + t("with_tags") + tags;
}
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"1.0.5": "0.12.17",
"1.1.0": "0.12.17",
"1.2.0": "0.13.33",
"1.2.1": "0.13.33"
"1.2.1": "0.13.33",
"1.2.2": "0.13.33"
}

0 comments on commit 78631d6

Please sign in to comment.