localizationlinter

Verify consistency over your project localizable files (localizable.strings and Localizable.stringdict) It uses Swiftgen to generate a localizables output per target and language and compare the output with a reference language one. The comparison ensure:

  • missing keys
  • additional keys
  • wrong parameters in string format
Verify my project localizables consistency
localizationlinter.lint

Attributes

clean_after_execution - Keep or clean derived data after execution

inline_mode - Print inline or as markdown

verbose - Print execution logs

language_configuration_path - Path to language configuration yml, defining main language per target example:

My_target: en
My_other_target: fr

Default value is Configuration/Defaults/all_target_main_language.yml If no file is provided, the default language for each target is en

swift_gen_path - Path to swift gen, default value is Pods/SwiftGen/bin/swiftgen

derived_data_path - Path to derived data, default value is localization_linter_derived_data

resource_path - Path to derived data, default value is Resources

project_path - Path to xcode project, default is taking the first project in root folder

Methods

lint - Verify the localizable files integrity over the project rubocop:disable Metrics/MethodLength

linter - Returns the object in charge of verification

Installation

 $ gem install danger-localizationlinter

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.

To update swiftgen bin, use Test project in spec:

  1. cd spec/Test
  2. Open Podfile and update SwiftGen version
  3. pod update SwiftGen