npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xc-base-import

v0.0.3

Published

A tool that allows to import development language XLIFF files straight into the IB documents (storyboards and xibs)

Downloads

5

Readme

xc-base-import

xc-base-import is a Node.js tool that allows to import development language XLIFF files straight into the IB documents (storyboards and xibs).

Changelog

v0.0.2

  • The tool uses a different XML handling engine.
  • Now IB documents are not affected more than necessary.

Discussion

In iOS7 Apple introduced so-called "Base localization" which allowed to keep the translation separate from the layout. With this approach you create storyboards and put the user-visible strings in the development language (usually English) straight into them. And when the time for the translation comes, you simply export an hand over to the translators a single XLIFF file, which, when imported, produces .strings files for the new language. This is extremely cool and I suggest every iOS developer to use it. (More info)

But it soon turned out that this straightforward approach can only be used for the languages, different from the development one. If you want to change something in English, you still need to open the storyboard with Xcode and manually introduce the changes. Not that cool, huh?

If you decide to import a en-to-en XLIFF file, it produces a separate "en" localization, breaking the whole idea of Base localization and also leading to a certain number of problems, which is out of scope of this document.

xc-base-import module allows to apply the XLIFF files straight to the IB documents, solving this problem. It also integrates nicely with the PhraseApp, which your localizers are very likely using. You just export an en localization file, put it into this tool and that's it!

What the tool does is it looks into the XLIFF file, finds all the entries, that correspond to storyboards and xibs and puts the values straight into these files.

Installation

$ npm install -g xc-base-import

Usage

This tool has a simple command-line interface. You use it like this:

xc-base-import -x /Users/superman/en.xliff  -p /Users/superman/MyProject

Call xc-base-import --help to find all the available parameters.

Disclaimer

This is a BETA tool, so use it at your own risk. Support with the development is highly appreciated until we get the official support for this from Apple =]

I'm an iOS developer and sort of new to Node.js, so the code may not follow any of the existing guidelines or best practices, feel free to send pull requests, I will most likely accept it.

TODO

  • Parse the project file to find the development language (currently hard-coded to en);
  • Apply the [dev_lang].xliff not only to the IB files, but to other resources, like InfoPlist.strings or Localizable.strings, so that no additional manual steps are required (currently you will need to import the XLIFF using Xcode first, commit changes to the non-IB files, like Localizable.strings, revert the rest and then apply this tool).

Known issues

  • Currently only XLIFF files with the source-language and target-language of en work.

Credits

Daniil Konoplev @ Ombori Group AB 2017