feat(CLI): Support locale_mapping on pull #SCD-863#1080
Conversation
There was a problem hiding this comment.
Looks pretty solid to me for pulling.
- load config is adjusted & its config struct
- pull target applies the mapping
- spec covers the new behaviour (and even more, thanks for that)
This part seems complete. Do you plan to seperate push in a different PR or should I wait for push target adjustments for another review?
Yeah, push behaviour is a bit confusing even now, so I'd open a new PR and potentially discuss it first with the team. |
There was a problem hiding this comment.
Pull request overview
Adds support for an optional locale_mapping section in the Phrase config and applies it during phrase pull filename placeholder replacement, so remote locale names can be mapped to locally preferred locale identifiers.
Changes:
- Parse
locale_mappingfrom.phrase.ymlinto the Go config model. - Apply locale mapping when resolving
<locale_name>in pull target file patterns. - Add CLI integration coverage for
pull(including locale mapping) and expand Go CI test scope.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| clients/go/testdata/config_files/.phrase.yml | Adds locale_mapping to Go config fixture. |
| clients/go/config.go | Extends config parsing to include LocaleMapping. |
| clients/go/config_test.go | Asserts LocaleMapping parsing from fixture. |
| clients/cli/cmd/internal/pull_target.go | Passes config mapping into pull targets and applies it for <locale_name>. |
| clients/cli/cmd/internal/init.go | Allows emitting locale_mapping in generated config YAML (omitempty). |
| clients/cli/spec/pull_spec.rb | Adds integration specs for pull, including locale mapping behavior. |
| .github/workflows/test-go.yml | Runs go test ./... for the generated Go client. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Support optional
locale_mappingsection in the config to be able to use locale names locally different from the names in Phrase Strings, as some platforms have specific naming standards. Onpull, the files will be named appropriately then by mapping Strings locale names to local locale names.https://phrase.atlassian.net/browse/SCD-863