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

Add support for Apple XLIFF #11483

Open
2 tasks done
bryceco opened this issue Apr 24, 2024 · 5 comments
Open
2 tasks done

Add support for Apple XLIFF #11483

bryceco opened this issue Apr 24, 2024 · 5 comments
Labels
enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit

Comments

@bryceco
Copy link

bryceco commented Apr 24, 2024

Describe the issue

For my app I'm uploading XLIFF files generated by Xcode (XLIFF 1.2). The strings file includes plural forms for "one", "few", "many" and "other". However when viewing the strings on Weblate users only see entries for "one" and "other". Similarly when I download a PO of the strings the "few" and "many" strings are missing. When I download the XLIFF file using "File in original format as translated in the repository" XLIFF 1.2 with placeables support the plurals are there.

<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
  <file original="Base.lproj/MainStoryboard.storyboard" source-language="en" target-language="ru" datatype="plaintext">
    <header>
      <tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="15.3" build-num="15E204a"/>
    </header>
    <body>
      <trans-unit id=" (%d members)&#10;|==|plural.few" xml:space="preserve">
        <source> (%d members)</source>
        <target state="translated"> (%d элемета)</target>
        <note/>
      </trans-unit>
      <trans-unit id=" (%d members)&#10;|==|plural.many" xml:space="preserve">
        <source> (%d members)</source>
        <target state="translated"> (%d элементов)</target>
        <note/>
      </trans-unit>
      <trans-unit id=" (%d members)&#10;|==|plural.one" xml:space="preserve">
        <source> (%d member)</source>
        <target state="translated"> (%d элемент)</target>
        <note/>
      </trans-unit>
      <trans-unit id=" (%d members)&#10;|==|plural.other" xml:space="preserve">
        <source> (%d members)</source>
        <target state="translated"> (%d элементов)</target>
        <note/>
      </trans-unit>
    </body>
  </file>
</xliff>

I already tried

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

  1. Verify that the translation file linked above contains "few"/"many" plurals.
  2. See that the equivalent strings in the Weblate web interface are missing.

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Apr 25, 2024

Weblate doesn't yet support this propritetary way of storing plural, see translate/translate#4614

@nijel nijel added enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit labels Apr 25, 2024
Copy link

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

@nijel nijel changed the title XLIFF: "few"/"many" plurals are missing Add support for Apple XLIFF Apr 25, 2024
@bryceco
Copy link
Author

bryceco commented Apr 25, 2024

I understand that this is a proprietary way of handling plurals in XLIFF, and I don't expect Weblate to provide first-class support to them. But I'm still confused about why the "one" and "other" strings are displayed while "few" and "many" are not. Is this also part of translate? Because the bug reports there imply they should be present, just not recognized as plural forms. Thanks!

@nijel
Copy link
Member

nijel commented Apr 25, 2024

I guess you've configured it as monolingual format and in that case only keys present in the source file are shown.

@bryceco
Copy link
Author

bryceco commented Apr 25, 2024

All 4 plurals are present in the XLIFF I'm uploading. Or maybe I misunderstand you.
Edit: Okay, I think I see what you mean. So I should be able to fix it by disabling monolingual.
Edit2: Removing the "Monolingual base language file" setting seems give me the result I wanted. Thanks @nijel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit
Projects
None yet
Development

No branches or pull requests

2 participants