diff --git a/README.md b/README.md index 3d2d229..ff25873 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Create a visually appealing poster from your GPX tracks - heavily inspired by ht ## Usage -First of all, you need directory with a bunch of GPX files (e.g. you can export all your tracks from Garmin Connect with the excellent tool [garmin-connect-export](https://github.com/kjkjava/garmin-connect-export), or use [StravaExportToGPX](https://github.com/flopp/StravaExportToGPX) to convert the activities in a Strava export zip file to GPX). +First of all, you need directory with a bunch of GPX files (e.g. you can export all your tracks from Garmin Connect with the excellent tool [garmin-connect-export](https://github.com/kjkjava/garmin-connect-export), or use [StravaExportToGPX](https://github.com/flopp/StravaExportToGPX), or use [runtastic](https://github.com/Metalnem/runtastic) to convert the activities in a Strava or Runtastic export zip file to GPX). You will need a little experience running things from the command line to use this script. That said, here are the usage details from the `--help` flag: @@ -118,6 +118,7 @@ We currently support - French (`--language fr_FR`) - German (`--language de_DE`) +- Chinese (`--language zh_CN`) ## Setup diff --git a/gpxtrackposter/calendar_drawer.py b/gpxtrackposter/calendar_drawer.py index 5094acb..9b2df84 100644 --- a/gpxtrackposter/calendar_drawer.py +++ b/gpxtrackposter/calendar_drawer.py @@ -78,9 +78,13 @@ def _draw(self, dr: svgwrite.Drawing, size: XY, offset: XY, year: int): (size.y - cell_size * 3 * 12) / 11, ) + # chinese weekday key number is the third. + keyword_num = 0 + if locale.getlocale()[0] == "zh_CN": + keyword_num = 2 # first character of localized day names, starting with Monday. dow = [ - locale.nl_langinfo(day)[0].upper() + locale.nl_langinfo(day)[keyword_num].upper() for day in [ locale.DAY_2, locale.DAY_3, diff --git a/locale/zh_CN/LC_MESSAGES/gpxposter.mo b/locale/zh_CN/LC_MESSAGES/gpxposter.mo new file mode 100644 index 0000000..838764f Binary files /dev/null and b/locale/zh_CN/LC_MESSAGES/gpxposter.mo differ diff --git a/locale/zh_CN/LC_MESSAGES/gpxposter.po b/locale/zh_CN/LC_MESSAGES/gpxposter.po new file mode 100644 index 0000000..9e6abbd --- /dev/null +++ b/locale/zh_CN/LC_MESSAGES/gpxposter.po @@ -0,0 +1,52 @@ +# Chinese translations for PACKAGE package +# PACKAGE 软件包的简体中文翻译. +# Copyright (C) 2019 ORGANIZATION +# Hong Yi , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2017-01-21 13:30+0100\n" +"PO-Revision-Date: 2019-07-31 23:02+0800\n" +"Last-Translator: Hong Yi \n" +"Language-Team: Chinese (simplified)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: pygettext.py 1.5\n" +"Language: zh_CN\n" + +#: src/poster.py:50 +msgid "YEAR" +msgstr "YEAR" + +#: src/poster.py:52 +msgid "ATHLETE" +msgstr "运动员" + +#: src/poster.py:54 +msgid "STATISTICS" +msgstr "数据" + +#: src/poster.py:56 +msgid "Weekly" +msgstr "周" + +#: src/poster.py:57 +msgid "Total" +msgstr "总" + +#: src/poster.py:58 +msgid "Avg" +msgstr "平均" + +#: src/poster.py:59 +msgid "Min" +msgstr "最少" + +#: src/poster.py:60 +msgid "Max" +msgstr "最多" + +msgid "Number" +msgstr "次数"