Skip to content

Add Firefox-inspired Fluent localization foundations - #6

Merged
Tom-R-Main merged 10 commits into
mainfrom
codex/firefox-i18n-foundation
Sep 4, 2026
Merged

Tom-R-Main merged 10 commits into
mainfrom
codex/firefox-i18n-foundation

Conversation

@Tom-R-Main

@Tom-R-Main Tom-R-Main commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • separate translation provenance from explicit human approval in manifest schema v2
  • add deterministic accented and bidirectional pseudolocales with safe overwrite rules
  • validate named localization markup as movable semantic slots
  • add lossless Fluent resource support for messages, terms, attributes, comments, selectors, and translator context
  • preserve refreshable Markdown pseudolocales alongside stable H2 unit identities from current main
  • prepare npm package version 0.1.2 for the post-merge CLI release
  • document and acceptance-test the complete review and pseudolocale workflow

Verification

  • go build ./...
  • go test ./... -race -covermode=atomic -coverprofile=coverage.out
  • coverage 75.1% against the 60.0% gate
  • go vet ./...
  • golangci-lint run
  • go test ./test/acceptance -count=1
  • npm wrapper, version, and pack checks
  • lossless parse/serialize and pseudolocalization checks across the Firefox non-test FTL corpus

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T02:42:27.142653Z a5d14b1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5d14b1b62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/pseudo/transform.go Outdated
Comment on lines +152 to +154
func transformText(input string, strategy Strategy) string {
if strategy == Bidi {
return reverseRunes(mapRunes(input, bidiRune))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve Fluent layout while reversing bidi text

When pseudo --strategy bidi processes a Fluent selector branch without an intervening protected token, the string passed here includes the newline and indentation before the next variant header. Reversing the entire segment moves that newline before the branch text and leaves the following *[other] header concatenated onto the text line; Generate then serializes the value without reparsing the result and writes an invalid .ftl artifact. Reverse only linguistic runs, not Fluent layout whitespace.

Useful? React with 👍 / 👎.

Comment on lines +252 to +255
parent, equals, ok := parseFluentMessageHeader(lines[index].content)
if !ok {
index++
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject unrecognized Fluent source lines

Any top-level line that is neither a recognized message header nor diagnosed elsewhere is silently skipped here. Consequently, malformed Fluent such as bad id = Save is accepted with that source unit omitted; translation and validation can report success and preserve the junk in generated files instead of identifying an invalid resource. Blank lines and comment forms should be skipped explicitly, while other unrecognized lines should produce a parse error.

Useful? React with 👍 / 👎.

Comment thread internal/pseudo/generate.go Outdated
Comment on lines +83 to +88
targetPath, err := bundle.TargetPath(locale)
if err != nil {
return nil, err
}
if existing, readErr := os.ReadFile(targetPath); readErr == nil {
if !opts.Force && !pseudoOwnsArtifact(manifest, bundle.ID, canonicalLocale, format, existing) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent pseudolocales from targeting the source file

Because the pseudo locale is arbitrary and is not rechecked against bundle source paths, a typical template such as locales/{locale}.json resolves pseudo --locale en --force to the locales/en.json source itself. The subsequent atomic write replaces the source catalog with pseudolocalized text and records it as pseudo provenance; ValidateProject does not catch this because it only checks configured target locales. Reject a resolved pseudo target equal to the bundle source even when --force is supplied.

Useful? React with 👍 / 👎.

…undation

# Conflicts:
#	README.md
#	docs/localization-core-v2.md
#	internal/state/manifest.go
#	internal/translate/translate.go
#	internal/translate/translate_test.go
#	internal/validate/protected.go
#	internal/validate/validate.go
@Tom-R-Main
Tom-R-Main merged commit e51c9d3 into main Sep 4, 2026
8 checks passed
@Tom-R-Main
Tom-R-Main deleted the codex/firefox-i18n-foundation branch September 4, 2026 18:22
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.

1 participant