-
Notifications
You must be signed in to change notification settings - Fork 44
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 viewer.php #826
Update viewer.php #826
Conversation
Add localisation tags. Signed-off-by: Oleksa <ostasevych@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
However, please note that the PDF viewer uses a different translation system than other Nextcloud apps. The PDF viewer is based on the PDF.js project, and the localised strings in templates/viewer.php are provided by PDF.js rather than the PDF viewer app itself (templates/viewer.php is a slightly customized version of web/viewer.html from PDF.js). The localised strings are automatically translated when the PDF viewer is shown based on the data-l10n-id
properties, so calling $l->t(
is not needed to mark the string for extraction nor to translate them at runtime.
Note that this applies only to the templates/viewer.php file, and only to those elements that have a data-l10n-id
property. Other strings, for example those defined in the JavaScript files specific to the PDF viewer, would use the standard translation system of Nextcloud. But, right now, there are no strings specific to the PDF viewer that need to be localised (although that will probably change soon).
Nevertheless, if you are interested in contributing to Nextcloud translations please check https://help.nextcloud.com/t/translation-knowledge-valid-for-the-entire-nextcloud-project-wiki/51550 Thanks a lot!
Please, re-check! Having the strings translated in e.g. Ukrainian, the viewer is shown in English. Only after adding l-tags to the viewer.php and creating proper l10n/uk.json file I have managed to observe the menu in Ukrainian. |
Hello there, We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
You are right, the translations do not honour the language specified in Nextcloud settings. The language is got from the browser preferences instead. I did not notice that because both languages were the same in my system :-) It would be necessary to force PDF.js to use a specific language rather than auto-detecting it from the browser preferences. Unfortunately I have not been able to figure out how yet; I expected it to be just a matter of adding
|
Added localisation tags.