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

feat: feed end indicator (2) #385

Merged
merged 3 commits into from
Aug 2, 2024
Merged

Conversation

sevonj
Copy link
Contributor

@sevonj sevonj commented Jul 26, 2024

Second attempt at #369
image

Still needs to use translations, maybe rephrase it too.

I omitted the scroll to top button as it did not work.

Copy link

vercel bot commented Jul 26, 2024

@sevonj is attempting to deploy a commit to the Xylight's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines 281 to 285
{#if feedData.community_name}
You have reached the end of {feedData.community_name}.
{:else}
You have reached the end of the feed.
{/if}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These strings are now separate because I already know that trying to work one to fit both would be a pain in some languages.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make a string like this:

"endFeed": "You have reached the end of {feed}",
"feed": "The feed"

and then in the code:

$t('endFeed', { feed: feedData.community_name ?? $t('feed').toLowercase()  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to think through the logic so I can make it grammatically correct in the Finnish translation. The language uses cases everywhere, so I have to restructure the sentence to work myself out of the need to change the case of community_name.

Maybe I can put the entire sentence inside a check like {{feed;the feed:{{feed}}_sentence; default:community_sentence {{feed}};}}

@sevonj sevonj force-pushed the feat-feed-end-indicator2 branch from f80a882 to f561670 Compare August 1, 2024 12:04
@@ -183,7 +183,8 @@
"routes": {
"frontpage": {
"title": "Frontpage",
"footer": "{{users:number}} active {{users; 1:user; default:users;}}"
"footer": "{{users:number}} active {{users; 1:user; default:users;}}",
"endFeed": "You have reached the end of {{community_name; undefined:the feed.; default:{{community_name}}.}}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the cleanest way I could come up with.

I put it under routes.frontpage since that's where the old footer is too.
image

Copy link

vercel bot commented Aug 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
photon ✅ Ready (Inspect) Visit Preview Aug 2, 2024 8:23pm

@Xyphyn
Copy link
Owner

Xyphyn commented Aug 2, 2024

I just added a scroll to top button and made it so it wouldn't overflow with the scroll button.

@Xyphyn
Copy link
Owner

Xyphyn commented Aug 2, 2024

Thanks for your contribution!

@Xyphyn Xyphyn merged commit aef0236 into Xyphyn:main Aug 2, 2024
1 check failed
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