Weblate: String with translatable="false" is translatable

Created on 19 Mar 2020  路  15Comments  路  Source: WeblateOrg/weblate

Describe the bug
A string resource in an Android project is translatable, although translatable="false" is set. We are using hosted.weblate.org, running 4.0-dev.
See https://hosted.weblate.org/translate/newpipe/strings/fr/?checksum=f9144c753ee614bc and https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/main/res/values/strings.xml#L435.

To Reproduce
Steps to reproduce the behavior:

  1. Have a string with the attribute translatable="false" in your resources.
  2. Sync Weblate. The string should not be translatable
  3. Update the string's value
  4. Wait for Weblate updating the source => the string is translatable

Expected behavior
A string with the attribute translatable="false" is not shown in Weblate and thus not translatable

Screenshots
image
image

Server configuration and status

weblate 4.0-dev (19.03.2020)

enhancement

Most helpful comment

We're seeing editable strings that are marked translatable="false", for example:
https://hosted.weblate.org/translate/calyxos/platform_packages_apps_setupwizard/el/
for the strings:

  • calyx_wizard_script_uri
  • calyx_wizard_script_user_uri
  • calyx_fdroid_repo_location

"CalyxOS" is a brand new project, and this component was created today, so it should have no legacy issues.

All 15 comments

Weblate should pick up on it, since it can reasonably be expected that it would.

Temporary fix
https://sites.google.com/a/android.com/tools/recent/non-translatablestrings

If you have a lot of resources that should not be translated, you can place them in a file named donottranslate.xml and lint will consider all of them non-translatable resources.

Edit: Alternatively add the flag "read-only" per string or by way of https://hosted.weblate.org/projects/newpipe/#bulk-edit

The string is read-only now. The read-only support is quite recent, it is possible that the file was not processed since then and that's why it was still editable.

Although the string is read-only, it is added to every translation file which has been modified by translators recently. Currently, I have to remove them by hand

It would be nice if admins could edit read-only source strings by default.

@TobiGr It was added only where translators edited it, so it won't happen anymore once the string is properly marked as read only.

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see similar problem, please open separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

We're seeing editable strings that are marked translatable="false", for example:
https://hosted.weblate.org/translate/calyxos/platform_packages_apps_setupwizard/el/
for the strings:

  • calyx_wizard_script_uri
  • calyx_wizard_script_user_uri
  • calyx_fdroid_repo_location

"CalyxOS" is a brand new project, and this component was created today, so it should have no legacy issues.

Looks like Weblate is automatically adding the read-only label to the English source language and German translation, but not the Greek or Norwegian Bokmal translations.

@eighthave I added nb_NO manually. From the looks of it, German was already there when the component was created
https://hosted.weblate.org/changes/?page=2&limit=20&component=platform_frameworks_base_systemui&project=calyxos
There is no "New string to translate" for German. I don't see that one having been read-only.

https://hosted.weblate.org/translate/calyxos/platform_packages_apps_setupwizard/nb_NO/?checksum=786c2cc63f74717d is also untranslatable in nb_NO.and greek

https://hosted.weblate.org/zen/calyxos/platform_packages_apps_setupwizard/de/?q=state:read-only for some reason has 3 strings that are read only. Did you add read only rules in bulk for existing languages, and the first one gets it from the source language?

I manually added the comment "do not translate" and the read-only label to:
https://hosted.weblate.org/translate/calyxos/platform_packages_apps_setupwizard/nb_NO/?checksum=786c2cc63f74717d

This does correctly show the strings marked with translated=false:
https://hosted.weblate.org/zen/calyxos/platform_packages_apps_setupwizard/de/?q=state:read-only

I think I've tracked this down now. Some monolingual update paths didn't handle correctly read-only strings.

We're still seeing this issue.

Going by the above SetupWizard example:

I've noticed the same issues on all projects, and many other languages (picked these two as an example since I knew for sure they had other translations, and some even had these non-translatable strings translated)

Another example string: call_account_signal in platform_packages_apps_dialer - It is allowed to translate that from the UI, but shouldn't be given that it's marked translatable="false"

An example: https://gitlab.com/calyxos/weblate/platform_packages_apps_dialer/-/blob/8fc9326fe7c0ce0451976f718d2dc19306a7a831/java/com/android/dialer/common/res/values-zh-rCN/calyx_strings.xml#L11 (this repo is a mirror of the hosted.weblate.org git repo)

The fixes I've done don't get applied on already imported strings. I've just forced reloading of all CalyxOS components and it seems to look correct to me now.

Thanks a lot, looks correct indeed.

How should I remove the translatable="false" strings which have already been translated? In the UI they're read-only and I can't seem to do anything. Could remove them directly from the git repo after a merge perhaps.

Current List: http://sprunge.us/mu2t42 (All paths are repos under calyxos/ on weblate) - this is from the weblate git repos

You can delete them on your computer, commit, and push. The safest time to do that is right after merging the commits from Weblate.

Was this page helpful?
0 / 5 - 0 ratings