b123400 / xliffie

A localization assistance for iOS / Mac app.
https://itunes.apple.com/us/app/xliffie/id961651406
GNU General Public License v3.0
65 stars 16 forks source link

Xliffie adds an incorrect, empty type association for .xcloc and .xliff, causing other apps to fail to recognize the file types #7

Closed bobergj closed 4 years ago

bobergj commented 4 years ago

The info plist specifies empty type identifiers for the .xcloc and .xliff file types, causing the UTI for those types to become a dynamic one when the app is installed.

xliffie-info-documents-screenshot

Below is an example of correct info plist entries (this is from our app). Note the LSItemContentTypes and UTImportedTypeDeclarations. Without UTImportedTypeDeclarations, you re-declare the UTIs as your own.

    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeExtensions</key>
            <array>
                <string>xliff</string>
            </array>
            <key>CFBundleTypeMIMETypes</key>
            <array/>
            <key>CFBundleTypeName</key>
            <string>XLIFF</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Default</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>org.oasis-open.xliff</string>
            </array>
            <key>LSTypeIsPackage</key>
            <integer>0</integer>
            <key>NSDocumentClass</key>
            <string>$(PRODUCT_MODULE_NAME).DocumentClassNameHere</string>
        </dict>
                <dict>
            <key>CFBundleTypeExtensions</key>
            <array>
                <string>xcloc</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>Xcode Localization Catalog</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Default</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.apple.xcode.xcloc</string>
            </array>
            <key>LSTypeIsPackage</key>
            <integer>0</integer>
            <key>NSDocumentClass</key>
            <string>$(PRODUCT_MODULE_NAME).DocumentClassNameHere</string>
        </dict>
    </array>
    <key>UTImportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.xml</string>
            </array>
            <key>UTTypeDescription</key>
            <string>XML Localization Interchange File Format</string>
            <key>UTTypeIdentifier</key>
            <string>org.oasis-open.xliff</string>
            <key>UTTypeReferenceURL</key>
            <string>http://docs.oasis-open.org/xliff/xliff-core/xliff-core.html</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>xliff</string>
                </array>
            </dict>
        </dict>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.directory</string>
            </array>
            <key>UTTypeDescription</key>
            <string>Xcode Localization Catalog</string>
            <key>UTTypeIdentifier</key>
            <string>com.apple.xcode.xcloc</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>xcloc</string>
                </array>
            </dict>
        </dict>
    </array>