Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update translator.go #216

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Update translator.go #216

merged 1 commit into from
Oct 6, 2023

Conversation

Strubbl
Copy link
Contributor

@Strubbl Strubbl commented Oct 5, 2023

I change the category atom translation from term to label, because there are feeds, which use the term as slug and prefix them with e.g. t:, but the label is the tag name then. When translating an atom feed to a generic feed, this would help to get more cleaner categories since the label does not have any prefix.

@mmcdole
Copy link
Owner

mmcdole commented Oct 6, 2023

Given that Term is required and Label is optional, would you update this to at least fallback to Term if Label isn't present?

      if c.Label != "" {
            categories = append(categories, c.Label)
        } else {
            categories = append(categories, c.Term)
        }

Changes the category atom translation from term to label and use term only as fallback.
@Strubbl
Copy link
Contributor Author

Strubbl commented Oct 6, 2023

Thank you for this hint. I updated this PR accordingly and squashed my commits.

@mmcdole mmcdole merged commit 8543128 into mmcdole:master Oct 6, 2023
@mmcdole
Copy link
Owner

mmcdole commented Oct 6, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants