Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update donation year to 2025 in banner #11259

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

github-throwaway
Copy link
Contributor

This also updates the year in the banner.

Related issue(s) and discussion

@github-throwaway
Copy link
Contributor Author

github-throwaway commented Jan 17, 2025

The amount of files that need to be touched to update the year seems somewhat crazy to me... 🙈 Maybe there is a way to fill it in automatically?

Are there different tests on the server? I have no idea why the tests failed.

Failed test 'get-auth-bad-user-password'
2025-01-17T19:43:05.8318511Z (  DIAG  )  job  4      at /opt/product-opener/lib/ProductOpener/Test.pm line 454.
2025-01-17T19:43:05.8522338Z (  DIAG  )  job  4    --- tests/integration//expected_test_results/api_v2_product_read/get-auth-bad-user-password.html	Fri Jan 17 19:27:17 2025
2025-01-17T19:43:05.8527100Z (  DIAG  )  job  4    +++ tests/integration//expected_test_results/api_v2_product_read/get-auth-bad-user-password.html.test	Fri Jan 17 19:43:05 2025

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.33%. Comparing base (9141b72) to head (2e93ea2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11259   +/-   ##
=======================================
  Coverage   49.33%   49.33%           
=======================================
  Files          79       79           
  Lines       22510    22510           
  Branches     5387     5387           
=======================================
  Hits        11105    11105           
  Misses      10045    10045           
  Partials     1360     1360           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stephanegigandet
Copy link
Contributor

The amount of files that need to be touched to update the year seems somewhat crazy to me... 🙈 Maybe there is a way to fill it in automatically?

In practice the only string that needs to change is this one:

msgctxt "donation_title_2024"
msgid "Please give to our 2024 Fundraiser"
msgstr ""

In practice we do not need to change the msgctxt, it's just an id, it's not displayed.

Usually, we only update common.pot and en.po, and the other translations come from crowdin.

But yes, definitely, we should make the year a variable. Usually we define variables like this:

# variable names between { } must not be translated
msgctxt "f_pro_moderator_owner_set"
msgid "You are currently viewing products from {organization}."
msgstr "You are currently viewing products from {organization}."

But it was not used in this string, it should definitely be changed. That way when we need to change the year, we only change it at one place, in the template, when we call the string.

@stephanegigandet
Copy link
Contributor

The amount of files that need to be touched to update the year seems somewhat crazy to me... 🙈 Maybe there is a way to fill it in automatically?

Are there different tests on the server? I have no idea why the tests failed.

Failed test 'get-auth-bad-user-password'
2025-01-17T19:43:05.8318511Z (  DIAG  )  job  4      at /opt/product-opener/lib/ProductOpener/Test.pm line 454.
2025-01-17T19:43:05.8522338Z (  DIAG  )  job  4    --- tests/integration//expected_test_results/api_v2_product_read/get-auth-bad-user-password.html	Fri Jan 17 19:27:17 2025
2025-01-17T19:43:05.8527100Z (  DIAG  )  job  4    +++ tests/integration//expected_test_results/api_v2_product_read/get-auth-bad-user-password.html.test	Fri Jan 17 19:43:05 2025

In the test output, you can search for "fail" to see the details:

(  DIAG  )  job  4       <div class="donation-banner__left-aside">
(  DIAG  )  job  4         <div class="donation-banner__hook-section">
(  DIAG  )  job  4    -      <p>Help us inform millions of consumers around the world about what they eat</p>
(  DIAG  )  job  4    +      <p></p>
(  DIAG  )  job  4         </div>
(  DIAG  )  job  4    -    <img src="/images/misc/donation-banners/donation-banner-group-photo.png" alt="group photo donation 2025" />
(  DIAG  )  job  4    +    <img src="/images/misc/donation-banners/donation-banner-group-photo.png" alt="group photo donation 2024" />
(  DIAG  )  job  4       </div>

@github-throwaway
Copy link
Contributor Author

@stephanegigandet where do you usually define these variables? lib/ProductOpener/Config_off.pm? I'm somewhat unsure of the process here..

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

Successfully merging this pull request may close these issues.

Update fundraiser text to 2025
3 participants