Commit Graph

14 Commits

Author SHA1 Message Date
David Hill f60220329a Get the timezone offset for the current day instead of January 1st.
This bug only appears to be a cosmetic one where the TZ offset
would be calculated on current_year/01/01 so would remain in
daylight saving offset when displaying the timezones list.

(Note by amotoki)
The minimum version of Babel is bumped to 2.6.0
as Babel 2.3.4 returns "New Zealand Time" instead of "New Zealand
(Auckland) Time" returned from the latest Babel (2.9.0).
It is not a good idea to handle such difference in Babel in our UT
and there is no reason to stick to Bump 2.3.4.
2.6.0 was chosen as it is available in Ubuntu Focal and there is
no more reason than this.

Change-Id: I0600086cc51cf5abcf1631565e75146114189667
Closes-bug: #1822849
2021-03-18 08:29:07 +09:00
Akihiro Motoki 6ba506e281 test: use safer way to override settings
Django provides safer ways to override settings.
We should avoid direct replacement of existing setting.

Change-Id: I1fbcb79d18baaae037536b180989cf69c198fa7d
2020-09-13 09:47:50 +09:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
2018-02-17 01:36:48 +09:00
Akihiro Motoki 00f74fc06c Revert "Generate language list automatically"
This reverts commit a880926300.

The reverted implementation depends on LOCALE_PATHS but this assumption
turns out not correct. Django searches messages catalogs LOCALE_PATHS
and locale directory in individual INSTALLED_APPS, but the usage of
LOCALE_PATHS varies on deployers and we cannot assume the default value
of LOCALE_PATSH.

In addition, the logic of auto-generating the language list cannot
handle locale name alias ('fallback' in the Django code).
Django 1.9 or later perfers to zh-hant and zh-hans, and zh-cn and
zh-tw are now defined as fallback.

We can explore a better approach for auto-generation of the language
list, but we do not have more reliable way so far. Cconsidering the
timing of Pike release, the safest approach looks like to revert
the original patch back to the manula maintenance of the lang list.

Languages with over 50% progress (based on the number of translated
messages as total) are listed in settings.LANGUAGES.
(http://paste.openstack.org/show/618254/)

Closes-Bug: #1710131
Change-Id: I5133d6317aba6107fc37bd5f30388c130b1fdaac
2017-08-12 22:30:13 +00:00
Akihiro Motoki a880926300 Generate language list automatically
Previously the available language list is maintained manually.
This commit change horizon to check translation message catalog
is available for each language and generate the language list
automatically. settings.LANGUAGES is still used to determines
the initial set of languages and now defaults to the list provided
by django.

Change-Id: I9d9c934beebd7a641e2feb0d5cdfa839e0efa3c3
Closes-Bug: #1675298
2017-03-27 08:47:50 +00:00
Yves-Gwenael Bourhis 21d0f09216 Removing Moscow's timezone check
MOSCOW on October 26 has turned its clocks back one hour switching to permanent
"winter" time and ending the three-year experiment of living on permanent
"summer time." No seasonal time change is envisaged from now on.

For safety, we remove this timezone check

Change-Id: I1614f8f7adb56903816aa5a093d742925dd51ea8
Closes-Bug: #1407055
2015-01-02 11:51:28 +01:00
Doug Fish 8c50905a29 Make timezones translatable
Use timezone info in Babel to translate timezones.  Sort
timezones by offset.  Update format to:
    UTC -06:00: United States (Chicago) Time

Thanks amotoki for suggesting to use Babel to handle this!

Not updating environment_version in run_tests.sh because Babel isn't
a new requirement; it's just being made explicit.

Change-Id: I15d39b94d441e9e155870a0593d11e67e68f9bd9
Closes-Bug: #1333927
2014-10-06 09:43:22 -05:00
He Yongli e790ac070e Remove extraneous vim configuration comments
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

at the top of source code files, except for files in
openstack/common.

Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
2014-05-06 15:30:10 +08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.

I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.

I also removed a few unused imports that were revealed in the process.

Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
2014-01-07 12:26:35 +01:00
Akihiro MOTOKI 8071baff97 Allow Django unknown language in LANGUAGES settings
Language preference form expects all languages in LANGUAGES in
openstack_dashboard/settings.py. This leads to an error when
adding a language not listed in django/conf/locale to LANGUAGES list.

This commit allows such language to LANGUAGES in the settings file.

Closes-Bug: #1229026

Change-Id: I37d7f4b089b0299942f25084f741a557467b3be7
2013-09-23 14:45:52 +09:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Matthias Runge a2915279ed Improve test stability
Under some circumstances, Canada/Newfoundland (UTC -03:30)
can not be found as answer in tests. This patch improves
stability here by using cities with the same distances to
UTC and UTC DST.

Fixes bug 1184901

Change-Id: I7d5739a7c7a504c22cceebeaa3331637993e34ae
2013-05-28 12:18:43 +02:00
Julie Pichon dadf4f7d06 Timezones can change - display the current tz offset
As noted in the reviews for the backport (20467), the initial patch
for bug 1103003 didn't account for timezones changing over time.

Change-Id: Iceab7deb803669c56aa21252561f650f8c4a601d
2013-02-08 16:50:36 +00:00
Julie Pichon 0d303c8e6d Add UTC offset information to the timezone
In the User Settings, indicate besides the timezone name what the
actual timezone/UTC offset is.

Fixes bug 1103003

Change-Id: I8070df2bc0380da1555c40dc9394895fbfde6848
2013-01-22 15:55:14 +00:00