Skip to content

Commit

Permalink
Merge pull request #39 from yihong0618/master
Browse files Browse the repository at this point in the history
Add Chinese translation and runtastic gpx in readme
  • Loading branch information
flopp authored Aug 13, 2019
2 parents 18b65bb + 5d1b4f8 commit 39f4c5f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -118,6 +118,7 @@ We currently support

- French (`--language fr_FR`)
- German (`--language de_DE`)
- Chinese (`--language zh_CN`)


## Setup
Expand Down
6 changes: 5 additions & 1 deletion gpxtrackposter/calendar_drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Binary file added locale/zh_CN/LC_MESSAGES/gpxposter.mo
Binary file not shown.
52 changes: 52 additions & 0 deletions locale/zh_CN/LC_MESSAGES/gpxposter.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Chinese translations for PACKAGE package
# PACKAGE 软件包的简体中文翻译.
# Copyright (C) 2019 ORGANIZATION
# Hong Yi <[email protected]>, 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 <[email protected]>\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 "次数"

0 comments on commit 39f4c5f

Please sign in to comment.