Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chinese translation and runtastic gpx in readme #39

Merged
merged 8 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 "次数"