zerver: Replace occurrences of uri with url in other templates.

This commit replaces occurrences of realm_uri with realm_url in
"context_processors.py" and related templates.

With by-hand translation updates for German (also updated in
Transifex) to avoid breaking the i18n system tests that use some
modified strings.

Co-authored-by: Junyao Chen <junyao.chen@socitydao.org>
This commit is contained in:
Vector73 2024-05-09 16:58:48 +05:30 committed by Tim Abbott
parent 93262e03ad
commit fef31614d3
7 changed files with 14 additions and 15 deletions

View File

@ -25,7 +25,7 @@ page can be easily identified in it's respective JavaScript file -->
<img class="avatar" src="{{ realm_icon }}" alt="" />
<div class="info-box">
<div class="organization-name">{{ realm_name }}</div>
<div class="organization-path">{{ realm_uri }}</div>
<div class="organization-path">{{ realm_url }}</div>
</div>
</div>
<div class="description">

View File

@ -21,13 +21,13 @@
{{ _("The email address you are trying to sign up with is not valid.") }}
{% endif %}
{% if closed_domain %}
{% trans %}The organization you are trying to join, <a href="{{ realm_uri }}">{{ realm_name }}</a>, does not allow signups using emails with your email domain.{% endtrans %}
{% trans %}The organization you are trying to join, <a href="{{ realm_url }}">{{ realm_name }}</a>, does not allow signups using emails with your email domain.{% endtrans %}
{% endif %}
{% if disposable_emails_not_allowed %}
{% trans %}The organization you are trying to join, <a href="{{ realm_uri }}">{{ realm_name }}</a>, does not allow signups using disposable email addresses.{% endtrans %}
{% trans %}The organization you are trying to join, <a href="{{ realm_url }}">{{ realm_name }}</a>, does not allow signups using disposable email addresses.{% endtrans %}
{% endif %}
{% if email_contains_plus %}
{% trans %}The organization you are trying to join, <a href="{{ realm_uri }}">{{ realm_name }}</a>, does not allow signups using emails that contain "+".{% endtrans %}
{% trans %}The organization you are trying to join, <a href="{{ realm_url }}">{{ realm_name }}</a>, does not allow signups using emails that contain "+".{% endtrans %}
{% endif %}
{% if invalid_email %}
{{ _("Please sign up using a valid email address.") }}

View File

@ -25,7 +25,7 @@ page can be easily identified in it's respective JavaScript file. -->
<img class="avatar" src="{{ realm_icon }}" alt="" />
<div class="info-box">
<div class="organization-name">{{ realm_name }}</div>
<div class="organization-path">{{ realm_uri }}</div>
<div class="organization-path">{{ realm_url }}</div>
</div>
</div>
<div class="description">

View File

@ -13,7 +13,7 @@
</div>
<div class="white-box">
<p>
{% trans %}New members cannot currently join <a href="{{ realm_uri }}">{{ realm_name }}</a> because all Zulip Cloud licenses are in use.{% endtrans %}
{% trans %}New members cannot currently join <a href="{{ realm_url }}">{{ realm_name }}</a> because all Zulip Cloud licenses are in use.{% endtrans %}
</p>
<p>
{{ _("Please contact the person who invited you and ask them to increase the number of licenses, then try again.") }}

View File

@ -73,7 +73,7 @@ Form is validated both client-side using jquery-validation (see signup.js) and s
<img class="avatar inline-block" src="{{ realm_icon }}" alt="" />
<div class="info-box inline-block">
<div class="organization-name">{{ realm_name }}</div>
<div class="organization-path">{{ realm_uri }}</div>
<div class="organization-path">{{ realm_url }}</div>
</div>
{% endif %}

View File

@ -18,7 +18,7 @@
<p>
{% trans %}
You've successfully unsubscribed from Zulip {{ subscription_type }} emails for
<a href="{{ realm_uri }}">{{ realm_name }}</a>.
<a href="{{ realm_url }}">{{ realm_name }}</a>.
{% endtrans %}
</p>
@ -26,7 +26,7 @@
<p>
{% trans %}
You can undo this change or review your preferences in your
<a href="{{ realm_uri }}/#settings/notifications">notification settings</a>.
<a href="{{ realm_url }}/#settings/notifications">notification settings</a>.
{% endtrans %}
</p>
{% endif %}

View File

@ -118,11 +118,11 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
realm = get_realm_from_request(request)
if realm is None:
realm_uri = settings.ROOT_DOMAIN_URI
realm_url = settings.ROOT_DOMAIN_URI
realm_name = None
realm_icon = None
else:
realm_uri = realm.url
realm_url = realm.url
realm_name = realm.name
realm_icon = get_realm_icon_url(realm)
@ -190,8 +190,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
"only_sso": settings.ONLY_SSO,
"external_host": settings.EXTERNAL_HOST,
"external_url_scheme": settings.EXTERNAL_URI_SCHEME,
"realm_uri": realm_uri,
"realm_url": realm_uri,
"realm_url": realm_url,
"realm_name": realm_name,
"realm_icon": realm_icon,
"root_domain_url": settings.ROOT_DOMAIN_URI,
@ -218,9 +217,9 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
"corporate_enabled": corporate_enabled,
}
context["PAGE_METADATA_URL"] = f"{realm_uri}{request.path}"
context["PAGE_METADATA_URL"] = f"{realm_url}{request.path}"
if realm is not None and realm.icon_source == realm.ICON_UPLOADED:
context["PAGE_METADATA_IMAGE"] = urljoin(realm_uri, realm_icon)
context["PAGE_METADATA_IMAGE"] = urljoin(realm_url, realm_icon)
return context