From 2f96aab02e27820f79c0696a28e75fc055536cc8 Mon Sep 17 00:00:00 2001 From: yihong Date: Sun, 4 Aug 2019 14:31:28 +0800 Subject: [PATCH 1/8] add chinese translate --- locale/zh_CN/LC_MESSAGES/gpxposter.mo | Bin 0 -> 694 bytes locale/zh_CN/LC_MESSAGES/gpxposter.po | 52 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 locale/zh_CN/LC_MESSAGES/gpxposter.mo create mode 100644 locale/zh_CN/LC_MESSAGES/gpxposter.po diff --git a/locale/zh_CN/LC_MESSAGES/gpxposter.mo b/locale/zh_CN/LC_MESSAGES/gpxposter.mo new file mode 100644 index 0000000000000000000000000000000000000000..838764f1582ddb33a1e870d936639adafae58250 GIT binary patch literal 694 zcmYL`&1(}u6u@7#^<&YC7cUBP@L(wuXA`7x{lIly+hCK1WUcfh(`33C-OPsFNok6Q zo)m9!h)Xmi$Ju zvRJd~ivjf#!8PvE>s$+m6q!9snN5o}u}e;g%`lrWOr#C5CQX%b-UZ5LX~`zVlEaEK ztc-aJJk>NvxJo0gGq7XZ!_x9jfa9 literal 0 HcmV?d00001 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 "次数" From dd9c971b5a17cf35489f85002ad835c1f063899c Mon Sep 17 00:00:00 2001 From: yihong Date: Sun, 4 Aug 2019 15:00:43 +0800 Subject: [PATCH 2/8] fix chinese bug --- gpxtrackposter/calendar_drawer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpxtrackposter/calendar_drawer.py b/gpxtrackposter/calendar_drawer.py index 5094acb..3ed6911 100644 --- a/gpxtrackposter/calendar_drawer.py +++ b/gpxtrackposter/calendar_drawer.py @@ -78,9 +78,12 @@ def _draw(self, dr: svgwrite.Drawing, size: XY, offset: XY, year: int): (size.y - cell_size * 3 * 12) / 11, ) + keyword_num = 0 + if locale.getlocale()[0] == 'zh_CN': + keyword_num = 3 # 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, From d9ff0514f7f427553e8740f83e063545ccae20d0 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Tue, 6 Aug 2019 21:56:56 +0800 Subject: [PATCH 3/8] fix bug --- gpxtrackposter/calendar_drawer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gpxtrackposter/calendar_drawer.py b/gpxtrackposter/calendar_drawer.py index 3ed6911..604dd5c 100644 --- a/gpxtrackposter/calendar_drawer.py +++ b/gpxtrackposter/calendar_drawer.py @@ -77,10 +77,11 @@ def _draw(self, dr: svgwrite.Drawing, size: XY, offset: XY, year: int): (size.x - cell_size * count_x) / (count_x - 1), (size.y - cell_size * 3 * 12) / 11, ) - + + # Chinese weekday keyword is the third. keyword_num = 0 - if locale.getlocale()[0] == 'zh_CN': - keyword_num = 3 + if locale.getlocale()[0] == "zh_CN": + keyword_num = 2 # first character of localized day names, starting with Monday. dow = [ locale.nl_langinfo(day)[keyword_num].upper() From e14a892b9a99d8cb05d6a9b580ab573fbc6cca8a Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Tue, 6 Aug 2019 22:11:56 +0800 Subject: [PATCH 4/8] reset --- gpxtrackposter/calendar_drawer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gpxtrackposter/calendar_drawer.py b/gpxtrackposter/calendar_drawer.py index 604dd5c..3ed6911 100644 --- a/gpxtrackposter/calendar_drawer.py +++ b/gpxtrackposter/calendar_drawer.py @@ -77,11 +77,10 @@ def _draw(self, dr: svgwrite.Drawing, size: XY, offset: XY, year: int): (size.x - cell_size * count_x) / (count_x - 1), (size.y - cell_size * 3 * 12) / 11, ) - - # Chinese weekday keyword is the third. + keyword_num = 0 - if locale.getlocale()[0] == "zh_CN": - keyword_num = 2 + if locale.getlocale()[0] == 'zh_CN': + keyword_num = 3 # first character of localized day names, starting with Monday. dow = [ locale.nl_langinfo(day)[keyword_num].upper() From 063d15852fd94e4bda072b2b6a257fa9ca6788df Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Tue, 6 Aug 2019 22:14:04 +0800 Subject: [PATCH 5/8] add runtastic to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d2d229..06feb0e 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 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: From 5858047edd7dea85780203a77f1a4b9310d08edc Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Tue, 6 Aug 2019 22:22:04 +0800 Subject: [PATCH 6/8] fix key number bug --- gpxtrackposter/calendar_drawer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpxtrackposter/calendar_drawer.py b/gpxtrackposter/calendar_drawer.py index 3ed6911..5ebb807 100644 --- a/gpxtrackposter/calendar_drawer.py +++ b/gpxtrackposter/calendar_drawer.py @@ -78,9 +78,10 @@ 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 = 3 + keyword_num = 2 # first character of localized day names, starting with Monday. dow = [ locale.nl_langinfo(day)[keyword_num].upper() From 5b5725bc47d9f7df264df92a6d7bca7e9df99df6 Mon Sep 17 00:00:00 2001 From: yihong Date: Tue, 13 Aug 2019 08:22:27 +0800 Subject: [PATCH 7/8] format and add Chinese languge type in README --- README.md | 3 ++- gpxtrackposter/calendar_drawer.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06feb0e..5bd8a8e 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), or use [runtastic](https://github.com/Metalnem/runtastic) 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 ch_CN`) ## Setup diff --git a/gpxtrackposter/calendar_drawer.py b/gpxtrackposter/calendar_drawer.py index 5ebb807..9b2df84 100644 --- a/gpxtrackposter/calendar_drawer.py +++ b/gpxtrackposter/calendar_drawer.py @@ -78,9 +78,9 @@ 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. + # chinese weekday key number is the third. keyword_num = 0 - if locale.getlocale()[0] == 'zh_CN': + if locale.getlocale()[0] == "zh_CN": keyword_num = 2 # first character of localized day names, starting with Monday. dow = [ From 5d1b4f84222790e972e410307ad7e0efb7c50d5e Mon Sep 17 00:00:00 2001 From: yihong Date: Tue, 13 Aug 2019 08:24:52 +0800 Subject: [PATCH 8/8] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bd8a8e..ff25873 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ We currently support - French (`--language fr_FR`) - German (`--language de_DE`) -- Chinese (`--language ch_CN`) +- Chinese (`--language zh_CN`) ## Setup