-
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
fix: Use the user configured UI language for PDFjs instead of browser language #1022
Conversation
/compile amend/ |
1869688
to
e37bce4
Compare
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
… language PDFjs uses the browser language by default, but users should have consistently the Nextcloud defined language. So now we set the PDFjs language to: 1. The Nextcloud configured language if supported 2. The unflavored version if supported (e.g. `de` instead of `de-DE`) 3. Fall back to browser UI language We need 3 because if we set an unsupported lanuage PDFjs will default to English, which is worse than the browser UI language. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
e37bce4
to
6c641b2
Compare
The backport to # Switch to the target branch and update it
git checkout stable28
git pull origin stable28
# Create the new backport branch
git checkout -b backport/1022/stable28
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 9078680f 6c641b2f
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/1022/stable28 Error: Failed to clone repository: Failed to checkout branches: error: Your local changes to the following files would be overwritten by checkout: Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
The backport to # Switch to the target branch and update it
git checkout stable29
git pull origin stable29
# Create the new backport branch
git checkout -b backport/1022/stable29
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 9078680f 6c641b2f
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/1022/stable29 Error: Failed to clone repository: Failed to checkout branches: error: Your local changes to the following files would be overwritten by checkout: Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
The backport to # Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/1022/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 9078680f 6c641b2f
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/1022/stable30 Error: Failed to clone repository: Failed to checkout branches: error: Your local changes to the following files would be overwritten by checkout: Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
Hey, so I cannot understand the solution. How to translate the strings, update them? Is transifex supported? I have modified template file where the strings are localised, plus the Ukrainian version. I can help to migrate main languages to the standard template file, if needed. After each update I manually correct the template file, add the localiser strings. It is a bit annoying thing. So if no automatised solution found I am thinking just to fork the app. |
@ostasevych We decided to use the PDFjs translations, but we fixed the language detection, see the closed issue. |
Ref: #1022 |
Why? Why not to go in line with nc standards as other apps do? Which framework to use in order to improve the translations? How to get know if new strings appear, eg transifex informs on that? |
This app basically wraps the PDFjs library, a lot of strings are set internally.
PDFjs is a mozilla library and uses the Mozilla L10n project for translations, I think all Mozilla products are translated at protoon: https://pontoon.mozilla.org/teams/ |
I am a volunteer translator in Ukrainian, that is why I am so dissatisfied with the way how this app is built in terms of localisation :( |
PDFjs is part of Firefox so the translations are also part of the firefox translation project.
But this does not fully work, as the strings are not all in the template, but also within the Javascript code of the library. |
BTW do you experience any translation issues? (Since the merged fix, so with current master branch) |
Nothing changed with 28.0.9. Instead of Ukrainian I see all strings in English. It is not working completely so I have to change the template and add my translations to my cloud. Ahhh! What did you do? Now my localisation is not working anymore. First time it shows in Ukrainian and in a second switches to English. :/ |
Ah, sorry. So, should I manually download and install the app from master branch? |
I am getting error when running
So, cannot replace the one app, which is provided with 28.0.9, which doesn't show Ukrainian strings (. |
So, I have manually replaced |
Just until it is also fixed for 28 and 29 :) |
Again, no localisation in 28.0.10. The language is still English. |
Yes it is only backported to stable30 and stable29. So you would have to update to at least 29. |
What is wrong with backporting to 28.x?.. |
PDFjs uses the browser language by default, but users should have consistently the Nextcloud defined language. So now we set the PDFjs language to:
de
instead ofde-DE
)We need 3 because if we set an unsupported language PDFjs will default to English, which is worse than the browser UI language.
Screen recording
My Nextcloud language: Spanish
My Browser UI: German
Before
Bildschirmaufnahme_20240822_190219.webm
After
Bildschirmaufnahme_20240822_183724.webm