Skip to content

Instantly share code, notes, and snippets.

@mficzel
Created July 5, 2019 09:54
Show Gist options
  • Save mficzel/98b80becd4a02269b330c51e09431d04 to your computer and use it in GitHub Desktop.
Save mficzel/98b80becd4a02269b330c51e09431d04 to your computer and use it in GitHub Desktop.
Translations with arguments and quantity
hotelCount = ${Translation.id('foundHotelsLabel').source('HotelList').package('Vendor.Site').arguments({count:12, location:'timbuktu'}).quantity(12).translate()}
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="" product-name="Vendor.Site" source-language="en" target-language="de" datatype="plaintext">
<body>
<group id="foundHotelsLabel" restype="x-gettext-plurals">
<trans-unit id="foundHotelsLabel[0]">
<source>Found one hotel in {location} for you</source>
<target>Eine Unterkunft in {location} für Sie gefunden</target>
</trans-unit>
<trans-unit id="foundHotelsLabel[1]">
<source>Found {count} hotels in {location} for you</source>
<target>Wir haben {count} Unterkünfte in {location} für Sie gefunden</target>
</trans-unit>
</group>
</body>
</file>
</xiff>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment