Exporting plural strings for localization
Asked Answered
A

1

6

I've defined pluralized strings using the .stringsdict format as referenced here.

I'm using XCode's "Editor > Export for Localization.." option to create XLIFF files suitable for translators and translation software, but the strings defined in Localizable.stringsdict don't get exported to the XLIFF file.

How is it possible to export these plural forms into the XLIFF format - get them translated - and import them back into the project?

I'm aware that XLIFF has no native plural markup, but the format is extensible so I don't see why it wouldn't be possible.

Annuitant answered 9/1, 2015 at 21:10 Comment(2)
Can this possibly not be supported still?? My initial research tells me that stringsdict content is not in my xliff export (this is Xcode 7)Transistorize
As this post is still getting clicked I should note that Xcode's XLIFF export now includes a stringsdict <file> section.Annuitant
G
1

Xcode automatically exports stringsdict (plural) strings only beginning in Xcode 9. I know, I know. Although stringsdict has been the way to do plurals in iOS and Mac for a few years now, Apple only half-heartedly supported it until Xcode 9. You can now also view stringsdict files in a format that makes them easier to read, including templates so you can add plurals with a couple of clicks. Xcode 9 and above can also view XLIFF files in a table format. Double-click on your XLIFF in Xcode to see. Before you’d just get the raw XML.

See here: https://www.ibabbleon.com/copywriter-translator/2017/06/whats-new-in-localization-in-xcode-9-ios-11/

Gambeson answered 9/1, 2018 at 21:22 Comment(1)
Thank you for this information. If only I had room on my laptop to install XCode 9 :-/ Also, I note that XLIFF 2.0 became a full ISO standard last November and still has no native support for plural forms.Annuitant

© 2022 - 2024 — McMap. All rights reserved.