Skip to content

Commit

Permalink
feat: fix department ui translation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalton-Tyndall committed Apr 25, 2024
1 parent 9562b41 commit 924b31b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions web/themes/custom/sfgovpl/includes/views.inc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ function sfgovpl_preprocess_views_view__events__page_2(&$variables) {
*/
function sfgovpl_preprocess_views_view__events__block_1(&$variables) {
$variables['empty']['display_link']['#options']['attributes']['class'][] = 'btn';
$variables['more']['#title'] = t('See more events', [], ['context' => 'Events Block - Dept']);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if items is not empty %}
<p class="text-white text-title-xs font-medium m-0 mb-24">{{ label }}</p>
<p class="text-white text-title-xs font-medium m-0 mb-24">{{ label|t }}</p>
<ul class="list-none p-0 m-0 mb-60">
{% for item in items %}
{% set facebook = item.content['#paragraph'].get('field_facebook').getValue()[0].uri %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,13 @@
{% set has_events = drupal_view_result('events', 'block_1', node.id) %}
{% set has_past_events = drupal_view_result('events', 'page_6', node.id) %}
{% set event_heading = 'Events'|t({}, {'context' : 'Agency event section heading'}) %}
{% set no_result = 'There are no upcoming events right now.'|t({}, {'context' : 'Agency event no result'}) %}
{% if has_events is empty and has_past_events is empty%}
{% elseif has_events is empty and has_past_events is not empty%}
<div class="odd:bg-grey-1 py-40 lg:py-60">
<div class="responsive-container">
<h2 class="text-title-xl m-0 mb-40 lg:text-title-xl-desktop">{{ event_heading }}</h2>
<p>There are no upcoming events right now.</p>
<p>{{ no_result }}</p>
<br>
{{ events_view }}
</div>
Expand Down Expand Up @@ -298,7 +299,7 @@
{# related agencies #}
{% if content.field_departments|render|striptags|trim %}
<div>
<p class="text-title-xs font-medium m-0 mb-24">{{ content.field_departments['#title'] }}</p>
<p class="text-title-xs font-medium m-0 mb-24">{{ content.field_departments['#title']|t }}</p>
<ul class="responsive-grid gap-y-20 list-none p-0 m-0 grid-cols-1 lg:grid-cols-2">
{% for key, item in content.field_departments %}
{% if key|first != '#' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="view-events-block">
{% block title %}
{% if view.getTitle() %}
<h2 class="text-title-xl m-0 mb-40 lg:text-title-xl-desktop">{{ view.getTitle() }}</h2>
<h2 class="text-title-xl m-0 mb-40 lg:text-title-xl-desktop">{{ view.getTitle()|t }}</h2>
{% endif %}
{% endblock title %}

Expand Down

1 comment on commit 924b31b

@aekong
Copy link
Collaborator

@aekong aekong commented on 924b31b Apr 25, 2024

Choose a reason for hiding this comment

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

Visit Site

Created multidev environment pr-1672 for sfgov.

Please sign in to comment.