Skip to content

feat(CLI): Support locale_mapping on pull #SCD-863#1080

Open
jablan wants to merge 5 commits intomainfrom
scd-863-add-language-mapping-cli
Open

feat(CLI): Support locale_mapping on pull #SCD-863#1080
jablan wants to merge 5 commits intomainfrom
scd-863-add-language-mapping-cli

Conversation

@jablan
Copy link
Copy Markdown
Collaborator

@jablan jablan commented Mar 31, 2026

Support optional locale_mapping section 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. On pull, the files will be named appropriately then by mapping Strings locale names to local locale names.

https://phrase.atlassian.net/browse/SCD-863

Copy link
Copy Markdown
Member

@forelabs Sven Dunemann (forelabs) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@jablan
Copy link
Copy Markdown
Collaborator Author

jablan commented Apr 1, 2026

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.

@jablan jablan marked this pull request as ready for review April 1, 2026 06:56
@jablan jablan requested a review from Copilot April 1, 2026 07:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mapping from .phrase.yml into 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants