easy way to replace a button tooltip #1124
Replies: 3 comments 2 replies
-
What are you trying to do? If I get you right, you
If that's correct, I recommend using the raw translation files. Adding the json files to the index.html is a good idea for one or two languages, but if you need more languages, the default strategy is faster. My default recipe https://pdfviewer.net/extended-pdf-viewer/getting-started instructs you to copy the entire "assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "node_modules/ngx-extended-pdf-viewer/assets/",
"output": "/assets/"
},
{
"glob": "**/*",
"input": "custom-translations/locale",
"output": "/assets/locale/"
}
], The idea being you take one of the translation file (e.g. this one), modify it, and store the modified version in the folder Does this help you? Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi Stephan
The way you are showing seems ok, it looks just a little cumbersome, as it enforces to check each new version on our side if labels are changed on your side.
I was just thinking if there is something that reads your defaults and allows to overwrite the label at runtime.
Thanks for your support
Klaus
From: Stephan Rauh ***@***.***>
Sent: Donnerstag, 13. Januar 2022 23:03
To: stephanrauh/ngx-extended-pdf-viewer ***@***.***>
Cc: Klaus Wiesel (TOPMOTIVE) ***@***.***>; Author ***@***.***>
Subject: Re: [stephanrauh/ngx-extended-pdf-viewer] easy way to replace a button tooltip (Discussion #1124)
What are you trying to do? If I get you right, you
* need the i18n feature
* you want to be able to modify some of the default translations,
* and you've modified the json snippets provided by the library, but that's cumbersome.
If that's correct, I recommend using the raw translation files. Adding the json files to the index.html is a good idea for one or two languages, but if you need more languages, the default strategy is faster.
My default recipe https://pdfviewer.net/extended-pdf-viewer/getting-started instructs you to copy the entire assets folder. This includes the language files. I suppose you can overwrite some of these files in a second step by configuring the angular.json. Something like that:
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "node_modules/ngx-extended-pdf-viewer/assets/",
"output": "/assets/"
},
{
"glob": "**/*",
"input": "custom-translations/locale",
"output": "/assets/locale/"
}
],
The idea being you take one of the translation file (e.g. this one<https://github.com/stephanrauh/ngx-extended-pdf-viewer/blob/main/projects/ngx-extended-pdf-viewer/assets/locale/de/viewer.properties>), modify it, and store the modified version in the folder custom-translations/locale/de/viewer.properties.
Does this help you?
Best regards,
Stephan
—
Reply to this email directly, view it on GitHub<#1124 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHSLFVTW5ZU6RNDFBCN67LTUV5D27ANCNFSM5L3LCABQ>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I used the approach you proposed regarding complete files…
From: Stephan Rauh ***@***.***>
Sent: Montag, 17. Januar 2022 21:47
To: stephanrauh/ngx-extended-pdf-viewer ***@***.***>
Cc: Klaus Wiesel (TOPMOTIVE) ***@***.***>; Author ***@***.***>
Subject: Re: [stephanrauh/ngx-extended-pdf-viewer] easy way to replace a button tooltip (Discussion #1124)
I see. Maybe you can help me because I'm very busy this week. The source code that needs to be modified is here: https://github.com/stephanrauh/pdf.js/tree/bleeding-edge/external/webL10n
More to the point, I guess you'll want to modify this method: https://github.com/stephanrauh/pdf.js/blob/de1d458022c0095321eeb274753181c632f7693c/external/webL10n/l10n.js#L327. You could load the default i18n bundle and merge it with a custom i18n bundle somewhere in this method.
BTW, by the look of it, you're working for an interesting company! :)
Best regards,
Stephan
—
Reply to this email directly, view it on GitHub<#1124 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHSLFVU5CAJANU77ZUZNSPLUWR54NANCNFSM5L3LCABQ>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there an easier way to replace the tooltip of a button than to include the complete json in the index.html? We are working on a project with 10+ languages supported...
Beta Was this translation helpful? Give feedback.
All reactions