Comments (4)
I was wondering is there any option to add i18n translation to at least translate buttons next and previous. Of course I can try to do it on my own. I know I can hardcode this oj file, but you know that this approach is not something that I want to achieve. Besides adding a language file is much easier for average user.
Originally posted by @sysadmin-info in #24 (comment)
The solution is quite simple. All you have to do is to create a i18n directory inside your plugin, where README.md is located. Then put inside the i18n directory file en.toml, pl.toml, fr.toml etc. for each language.
Example content of en.toml
[embed-pdf-next]
other = "Next"
[embed-pdf-prev]
other = "Previous"
Example content of pl.toml
[embed-pdf-next]
other = "Następna"
[embed-pdf-prev]
other = "Poprzednia"
Then in your file embed-pdf.html inside the shortcodes directory you have to change Next and Previous to this:
<button id="pdf-prev-{{ substr (.Get "url" | md5) 0 8 }}">{{ i18n "embed-pdf-prev" }}</button>
<button id="pdf-next-{{ substr (.Get "url" | md5) 0 8 }}">{{ i18n "embed-pdf-next" }}</button>
from hugo-embed-pdf-shortcode.
The problem is that I have no idea how to raise a PR. I already tested it on my side and it is working as expected.
from hugo-embed-pdf-shortcode.
Would you be able to raise a PR for this solution? I can test it out.
from hugo-embed-pdf-shortcode.
The problem is that I have no idea how to raise a PR. I already tested it on my side and it is working as expected.
Sure. No worries .
Let me check how it's done and will push these changes
from hugo-embed-pdf-shortcode.
Related Issues (20)
- Add a progress loader before displaying the pdf file
- Scroll through pages HOT 9
- I'm sorry but, it doesn't work for me HOT 7
- PDF.js library loading broken HOT 6
- Please make PDF resizable
- Allow multiple PDF embeddings in one page HOT 10
- It doesn't work HOT 14
- Provide option to allow users to download the PDF file HOT 12
- It is working FINE locally but NOT on hosted site. HOT 3
- Undefined is not an object HOT 2
- Install as a Theme Component HOT 3
- PDF always loading, never displaying. HOT 7
- [Feature Request] Add GitHub action to implement a CI for the shortcode
- Users can view PDFs but preventing them the download HOT 2
- PDF not loading on Netlify but is OK on localhost HOT 8
- If there are pictures in the pdf, they cannot be displayed. HOT 2
- hidePaginator option does not work
- how to set a pdf file so that it can display? HOT 14
- Deploy pdf is not working HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-embed-pdf-shortcode.