Skip to content

Lb/feature flag with new language picker#3289

Merged
lilybarrett merged 5 commits into
mainfrom
lb/feature-flag-with-new-language-picker
Jun 29, 2026
Merged

Lb/feature flag with new language picker#3289
lilybarrett merged 5 commits into
mainfrom
lb/feature-flag-with-new-language-picker

Conversation

@lilybarrett

@lilybarrett lilybarrett commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Scope

The current Languages picker is a styled skin for the Google Translate plugin. This PR provides an initial iteration (with styling/UX subject to future change once designs are confirmed) of a new language picker set behind the feature flag for Smartling translations.

We have a .po file for Spanish in the DotCom repo, which I believe is why we're getting the Spanish translations when I select them. The other languages besides English & Spanish don't work yet since we don't have the Smartling translations/files for them in the repo yet.

Coming in future PRs:

  • Refined/confirmed designs and UX

Asana Ticket:
https://app.asana.com/1/15492006741476/project/1213994587940653/task/1214847351822159?focus=true

How to test

  • Run the app
  • Navigate to /_flags and enable the Smartling translations flag
  • Select Spanish from the languages menu in either the header or footer -- the website should be translated to Spanish.
  • Other languages are also selectable from the menu, but the website content won't change since we don't yet have .po files for them.
Screen.recording.of.languages.menu.6-25.mov

@lilybarrett lilybarrett requested a review from a team as a code owner June 25, 2026 17:16
@lilybarrett lilybarrett requested a review from jlucytan June 25, 2026 17:16
@lilybarrett lilybarrett marked this pull request as draft June 25, 2026 17:16
Comment thread lib/dotcom_web/templates/layout/_footer.html.heex
@lilybarrett lilybarrett force-pushed the lb/feature-flag-with-new-language-picker branch from aab068c to 406d9cf Compare June 25, 2026 17:19
@lilybarrett lilybarrett requested a review from thecristen June 25, 2026 18:53
@lilybarrett lilybarrett marked this pull request as ready for review June 26, 2026 18:35
Lily Barrett added 5 commits June 26, 2026 14:35
…ratory flag

WIP

Play around with locale testing

Some tweaks

WIP barebones language picker for Smartling

WIP ne Languages picker on feature flag
@lilybarrett lilybarrett force-pushed the lb/feature-flag-with-new-language-picker branch from 033afdc to d7d64ee Compare June 26, 2026 18:35
@lilybarrett lilybarrett requested a review from arkadyan June 26, 2026 18:36

@lvachon1 lvachon1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This works great, I'm excited to see this whole translation project get properly underway here on MBTA.com

@lilybarrett lilybarrett merged commit 61946b3 into main Jun 29, 2026
24 checks passed
@lilybarrett lilybarrett deleted the lb/feature-flag-with-new-language-picker branch June 29, 2026 18:59

@joshlarson joshlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see that @lvachon1 approved (thank you Luc!). I was snooping a bit, and had a few non-blocking questions and thoughts, which I may as well still leave here.

Some of them may need to be addressed before this becomes fully productionalized, but I don't think any of them need to block further development on this feature (and possibly some or all of the issues/questions are really more core-dotcom responsibilities anyway, and don't need to take up your time! 😅)


Thanks for this work!

<% end %>
<div class="body-wrapper" id="body-wrapper">
<%= if !Application.get_env(:dotcom, :is_prod_env?) do %>
<%= if !Application.get_env(:dotcom, :is_prod_env?) && !Laboratory.enabled?(@conn, :use_smartling_translations) do %>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question/Request (non-blocking): Would it be possible to keep that banner at the top when Smartling is enabled? Or was the wacky "menu location is actually hard-coded, and gets messed up by the banner" issue too annoying?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can bring it back in the next iteration!

</nav>
</div>
<div class="container">
<div class="container m-footer-links">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Issue (non-blocking): I'm not sure if it's m-footer-links or some other CSS thing (or just something fiddly in the new DOM), but there's a funky line-wrap in the footer icons at browser widths from 1088 to 1343 px.

Image

(FWIW, the line-wrapping behavior is already wrong and weird in prod - it's just that the language stuff in the footer is making that always happen at certain common breakpoints, whereas in prod, it only happens at very narrow screen widths)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for this callout! This may change completely based on designs, but I'll make a note.

Comment thread lib/dotcom/locales.ex

@development_additional_locales [
@default_locale,
@development_locale,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question (non-blocking): Is @development_locale still special, or would it make sense to lump all of the locales together (probably still keeping @default_locale separate)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, good question. I kept @development_locale intact so functionality could remain unchanged when the feature flag was turned on, but we could def merge these down the road.

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