diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 2f75c2d..446f222 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -68,6 +68,10 @@ jobs: python-version: '3.9.x' - name: Install the Latest pip run: python -m pip install --upgrade pip + - name: install ja_JP.UTF-8 locale + run: | + sudo locale-gen ja_JP.UTF-8 + sudo update-locale LANG=ja_JP.UTF-8 - name: Install required modules run: python -m pip install -r requirements.txt --upgrade - name: Build HTML diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2df395..c36d550 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,11 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ap-northeast-1 + - name: install ja_JP.UTF-8 locale + run: | + sudo locale-gen ja_JP.UTF-8 + sudo update-locale LANG=ja_JP.UTF-8 + - name: Install the Latest pip run: python -m pip install --upgrade pip diff --git a/en/source/conf.py b/en/source/conf.py index 7c8938b..535d3bc 100644 --- a/en/source/conf.py +++ b/en/source/conf.py @@ -12,27 +12,29 @@ # import os import sys -sys.path.insert(0, os.path.abspath('.')) import datetime import re +import locale +sys.path.insert(0, os.path.abspath('../..')) +sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- +from version import * project = 'freee Accessibility Guidelines' author = 'freee K.K.' -guidelines_version = 'Ver. 202404.0' -checksheet_version = '4.3.7' -publishedDate = u'Apr 23 2024' guidelines_version_suffix = '-RELEASE' guidelines_version_date = '' +locale.setlocale(locale.LC_TIME, 'en_US.UTF-8') +date_obj = datetime.datetime.strptime(publishedDate, '%Y-%m-%d') if 'current' in tags: guidelines_version_suffix = '-CURRENT' - import datetime - guidelines_version_date = f'.{datetime.date.today().strftime("%Y%m%d")}' - today_str = datetime.date.today().strftime('%b %d %Y') - publishedDate = today_str + date_obj = datetime.date.today() + guidelines_version_date = f'.{date_obj.strftime("%Y%m%d")}' +date_str = date_obj.strftime('%b %d %Y') +publishedDate = date_str version = guidelines_version + guidelines_version_suffix + f'+{checksheet_version}' release = guidelines_version + guidelines_version_suffix + guidelines_version_date + f'+{checksheet_version}' guidelines_version_string = guidelines_version + guidelines_version_suffix + guidelines_version_date diff --git a/ja/source/conf.py b/ja/source/conf.py index e1b5532..7c6c78c 100644 --- a/ja/source/conf.py +++ b/ja/source/conf.py @@ -12,30 +12,32 @@ # import os import sys -sys.path.insert(0, os.path.abspath('.')) import datetime import re +import locale from docutils import nodes from docutils.parsers.rst import Directive from sphinx.util.docutils import SphinxDirective +sys.path.insert(0, os.path.abspath('../..')) +sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- +from version import * project = 'freeeアクセシビリティー・ガイドライン' author = 'フリー株式会社' -guidelines_version = 'Ver. 202400.0' -checksheet_version = '4.3.7' -publishedDate = u'2024年4月23日' guidelines_version_suffix = '-RELEASE' guidelines_version_date = '' +locale.setlocale(locale.LC_TIME, 'ja_JP.UTF-8') +date_obj = datetime.datetime.strptime(publishedDate, '%Y-%m-%d') if 'current' in tags: guidelines_version_suffix = '-CURRENT' - import datetime - guidelines_version_date = f'.{datetime.date.today().strftime("%Y%m%d")}' - today_str = datetime.date.today().strftime('%Y年%-m月%-d日') - publishedDate = today_str + date_obj = datetime.date.today() + guidelines_version_date = f'.{date_obj.strftime("%Y%m%d")}' +date_str = date_obj.strftime('%Y年%-m月%-d日') +publishedDate = date_str version = guidelines_version + guidelines_version_suffix + f'+{checksheet_version}' release = guidelines_version + guidelines_version_suffix + guidelines_version_date + f'+{checksheet_version}' guidelines_version_string = guidelines_version + guidelines_version_suffix + guidelines_version_date diff --git a/version.py b/version.py new file mode 100644 index 0000000..9dca331 --- /dev/null +++ b/version.py @@ -0,0 +1,3 @@ +guidelines_version = 'Ver. 202404.0' +checksheet_version = '4.3.7' +publishedDate = '2024-04-23'