QuickLook plugin to preview .strings files

Posted: March 25th, 2014 | Author: | Filed under: Debugging, macOS, Programming | Tags: | 2 Comments »

OS X and iOS use .strings files for localized text strings as described in the String Resources Documentation:

Resource files that contain localizable strings are referred to as strings files because of their filename extension, which is .strings.

It is yet annoying that OS X and Xcode don’t provide a built-in QuickLook plugin for previewing .strings files. When you preview such a file in QuickLook you see this window:


Without 'StringsFile' QuickLook plugin

To solve this issue, here is a simple QuickLook plugin called ‘StringsFile’ that lets you preview .strings files (plain text .strings and binary property plist .strings).
This QuickLook plugin is really useful to quickly check the content of a .strings file. When you preview such a file, you will now see:


With 'StringsFile' QuickLook plugin

A precompiled version can be downloaded here: StringsFile.qlgenerator.zip

You can download the source code here : Download ‘StringsFile’ Source Code

Installation:

  • Download the precompiled version
  • Unzip
  • Copy the file into /Library/QuickLook/ or ~/Library/QuickLook/
  • Execute the command “qlmanage -r” in the Terminal – or restart the machine

Update (02.04.2014): The plugin has been updated to also generate a thumbnail for .strings files.


Thumbnail


2 Comments on “QuickLook plugin to preview .strings files”

  1. 1 Uli said at 11:03 am on April 1st, 2014:

    Handy! One suggestion: All that XML is kinda hard to read. Could you maybe generate styled text from that? A table of bold keys and plain text values? I think QuickLook does RTF automatically, doesn’t it?

  2. 2 Timac said at 11:16 am on April 1st, 2014:

    I could but I decided not to do it. The reason is that I want to see a preview of the raw (unmodified) file.
    Also note that most of the time the .strings files won’t contain XML. Only Apple seems to use the not recommended binary property-list format (see the note in the String Resources Documentation) for .strings files.

    Unless you look at Apple .strings files, you shouldn’t see XML.


Leave a Reply