Skip to content

Adding files to variants #113

Description

@st3fan

(I know this is not really a bug report, but I don't know where else to ask questions - I'm happy to convert this into a wiki page as an example usage though)

Hello and thank you for maintaining this project. At Mozilla we are trying to use this for the following use case:

We have a product called Focus at https://github.com/mozilla-mobile/focus which currently is English only.

We localize the product by exporting an en.XLIFF file to our localization volunteers and we get back XLIFF files for other locales. To import these we run xcodebuild -importLocalizations -localizationPath l10n/nl.xliff for example. This spits out .strings files in the proper .lproj directories.

The problem is that xcodebuild only generates the files. It does not actually add them to the project.

This is where pbxproj comes in. I'd like to use it to find for example the PBXVariantGroup for Localizable.strings and then add a PBXFileReference reference for it.lproj/Localizable.strings to it.

However, we are lost in the complexity of both the Xcode projects and the pbxproj API.

My question to you is if we can get some help to find out how to do this. I'm happy to turn the end result in some reusable code that anyoen can use. Or a blog post or a wiki page.

🧀

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions