docs: Add missing space in “time zone”.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-02-24 12:15:43 -08:00 committed by Tim Abbott
parent 47056ef06f
commit 21cd1c10b3
33 changed files with 66 additions and 64 deletions

View File

@ -168,7 +168,7 @@ def do_update_fill_state(fill_state: FillState, end_time: datetime, state: int)
# We assume end_time is valid (e.g. is on a day or hour boundary as appropriate)
# and is timezone aware. It is the caller's responsibility to enforce this!
# and is time-zone-aware. It is the caller's responsibility to enforce this!
def do_fill_count_stat_at_hour(
stat: CountStat, end_time: datetime, realm: Optional[Realm] = None
) -> None:

View File

@ -8,7 +8,7 @@ from django.utils.timezone import now as timezone_now
from analytics.lib.counts import COUNT_STATS, CountStat
from analytics.models import installation_epoch
from zerver.lib.timestamp import TimezoneNotUTCException, floor_to_day, floor_to_hour, verify_UTC
from zerver.lib.timestamp import TimeZoneNotUTCException, floor_to_day, floor_to_hour, verify_UTC
from zerver.models import Realm
states = {
@ -48,7 +48,7 @@ class Command(BaseCommand):
last_fill = installation_epoch()
try:
verify_UTC(last_fill)
except TimezoneNotUTCException:
except TimeZoneNotUTCException:
return {"status": 2, "message": f"FillState not in UTC for {property}"}
if stat.frequency == CountStat.DAY:

View File

@ -65,7 +65,7 @@ class Command(BaseCommand):
fill_to_time = fill_to_time.replace(tzinfo=timezone.utc)
if fill_to_time.tzinfo is None:
raise ValueError(
"--time must be timezone aware. Maybe you meant to use the --utc option?"
"--time must be time-zone-aware. Maybe you meant to use the --utc option?"
)
fill_to_time = floor_to_hour(fill_to_time.astimezone(timezone.utc))

View File

@ -49,7 +49,7 @@ from zerver.lib.actions import (
from zerver.lib.create_user import create_user
from zerver.lib.exceptions import InvitationError
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.timestamp import TimezoneNotUTCException, floor_to_day
from zerver.lib.timestamp import TimeZoneNotUTCException, floor_to_day
from zerver.lib.topic import DB_TOPIC_NAME
from zerver.lib.utils import assert_is_not_none
from zerver.models import (
@ -275,7 +275,7 @@ class TestProcessCountStat(AnalyticsTestCase):
stat = self.make_dummy_count_stat("test stat")
with self.assertRaises(ValueError):
process_count_stat(stat, installation_epoch() + 65 * self.MINUTE)
with self.assertRaises(TimezoneNotUTCException):
with self.assertRaises(TimeZoneNotUTCException):
process_count_stat(stat, installation_epoch().replace(tzinfo=None))
# This tests the LoggingCountStat branch of the code in do_delete_counts_at_hour.

View File

@ -109,7 +109,7 @@ def billing_home(
licenses_at_next_renewal = last_ledger_entry.licenses_at_next_renewal
seat_count = get_latest_seat_count(user.realm)
# Should do this in javascript, using the user's timezone
# Should do this in JavaScript, using the user's time zone
if plan.is_free_trial():
assert plan.next_invoice_date is not None
renewal_date = "{dt:%B} {dt.day}, {dt.year}".format(dt=plan.next_invoice_date)

View File

@ -164,11 +164,11 @@ of getting at least one of these things wrong.
### Naive datetime objects
Python allows datetime objects to not have an associated timezone, which can
Python allows datetime objects to not have an associated time zone, which can
cause time-related bugs that are hard to catch with a test suite, or bugs
that only show up during daylight savings time.
Good ways to make timezone-aware datetimes are below. We import timezone
Good ways to make time-zone-aware datetimes are below. We import time zone
libraries as `from datetime import datetime, timezone` and
`from django.utils.timezone import now as timezone_now`.
@ -184,7 +184,7 @@ Use:
- `datetime.strptime(date_string, format).replace(tzinfo=timezone.utc)` if
creating a datetime from a formatted string that is in UTC.
Idioms that result in timezone-naive datetimes, and should be avoided, are
Idioms that result in time-zone-naive datetimes, and should be avoided, are
`datetime.now()` and `datetime.fromtimestamp(timestamp)` without a `tz`
parameter, `datetime.utcnow()` and `datetime.utcfromtimestamp()`, and
`datetime.strptime(date_string, format)` without replacing the `tzinfo` at

View File

@ -264,8 +264,8 @@ Success for the contributor means a few things, in order of importance:
- Timely feedback is more important than complete feedback, so get a fast
feedback cadence going with your contributor. It's amazing how useful just 5
minutes of feedback can be. Pay attention to the relative timezones; if you
plan it, you can get several round trips in per day even with big timezone
minutes of feedback can be. Pay attention to the relative time zones; if you
plan it, you can get several round trips in per day even with big time zone
differences like USA + India.
- What exactly you focus on in your mentorship will vary from week to week and

View File

@ -708,7 +708,7 @@ log][commit-log] for an up-to-date list of raw changes.
- Added new email address visibility option hiding real email
addresses from organization administrators in the Zulip UI.
- Added new "Mention time" Markdown feature to communicate about times
in a timezone-aware fashion.
in a time-zone-aware fashion.
- Added new "Spoiler" Markdown feature to hide text until interaction.
- Added a new API that allows the mobile/desktop/terminal apps to
open uploaded files in an external browser that may not be logged in.

View File

@ -1364,11 +1364,13 @@ test("begins_typeahead", ({override, override_rewire}) => {
// time_jump
assert_typeahead_equals("<tim", false);
assert_typeahead_equals("<timerandom", false);
assert_typeahead_equals("<time", ["translated: Mention a timezone-aware time"]);
assert_typeahead_equals("<time:", ["translated: Mention a timezone-aware time"]);
assert_typeahead_equals("<time:something", ["translated: Mention a timezone-aware time"]);
assert_typeahead_equals("<time:something", "> ", ["translated: Mention a timezone-aware time"]);
assert_typeahead_equals("<time:something>", ["translated: Mention a timezone-aware time"]);
assert_typeahead_equals("<time", ["translated: Mention a time-zone-aware time"]);
assert_typeahead_equals("<time:", ["translated: Mention a time-zone-aware time"]);
assert_typeahead_equals("<time:something", ["translated: Mention a time-zone-aware time"]);
assert_typeahead_equals("<time:something", "> ", [
"translated: Mention a time-zone-aware time",
]);
assert_typeahead_equals("<time:something>", ["translated: Mention a time-zone-aware time"]);
assert_typeahead_equals("<time:something> ", false); // Already completed the mention
// Following tests place the cursor before the second string

View File

@ -74,7 +74,7 @@ django-bmemcached
# Needed for zerver/tests/test_timestamp.py
python-dateutil
# Needed for timezone work
# Needed for time zone work
pytz
# Needed for Redis

2
static/.gitignore vendored
View File

@ -10,7 +10,7 @@
/generated/emoji-styles
# From passing pygments data to the frontend
/generated/pygments_data.json
# From passing timezones data to the frontend
# From passing time zone data to the frontend
/generated/timezones.json
# Legacy emoji data directory
/third/emoji-data

View File

@ -733,7 +733,7 @@ export function get_candidates(query) {
const time_jump_regex = /<time(:([^>]*?)>?)?$/;
if (time_jump_regex.test(split[0])) {
this.completing = "time_jump";
return [$t({defaultMessage: "Mention a timezone-aware time"})];
return [$t({defaultMessage: "Mention a time-zone-aware time"})];
}
}
return false;

View File

@ -157,7 +157,7 @@ export const update_elements = (content) => {
content.find("time").each(function () {
// Populate each timestamp span with mentioned time
// in user's local timezone.
// in user's local time zone.
const time_str = $(this).attr("datetime");
if (time_str === undefined) {
return;

View File

@ -33,7 +33,7 @@ export function get_tz_with_UTC_offset(time: number | Date): string {
return "UTC";
}
// When user's locale doesn't match their timezone (eg. en_US for IST),
// When user's locale doesn't match their time zone (eg. en_US for IST),
// we get `timezone` in the format of'GMT+x:y. We don't want to
// show that along with (UTC+x:y)
timezone = /GMT[+-][\d:]*/.test(timezone ?? "") ? "" : timezone;

View File

@ -1,19 +1,19 @@
# Change your timezone
# Change your time zone
Zulip always uses your computer's timezone for displaying dates and
Zulip always uses your computer's time zone for displaying dates and
timestamps (note that you need to reload Zulip after changing your
computer's timezone for changes to take effect).
computer's time zone for changes to take effect).
By default, Zulip also indirectly displays your timezone to others, via the
By default, Zulip also indirectly displays your time zone to others, via the
**Local time** field of your [user profile](/help/view-someones-profile).
You can change the timezone Zulip displays to others.
You can change the time zone Zulip displays to others.
### Change your timezone
### Change your time zone
{start_tabs}
{settings_tab|profile}
2. Under **Profile**, select a timezone.
2. Under **Profile**, select a time zone.
{end_tabs}

View File

@ -210,11 +210,11 @@ the variant that only contains the user ID).
## Global times
When collaborating with people in another timezone, you often need to
express a specific time clearly. Rather than typing out your timezone
When collaborating with people in another time zone, you often need to
express a specific time clearly. Rather than typing out your time zone
and having everyone translate the time in their heads, in Zulip, you
can mention a time, and it'll be displayed to each user in their own
timezone (just like the timestamps on Zulip messages).
time zone (just like the timestamps on Zulip messages).
A date picker will appear once you type `<time`.

View File

@ -46,7 +46,7 @@
* [Review your settings](/help/review-your-settings)
* [Dark theme](/help/dark-theme)
* [Change your language](/help/change-your-language)
* [Change your timezone](/help/change-your-timezone)
* [Change your time zone](/help/change-your-timezone)
* [Use 24-hour time](/help/change-the-time-format)
* [Enable emoticon translations](/help/enable-emoticon-translations)
* [Configure default view](/help/configure-default-view)

View File

@ -35,7 +35,7 @@ from todays lecture. [lecture notes 10/2.pdf]() You can view a recording of t
### Formatting tips
* You can [post a time](/help/format-your-message-using-markdown#global-times)
that everyone will see in their own timezone.
that everyone will see in their own time zone.
* Share URLs as [named links](/help/format-your-message-using-markdown#links).
## Answering students questions

View File

@ -37,7 +37,7 @@ random spam.
## Remote workers cant participate.
This means that workers in different timezones can only effectively
This means that workers in different time zones can only effectively
collaborate during the narrow windows when everyone is at their
keyboards. As a result, Slack isnt an effective communication
platform for remote work.
@ -97,7 +97,7 @@ However, asynchronous communication is fundamental to how work happens today:
* Managers, PMs, and others in meetings all day need to reply to things in
batch, either in the few minutes they have between meetings, or at the end
of the day.
* Anyone in a different timezone or on a different work schedule than the
* Anyone in a different time zone or on a different work schedule than the
rest of the team has parts of their day where they are working
asynchronously.
* Individual contributors cannot do focused work if they need to check their

View File

@ -1545,7 +1545,7 @@ EMOJI_NAME_MAPS: Dict[str, Dict[str, Any]] = {
# 24-hour time (used in many countries), like what is 00:30 or 01:00
# called, c) it's hard to make the compose typeahead experience great, and
# d) we should have a dedicated time voting widget that takes care of
# timezone and locale issues, and uses a digital representation.
# time zone and locale issues, and uses a digital representation.
# '1f550': {'canonical_name': 'X', 'aliases': ['clock1']},
# '1f551': {'canonical_name': 'X', 'aliases': ['clock2']},
# '1f552': {'canonical_name': 'X', 'aliases': ['clock3']},

View File

@ -41,7 +41,7 @@ run(["./tools/setup/generate_zulip_bots_static_files.py"])
# Build pygments data
run(["./tools/setup/build_pygments_data"])
# Build timezones data
# Build time zone data
run(["./tools/setup/build_timezone_values"])
# Create webpack bundle

View File

@ -5746,7 +5746,7 @@ def do_change_user_setting(
lambda: send_event(user_profile.realm, legacy_event, [user_profile.id])
)
# Updates to the timezone display setting are sent to all users
# Updates to the time zone display setting are sent to all users
if setting_name == "timezone":
payload = dict(
email=user_profile.email,

View File

@ -177,7 +177,7 @@ def create_user(
# If a source profile was specified, we copy settings from that
# user. Note that this is positioned in a way that overrides
# other arguments passed in, which is correct for most defaults
# like timezone where the source profile likely has a better value
# like time zone where the source profile likely has a better value
# than the guess. As we decide on details like avatars and full
# names for this feature, we may want to move it.
if source_profile is not None:

View File

@ -1207,7 +1207,7 @@ def apply_event(
assert event["notification_name"] in UserProfile.notification_settings_legacy
state[event["notification_name"]] = event["setting"]
elif event["type"] == "user_settings":
# timezone setting is not included in property_types dict because
# time zone setting is not included in property_types dict because
# this setting is not a part of UserBaseSettings class.
if event["property"] != "timezone":
assert event["property"] in UserProfile.property_types

View File

@ -2,13 +2,13 @@ import calendar
import datetime
class TimezoneNotUTCException(Exception):
class TimeZoneNotUTCException(Exception):
pass
def verify_UTC(dt: datetime.datetime) -> None:
if dt.tzinfo is None or dt.tzinfo.utcoffset(dt) != datetime.timezone.utc.utcoffset(dt):
raise TimezoneNotUTCException(f"Datetime {dt} does not have a UTC timezone.")
raise TimeZoneNotUTCException(f"Datetime {dt} does not have a UTC time zone.")
def convert_to_UTC(dt: datetime.datetime) -> datetime.datetime:

View File

@ -1761,7 +1761,7 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
)
default_all_public_streams: bool = models.BooleanField(default=False)
# A timezone name from the `tzdata` database, as found in pytz.all_timezones.
# A time zone name from the `tzdata` database, as found in pytz.all_timezones.
#
# The longest existing name is 32 characters long, so max_length=40 seems
# like a safe choice.
@ -3277,7 +3277,7 @@ class Attachment(AbstractAttachment):
"path_id": self.path_id,
"size": self.size,
# convert to JavaScript-style UNIX timestamp so we can take
# advantage of client timezones.
# advantage of client time zones.
"create_time": int(time.mktime(self.create_time.timetuple()) * 1000),
"messages": [
{

View File

@ -435,7 +435,7 @@ paths:
- type: object
additionalProperties: false
description: |
When a user changes their timezone setting.
When a user changes their time zone setting.
properties:
user_id:
type: integer
@ -452,7 +452,7 @@ paths:
timezone:
type: string
description: |
The new timezone of the user.
The new time zone of the user.
- type: object
additionalProperties: false
description: |
@ -9597,9 +9597,9 @@ paths:
timezone:
type: string
description: |
The user's [configured timezone](/help/change-your-timezone).
The user's [configured time zone](/help/change-your-timezone).
Timezone values supported by the server are served at
Time zone values supported by the server are served at
[/static/generated/timezones.json](/static/generated/timezones.json).
enter_sends:
type: boolean
@ -10296,8 +10296,8 @@ paths:
and only for clients that did not include `user_settings_object` in
their client_capabilities` when registering the event queue.
The timezone configured for the user. This is used primarily to display
the user's timezone to other users.
The time zone configured for the user. This is used primarily to display
the user's time zone to other users.
See [PATCH /settings](/api/update-settings) for details on
the meaning of this setting.
@ -12304,9 +12304,9 @@ paths:
- name: timezone
in: query
description: |
The user's [configured timezone](/help/change-your-timezone).
The user's [configured time zone](/help/change-your-timezone).
Timezone values supported by the server are served at
Time zone values supported by the server are served at
[/static/generated/timezones.json](/static/generated/timezones.json).
**Changes**: Before Zulip 5.0 (feature level 80), this setting was managed by

View File

@ -1423,7 +1423,7 @@ class ScheduledMessageTest(ZulipTestCase):
self.assertEqual(message.content, "Test message 5")
self.assertEqual(message.delivery_type, ScheduledMessage.REMIND)
# Scheduling a message while guessing timezone.
# Scheduling a message while guessing time zone.
tz_guess = "Asia/Kolkata"
result = self.do_schedule_message(
"stream", "Verona", content + " 6", defer_until_str, tz_guess=tz_guess
@ -1436,8 +1436,8 @@ class ScheduledMessageTest(ZulipTestCase):
self.assertEqual(message.scheduled_timestamp, convert_to_UTC(utz_defer_until))
self.assertEqual(message.delivery_type, ScheduledMessage.SEND_LATER)
# Test with users timezone setting as set to some timezone rather than
# empty. This will help interpret timestamp in users local timezone.
# Test with users time zone setting as set to some time zone rather than
# empty. This will help interpret timestamp in users local time zone.
user = self.example_user("hamlet")
user.timezone = "US/Pacific"
user.save(update_fields=["timezone"])

View File

@ -24,7 +24,7 @@ class TestChoosePubDate(ZulipTestCase):
)
class TestUserTimezones(ZulipTestCase):
class TestUserTimeZones(ZulipTestCase):
def test_timezones_assigned_to_users(self) -> None:
othello = self.example_user("othello")
self.assertEqual(othello.timezone, "US/Pacific")

View File

@ -5719,7 +5719,7 @@ class FollowupEmailTest(ZulipTestCase):
# Time offset of America/Phoenix is -07:00
user_profile.timezone = "America/Phoenix"
# Test date_joined == Friday in UTC, but Thursday in the user's timezone
# Test date_joined == Friday in UTC, but Thursday in the user's time zone
user_profile.date_joined = datetime.datetime(
2018, 1, 5, 1, 0, 0, 0, tzinfo=datetime.timezone.utc
)

View File

@ -4,7 +4,7 @@ from dateutil import parser
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.timestamp import (
TimezoneNotUTCException,
TimeZoneNotUTCException,
ceiling_to_hour,
convert_to_UTC,
datetime_to_timestamp,
@ -28,7 +28,7 @@ class TestTimestamp(ZulipTestCase):
parser.parse("2017-01-01 00:00:00.123+01:00"),
parser.parse("2017-01-01 00:00:00.123"),
]:
with self.assertRaises(TimezoneNotUTCException):
with self.assertRaises(TimeZoneNotUTCException):
datetime_to_timestamp(dt)
def test_convert_to_UTC(self) -> None:
@ -43,5 +43,5 @@ class TestTimestamp(ZulipTestCase):
def test_enforce_UTC(self) -> None:
non_utc_datetime = parser.parse("2017-01-01 00:00:00.123")
for function in [floor_to_hour, floor_to_day, ceiling_to_hour, ceiling_to_hour]:
with self.assertRaises(TimezoneNotUTCException):
with self.assertRaises(TimeZoneNotUTCException):
function(non_utc_datetime)

View File

@ -476,7 +476,7 @@ class Command(BaseCommand):
u.timezone = new_time_zone
u.save(update_fields=["timezone"])
# Note: Hamlet keeps default timezone of "".
# Note: Hamlet keeps default time zone of "".
assign_time_zone_by_delivery_email("AARON@zulip.com", "US/Pacific")
assign_time_zone_by_delivery_email("othello@zulip.com", "US/Pacific")
assign_time_zone_by_delivery_email("ZOE@zulip.com", "US/Eastern")

View File

@ -147,7 +147,7 @@ USE_I18N = True
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
# If you set this to False, Django will not use time-zone-aware datetimes.
USE_TZ = True
# this directory will be used to store logs for development environment