Skip to content
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

Translations applied partially #2209

Closed
1 task done
kees-z opened this issue Dec 28, 2016 · 14 comments · Fixed by #4384
Closed
1 task done

Translations applied partially #2209

kees-z opened this issue Dec 28, 2016 · 14 comments · Fixed by #4384
Assignees
Labels
Milestone

Comments

@kees-z
Copy link

kees-z commented Dec 28, 2016

I have:

  • searched open and closed issues for duplicates

Version info

Duplicati Version: 2.0.1.38 Canary
Operating System: Windows 10

Bug description

A lot of translations to Dutch are not applied to the web interface. Especially the Advanced Options section is still completely English (except a few lines, like "Core options" and "Choose an option"), despite they are all translated to Dutch in the .po file.
Also the text in the section "Manage database" is not translated. See screenshot 3 below.

Steps to reproduce

  • Fire up the Duplicati web interface.
  • Open a window that displays any advanced options (e.g. Add backup or Settings).
  • Also take a look at "Manage database" under a preconfigured backup task.

Actual result: Almost all advanced options (the list as well as the explanations) are still in English.
Expected result: All strings should be displayed in the translated language.

Screenshots

Screenshot 1:
advoptionsnottranslated1

Screenshot 2:
advoptionsnottranslated2

Screenshot 3:
dbmgmtnottranslated

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40449701-translations-applied-partially?utm_campaign=plugin&utm_content=tracker%2F4870652&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F4870652&utm_medium=issues&utm_source=github).
@kees-z kees-z changed the title Translations applied paritally Translations applied partially Dec 28, 2016
@agrajaghh agrajaghh added the bug label Dec 28, 2016
@agrajaghh agrajaghh self-assigned this Dec 28, 2016
@kenkendk kenkendk added this to the 2.0 stable milestone Oct 4, 2017
@kees-z
Copy link
Author

kees-z commented Jan 23, 2018

In addition to the issues reported above:

  • Advanced options seem to be translated to most languages, except to Dutch. All advanced options have a Dutch translation, but the list is still completely in English (see screenshot 1 above).
    Also, all options under "Configure http requests" are listed twice, see Some Advanced Options are listed twice #2184.
  • Translation to Database Management (screenshot 3 above) is still not applied. However, a translation of this text is available.
  • The word "Strength" in step 1 of the Add backup wizard is still untranslated. See 2 issues with translating at Transifex.com #2680.
  • The recently improved feature "Backup retention" in step 5 of the Add backup wizard is not translated:

backupretention

@kees-z
Copy link
Author

kees-z commented Feb 6, 2018

These unapplied translations can be added to the list above:

  • When creating a new backup job, and clicking the "Test connection" button when the specified folder does not exist, a message appears that the folder does not exist, offering to create it automatically. The translation for this text is not applied.
    image
  • When running a backup, in the status bar the word "at", indicating the upload speed, is not translated.

@Sordon
Copy link

Sordon commented Feb 25, 2020

I want to ask when this translation bug will be fixed? At least for the problem described in Screenshot 3 this is still the case in February 2020. In case I'm pointed to the right direction I can offer some help to fix this.

@Sordon
Copy link

Sordon commented Feb 25, 2020

I looked into the script 'angular-gettext-cli_compiled_js_output.js' and saw that the English text that gets not translated contains \\n. As soon as I remove the not needed backslash and it looks like this \n the translated text is shown. So I guess that has to be fixed in the original text.

See here the corrected German translation as an example. The translation is pulled from the translation script as it should:

grafik

@duplicatibot
Copy link

This issue has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/solution-for-translation-problem-in-web-gui/9664/1

@duplicatibot
Copy link

This issue has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/language-aspects-in-commandline-exe/11275/2

@warwickmm
Copy link
Member

@kees-z, regarding the lack of translations for the retention options (e.g., "Delete backups that are older than"), is that still an issue? It appears that it might have been fixed in 6f09c72 (v2.0.2.19-2.0.2.19_canary_2018-02-12).

@warwickmm
Copy link
Member

