Skip to content

Commit

Permalink
fix(i18n): put back escaped percent sign in string, compute value
Browse files Browse the repository at this point in the history
this makes it so the template gets the computed value, and
`makemessages` and `compilemessages` get the literal value.
  • Loading branch information
angela-tran committed Feb 28, 2025
1 parent a6e053c commit b5ed1ce
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
21 changes: 15 additions & 6 deletions benefits/core/context/agency.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,41 @@ def dict(self):
eligibility_index = {
AgencySlug.CST.value: EligibilityIndex(
form_text=_(
"Cal-ITP doesn’t save any of your information. All CST transit benefits reduce fares by 50% for bus service on fixed routes." # noqa
"Cal-ITP doesn’t save any of your information. "
"All CST transit benefits reduce fares by 50%% for bus service on fixed routes.".replace("%%", "%")
)
),
AgencySlug.MST.value: EligibilityIndex(
form_text=_(
"Cal-ITP doesn’t save any of your information. All MST transit benefits reduce fares by 50% for bus service on fixed routes." # noqa
"Cal-ITP doesn’t save any of your information. "
"All MST transit benefits reduce fares by 50%% for bus service on fixed routes.".replace("%%", "%")
)
),
AgencySlug.NEVCO.value: EligibilityIndex(
form_text=_(
"Cal-ITP doesn’t save any of your information. All Nevada County Connects transit benefits reduce fares by 50% for bus service on fixed routes." # noqa
"Cal-ITP doesn’t save any of your information. "
"All Nevada County Connects transit benefits reduce fares by 50%% for bus service on fixed routes.".replace(
"%%", "%"
)
)
),
AgencySlug.SACRT.value: EligibilityIndex(
form_text=[
_(
"Cal-ITP doesn’t save any of your information. All SacRT transit benefits reduce fares by 50% for bus service on fixed routes." # noqa
"Cal-ITP doesn’t save any of your information. "
"All SacRT transit benefits reduce fares by 50%% for bus service on fixed routes.".replace("%%", "%") # noqa
),
_(
"With the new Tap2Ride fare system launching in 2025, SacRT riders that are eligible for discount fares can enroll below. The discount benefit will be available on all SacRT buses beginning in early 2025 and will include light rail tap devices later in the year." # noqa
"With the new Tap2Ride fare system launching in 2025, SacRT riders that are eligible for discount fares can "
"enroll below. The discount benefit will be available on all SacRT buses beginning in early 2025 and will "
"include light rail tap devices later in the year." # noqa
),
]
),
AgencySlug.SBMTD.value: EligibilityIndex(
form_text=_(
"Cal-ITP doesn’t save any of your information. All SBMTD transit benefits reduce fares by 50% for bus service on fixed routes." # noqa
"Cal-ITP doesn’t save any of your information. "
"All SBMTD transit benefits reduce fares by 50%% for bus service on fixed routes.".replace("%%", "%")
)
),
}
17 changes: 11 additions & 6 deletions benefits/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n"
"POT-Creation-Date: 2025-02-26 18:43-0800\n"
"POT-Creation-Date: 2025-02-26 20:37-0800\n"
"Language: English\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -30,24 +30,28 @@ msgstr ""
msgid "Get a reduced fare on Santa Barbara MTD buses when you tap to ride"
msgstr ""

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All CST transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All MST transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All Nevada County Connects "
"transit benefits reduce fares by 50% for bus service on fixed routes."
"transit benefits reduce fares by 50%% for bus service on fixed routes."
msgstr ""

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All SacRT transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""

msgid ""
Expand All @@ -57,9 +61,10 @@ msgid ""
"rail tap devices later in the year."
msgstr ""

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All SBMTD transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""

msgid ""
Expand Down
25 changes: 15 additions & 10 deletions benefits/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n"
"POT-Creation-Date: 2025-02-26 18:43-0800\n"
"POT-Creation-Date: 2025-02-26 20:37-0800\n"
"Language: Español\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -40,33 +40,37 @@ msgstr ""
"Obtenga una tarifa reducida en los autobuses del Santa Barbara MTD cuando "
"toque para viajar"

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All CST transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""
"Cal-ITP no almacena su información. Todos los beneficios de tránsito de CST "
"reducen las tarifas de autobuses en un 50%."
"reducen las tarifas de autobuses en un 50%%."

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All MST transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""
"Cal-ITP no almacena su información. Todos los beneficios de tránsito de MST "
"reducen las tarifas de autobuses en un 50%."
"reducen las tarifas de autobuses en un 50%%."

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All Nevada County Connects "
"transit benefits reduce fares by 50% for bus service on fixed routes."
"transit benefits reduce fares by 50%% for bus service on fixed routes."
msgstr ""
"Cal-ITP no almacena su información. Todos los beneficios de tránsito de "
"Nevada County Connects reducen las tarifas de autobuses en un 50%."
"Nevada County Connects reducen las tarifas de autobuses en un 50%%."

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All SacRT transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""
"Cal-ITP no almacena su información. Todos los beneficios de tránsito de "
"SacRT reducen las tarifas en un 50% para el servicio de autobús en rutas "
"SacRT reducen las tarifas en un 50%% para el servicio de autobús en rutas "
"fijas."

msgid ""
Expand All @@ -81,9 +85,10 @@ msgstr ""
"todos los autobuses de SacRT a partir de principios de 2025 e incluirá "
"lectores de tarjeta en el tren ligero más adelante en el año."

#, python-format
msgid ""
"Cal-ITP doesn’t save any of your information. All SBMTD transit benefits "
"reduce fares by 50% for bus service on fixed routes."
"reduce fares by 50%% for bus service on fixed routes."
msgstr ""
"Cal-ITP no almacena su información. Todos los beneficios de tránsito de "
"SBMTD le ofrecen a los pasajeros tarifas de autobús reducidas."
Expand Down

0 comments on commit b5ed1ce

Please sign in to comment.