Generate a file called Localized.json from the source code containing all the keys of localized strings. Generate Localized.strings and Localized.stringsdict from Localized.json.
pod 'LocalizedJSON'Add the following Run Script for generating Localized.json for English and French localization.
${PODS_ROOT}/LocalizableJSON/GenStringsJSON en fr --path ${SRCROOT}/Your-project-dir
Add the following Run Script for generating Localized.strings and Localized.stringsdict by Localized.json.
${PODS_ROOT}/LocalizableJSON/JSONToStrings --path ${SRCROOT}/Your-project-dir
Localized.json generated from the source code, based on localization related functions. Check the following source code to unerstand it.
// When using standard localization method
// GenStringsJSON will generate an entry for "travelCard.blockingAlert.title"
NSLocalizedString("travelCard.blockingAlert.title", comment: "")// When using Localize-Swift for localization
// GenStringsJSON will generate an entry for "travelCard.blockingAlert.title"
title = "travelCard.blockingAlert.title".localized()
// GenStringsJSON will generate an entry for "travelCard.acceptTerms.text"
let text = "travelCard.acceptTerms.text".localizedFormat(customerName)
// GenStringsJSON will generate an entry for "boxStorage.hint.title"
let text = "boxStorage.hint.title".localizedPlural(numberOfBoxes)Root directory of your project.
Remove unused keys from Localizable.json during generation.
An array of generating locale codes separated with spaces. This switch is optional.
Root directory of your project.