question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'X of Y' template in props

See original GitHub issue

Hi Joss,

Just wondering if you can implement a little improvement when you change anything in the library next time. It is about making X of Y something you can pass as a prop. This will be extremely useful in multilingual interfaces.

Here is how a feature can look like:

<Lightbox
    images={[{ src: 'http://example.com/img1.jpg' }, { src: 'http://example.com/img2.jpg' }]}
    imageCountTemplate="{current} из {total}" // ← Russian
/>

Certainly, imageCountTemplate can be undefined, which will output {current} of {total} as this is happening now.

Cheers!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jossmaccommented, Nov 24, 2019

@MilosJo in 1.x you can just replace the FooterCount component with whatever you like. Check out the component docs for more info.

1reaction
MilosJocommented, Jun 28, 2019

This isn’t working with new 1.x. And it is pretty neat feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render Props - React
The term “render prop” refers to a technique for sharing code between React components using a prop whose value is a function. A...
Read more >
Motion components | Framer for Developers
Transform properties are accelerated by the GPU, and therefore animate smoothly. They can be set and animated individually as: Translate shortcuts: x ,...
Read more >
Page X of Y doesn't work in Microsoft Word!
I want the filename in the footer of every document. Margins Missing - White Space · Mapped Content Controls and Document Properties ·...
Read more >
Style Props - Chakra UI
Style props are a way to alter the style of a component by simply passing props to it. It helps to save time...
Read more >
Docs • Svelte
Complete documentation for Svelte.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found