WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.63k stars 1.02k forks source link

There are more files for the single language (en) #3952

Closed reshadf closed 4 years ago

reshadf commented 4 years ago

Describe the bug when adding our Android project to weblate it results in the following error: There are more files for the single language (en), please adjust the filemask and use components for translating different resources.

To Reproduce Steps to reproduce the behavior:

  1. make a project with base language: English (en)
  2. add an android component with a set of languages to weblate with at least English included (en)
  3. for the exact settings see screenshot below

Expected behavior Adding an android project to weblate succeeds

Screenshots hjqWHO jpg

Server configuration and status

* Weblate: 4.0.4
 * Django: 3.0.6
 * siphashc: 1.3
 * Whoosh: 2.7.4
 * translate-toolkit: 2.5.1
 * lxml: 4.3.2
 * Pillow: 7.1.2
 * bleach: 3.1.5
 * python-dateutil: 2.8.1
 * social-auth-core: 3.3.3
 * social-auth-app-django: 3.1.0
 * django-crispy-forms: 1.9.0
 * oauthlib: 3.1.0
 * django-compressor: 2.4
 * djangorestframework: 3.11.0
 * django-appconf: 1.0.4
 * user-agents: 2.1
 * filelock: 3.0.12
 * setuptools: 40.8.0
 * jellyfish: 0.7.2
 * openpyxl: 3.0.1
 * celery: 4.4.2
 * kombu: 4.6.8
 * translation-finder: 2.0
 * html2text: 2020.1.16
 * pycairo: 1.16.2
 * pygobject: 3.30.4
 * diff-match-patch: 20181111
 * requests: 2.23.0
 * django-redis: 4.11.0
 * hiredis: 1.0.1
 * sentry_sdk: 0.14.3
 * Cython: 0.29.17
 * misaka: 2.1.1
 * GitPython: 3.1.2
 * borgbackup: 1.1.11
 * Python: 3.7.3
 * Git: 2.20.1
 * psycopg2: 2.7.7
 * phply: 1.2.5
 * chardet: 3.0.4
 * ruamel.yaml: 0.16.10
 * tesserocr: 2.5.1
 * akismet: 1.1
 * boto3: 1.13.4
 * zeep: 3.4.0
 * aeidon: 1.7.0
 * Mercurial: 5.4
 * git-svn: 2.20.1
 * git-review: 1.28.0
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: mail.proactive.nl
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 4.4.0-179-generic (x86_64)
root@qa-1:/var/base/weblate-docker# docker-compose exec --user weblate weblate weblate check --deploy
System check identified some issues:
WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.
INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.0.4/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.0.4/admin/backup.html
System check identified 6 issues (1 silenced).

Additional context We reproduced this in a docker version of weblate and in our previously installed pip installation

nijel commented 4 years ago

For Android, the English language should be in values/strings.xml, there is no point in having additional file for English. In case you need the file for some obscure reason, you can tell Weblate to ignore it by language filter.

meeximum commented 4 years ago

Hi, I experience the same problem with a Java project! The error removes when I clear the "Monolingual base language file", but then it shows no EN translation, just the keys from the properties file :-/

reshadf commented 4 years ago

The weird this is that this used to work for quite a while before it didn’t after we did an update.. did anything change @nijel ? The file in values/strings.xml is not editable it says read only.

meeximum commented 4 years ago

I tried with a standard java maven project, so all .properties files under /src/resources with the mask: literals_xx.properties and a literals.properties file?

nijel commented 4 years ago

Do you have both literals_en.properties and literals.properties present? What is purpose of the first file then? The source language (English in this case) is supposed to be in literals.properties, I see no point in "translating" it. I've added some docs on the topic it will be shortly visible at https://docs.weblate.org/en/latest/faq.html#faq-duplicate-files

meeximum commented 4 years ago

Perfect! Now it works :-)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.