I looked into the script 'angular-gettext-cli_compiled_js_output.js' and saw that the English text that gets not translated contains \n. As soon as I remove the not needed backslash and it looks like this \n the translated text is shown. So I guess that has to be fixed in the original text.

@Sordon, pull request #4384 removes extra backslashes from the localization source. I'm not that familiar with how the translations work, but I think this should resolve the issue you described.

@ts678
Copy link
Collaborator

ts678 commented Dec 5, 2020

I'm not that familiar with how the translations work

I'm not either, but Localizations/webroot/localization_webroot.pot looks like a generated file from angular-gettext-cli:

angular-gettext-cli --files "**/*.+(js|html)" --dest $SCRIPT_DIR"/"localization_webroot.pot

however looking at its history, I'm not sure if it's sent to Transifex or received from them. Sending makes more sense.
Maybe changes like this should be in the source files from which the extraction is done. In this case, that might be in:

<div>
{{'Each backup has a local database associated with it, which stores information about the remote backup on the local machine.\nThis makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation.' | translate}}
</div>

but a question to someone who knows HTML is whether newlines even make sense in this context. Will browser wrap?

@warwickmm
Copy link
Member

Thanks @ts678. I had thought that the source text was extracted automatically, but also saw individual commits to localization_webroot.pot that appeared to contain manual edits (although this isn't proof of anything). Also, I'm not sure why \n gets converted to \\n (perhaps attempted escaping of \)? However, I do see \n (single backslash) showing up in localization_webroot.pot as well, so not sure why the behavior is inconsistent.

Regardless, it doesn't seem like the \n is interpreted as a newline anyway, so perhaps the solution is to remove the \n from the source and the localization_webroot.pot file. If the latter is automatically generated, then it should still be ok.

image

@warwickmm
Copy link
Member

warwickmm commented Dec 5, 2020

I'm now convinced that localization_webroot.pot is automatically generated. It appears that linebreaks in the html files yield \n in the localization_webroot.pot,

Backup is encrypted but no passphrase is available.
Type a passphrase below to use for restoring your files,
or, in case of GPG encryption, leave blank to let gpg retrieve the passphrase by
invoking your system's keychain.

"Backup is encrypted but no passphrase is available.\n"
" Type a passphrase below to use for restoring your files,\n"
" or, in case of GPG encryption, leave blank to let gpg retrieve the passphrase by\n"
" invoking your system's keychain."

but explicit \n results in \\n:

{{'Each backup has a local database associated with it, which stores information about the remote backup on the local machine.\nThis makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation.' | translate}}

msgid "Each backup has a local database associated with it, which stores information about the remote backup on the local machine.\\nThis makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation."

I think the best solution is to remove \n from the strings in the html files. Pull request #4384 has been updated to do this.

warwickmm added a commit to warwickmm/duplicati that referenced this issue Dec 5, 2020
These don't get interpreted as line breaks, and the resulting characters
get converted to \\n in the localization_webroot.pot translation source
file, which prevents translation of these strings.

This concerns the following comment in issue duplicati#2209:

duplicati#2209 (comment)
@Sordon
Copy link

Sordon commented Dec 7, 2020

Thanks, that finally someone had a look at this problem. Will the fix be part of the next beta?

@kees-z
Copy link
Author

kees-z commented Dec 7, 2020

@kees-z, regarding the lack of translations for the retention options (e.g., "Delete backups that are older than"), is that still an issue? It appears that it might have been fixed in 6f09c72 (v2.0.2.19-2.0.2.19_canary_2018-02-12).

I can confirm that the retention options are translated correctly in the current version.
Translation of advanced options is fixed also, as well as the pop-up message for remote folder creation.

Still untranslated are the management options for the local database.

@warwickmm
Copy link
Member

@Sordon, I expect this to be part of the next beta. However, the timing of the next beta release is unclear. We should start planning...

Thanks @kees-z. I believe pull request #4384 should fix the translations on the local database page so I'll mark it as the fix. If we find additional translation problems, we can create new issues for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants