For the complete documentation index, see llms.txt. This page is also available as Markdown.

Localization

The Tools.framework ships with its user-facing strings written in English. This guide explains how you can localize the framework for any language.

Tools localization

Info

This section describes the localization process only if you have integrated the framework using CocoaPods or by embedding the framework binary into your project.

If you are compiling the Tools framework from source (not recommended), follow these instructions to perform localization.

To localize the Tools.framework user-facing strings, all you need to do is add a strings file to the main bundle of your app.

To add a strings file in Xcode, go to File -> New… -> File in the menu bar. From the file templates window, choose Strings File from the Resource section and click Next. This new file must be named PTLocalizable.strings in order for the Tools framework to correctly identify the appropriate file to use for localization.

Localizing your app

Localization can be added to your app by following these steps:

  1. Select your project from the Project navigator.

  2. Select your project from the dropdown or list of projects and targets.

  3. Add a new localization by clicking on the plus sign below 'Localizations'.

Once your app is configured for localization, clicking 'Localize…' in Xcode's file inspector for PTLocalizable.strings will allow you to localize the file.

Localizable strings

To see which strings in the Tools framework can be localized, see the included Localizable.strings reference files. The location of these files depends on how the framework was integrated into your app:

Integration
Path
Location

Pods/PDFNet/Resources/Tools-Localization/<language-code>.lproj

Xcode

Lib/Tools/src/PDFViewCtrlTools/Tools/<language-code>.lproj

Downloaded package

These files contain the key-value pairs which are used to define the user-facing strings in Tools and are for reference only — modifying them has no effect. You can add any of the keys to your PTLocalizable.strings file and define a custom value to display to the user.

Localization when compiling Tools from source (deprecated)

If you are manually compiling the Tools.framework from source, localization can be performed by following these steps:

  1. Select the Tools project from the Project navigator.

  2. Select the Tools project from the dropdown or list of projects and targets.

  3. Add a new localization by clicking on the plus sign below 'Localizations'.

  1. Check the box next to the file for the new localization (the Localizable.strings file) and click 'Finish'.

A new Localizable.strings file will be created in /Lib/Tools/src/PDFViewCtrlTools/Tools/<language-code>.lproj with the contents of the reference language (English by default). You can then enter a translation on the right-hand side of each entry in the .strings file.

Last updated

Was this helpful?