Skip to content

Commit

Permalink
Add parameter to cli to disable striping of translated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-pod committed Oct 18, 2023
1 parent 7cf9f36 commit f368b81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- new option `--skip-value-stripping` that disable the leading and trailing whitespaces removal on wording values. The value stripping was introduced with version 6.0.0.

## 6.1.0
### Added

Expand Down
1 change: 1 addition & 0 deletions lib/ad_localize/mappers/options_to_export_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def map(options:)
request.locales = options[:locales]
request.bypass_empty_values = options[:'non-empty-values']
request.auto_escape_percent = options[:'auto-escape-percent']
request.skip_value_stripping = options[:'skip-value-stripping']
request.csv_paths = options[:csv_paths]
request.merge_policy = options[:'merge-policy']
request.output_path = options[:'target-dir']
Expand Down
2 changes: 2 additions & 0 deletions lib/ad_localize/option_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class OptionHandler
locales: Requests::ExportRequest::DEFAULTS[:locales],
:'non-empty-values' => Requests::ExportRequest::DEFAULTS[:bypass_empty_values],
:'auto-escape-percent' => Requests::ExportRequest::DEFAULTS[:auto_escape_percent],
:'skip-value-stripping' => Requests::ExportRequest::DEFAULTS[:skip_value_stripping],
csv_paths: Requests::ExportRequest::DEFAULTS[:csv_paths],
:'merge-policy' => Requests::ExportRequest::DEFAULTS[:merge_policy],
:'target-dir' => Requests::ExportRequest::DEFAULTS[:output_path],
Expand Down Expand Up @@ -39,6 +40,7 @@ def self.parse!(options)
end
parser.on("-x", "--non-empty-values", TrueClass, 'Do not export keys with empty values (iOS only)')
parser.on("--auto-escape-percent", TrueClass, 'Add escaping for % symbol to support wording use with String formatting (iOS only)')
parser.on("--skip-value-stripping", TrueClass, 'Disable the removal of leading and trailing whitespaces on wording values')
end.parse!(options, into: args)

args[:csv_paths] = options
Expand Down

0 comments on commit f368b81

Please sign in to comment.