Weblate: Adding a language with an underscore to a component results in the created xliff to be invalid

Created on 8 Jan 2019  路  1Comment  路  Source: WeblateOrg/weblate

Describe the bug
When a new language is addd to a component that contains an underscore, the created xliff file will have as target-language the language with underscore. From my understanding an underscore is not permitted in the field target-language as the xliff spec (https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd) defines the field as <xsd:attribute name="target-language" type="xsd:language" use="optional"/> where xsd:language is defined as [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})* (http://www.datypic.com/sc/xsd/t-xsd_language.html)

To Reproduce
Steps to reproduce the behavior:

  1. Add a new language that contains an underscore to a component . i.e en_US
  2. Resulting new xlf file will have target-language="en_US"

Expected behavior
I think the correct thing to do would be to replace the _ with a - in the xlf file and leave the filename as _.

Server configuration and status

 * Weblate 3.3
 * Python 2.7.13
 * Django 1.11.17
 * Celery 4.2.1
 * celery-batches 0.2
 * six 1.12.0
 * social-auth-core 2.0.0
 * social-auth-app-django 3.1.0
 * django-appconf 1.0.2
 * translate-toolkit 2.3.1
 * Whoosh 2.7.4
 * defusedxml 0.5.0
 * Git 2.11.0
 * Pillow 5.3.0
 * python-dateutil 2.7.5
 * lxml 4.2.5
 * django-crispy-forms 1.7.2
 * django_compressor 2.2
 * djangorestframework 3.9.0
 * user-agents 1.1.0
 * jellyfish 0.6.1
 * pytz 2018.7
 * Database backends: django.db.backends.mysql
 * Cache backends: default:LocMemCache
 * Celery: memory://, N/A, eager
 * Platform: Linux 4.9.0-8-amd64 (x86_64)
bug

Most helpful comment

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

  • In case you see 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.

>All comments

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

  • In case you see 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.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

BoFFire picture BoFFire  路  4Comments

BhaaLseN picture BhaaLseN  路  5Comments

rvanlaak picture rvanlaak  路  5Comments

asereze picture asereze  路  4Comments

mlaggner picture mlaggner  路  3Comments