From 6b496f18925e6c0073887c9a33a24f4af84ebca1 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 4 Sep 2020 21:54:02 +0800 Subject: [PATCH] Make AppData translatable and fix #2314 --- data/po/supertuxkart.pot | 51 +++++++++++++++++++--- data/po/update_pot.sh | 93 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 133 insertions(+), 11 deletions(-) diff --git a/data/po/supertuxkart.pot b/data/po/supertuxkart.pot index 09223374c..503300f30 100644 --- a/data/po/supertuxkart.pot +++ b/data/po/supertuxkart.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: supertuxkart\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-03 16:33+0800\n" +"POT-Creation-Date: 2020-09-04 21:53+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -785,6 +785,7 @@ msgstr "" #. I18N: Multiplayer game mode #. I18N: Game mode #: src/network/server_config.cpp:260 src/race/race_manager.cpp:1188 +#: supertuxkart.appdata.xml:24 msgid "Normal Race" msgstr "" @@ -801,7 +802,7 @@ msgstr "" #. I18N: Multiplayer game mode #. I18N: ./data/gui/screens/online/create_server.stkgui #. I18N: Multiplayer game mode -#: src/states_screens/race_setup_screen.cpp:112 +#: src/states_screens/race_setup_screen.cpp:112 supertuxkart.appdata.xml:28 msgid "Battle" msgstr "" @@ -811,6 +812,7 @@ msgstr "" #. I18N: Multiplayer game mode #. I18N: Game mode #: src/network/server_config.cpp:264 src/race/race_manager.cpp:1202 +#: supertuxkart.appdata.xml:32 msgid "Soccer" msgstr "" @@ -1028,7 +1030,7 @@ msgstr "" #: src/states_screens/addons_screen.cpp:135 #: src/states_screens/arenas_screen.cpp:74 #: src/states_screens/easter_egg_screen.cpp:137 -#: src/states_screens/edit_track_screen.cpp:146 +#: src/states_screens/edit_track_screen.cpp:111 #: src/states_screens/gp_info_screen.cpp:74 #: src/states_screens/grand_prix_editor_screen.cpp:334 #: src/states_screens/kart_selection.cpp:309 @@ -4844,7 +4846,7 @@ msgstr "" msgid "An error occurred while trying to save your grand prix." msgstr "" -#: src/states_screens/edit_track_screen.cpp:234 +#: src/states_screens/edit_track_screen.cpp:254 msgid "Select a track" msgstr "" @@ -6062,12 +6064,47 @@ msgstr "" msgid "You are now ready to race. Good luck!" msgstr "" -#. I18N: Generic name in desktop file entry, used in linux -#: supertuxkart.desktop:4 -msgid "A kart racing game" +#. I18N: Generic name in desktop file entry, summary in AppData and short description in Google Play +#: supertuxkart.desktop:4 supertuxkart.appdata.xml:6 +msgid "A 3D open-source kart racing game" msgstr "" #. I18N: Keywords in desktop entry, translators please keep it separated with semicolons #: supertuxkart.desktop:11 msgid "tux;game;race;" msgstr "" + +#: supertuxkart.appdata.xml:8 +msgid "" +"Karts. Nitro. Action! SuperTuxKart is a 3D open-source arcade racer with a " +"variety of characters, tracks, and modes to play. Our aim is to create a " +"game that is more fun than realistic, and provide an enjoyable experience " +"for all ages." +msgstr "" + +#: supertuxkart.appdata.xml:11 +msgid "" +"Discover the mystery of an underwater world, or drive through the jungles of " +"Val Verde and visit the famous Cocoa Temple. Race underground or in a " +"spaceship, through a rural farmland or a strange alien planet. Or rest under " +"the palm trees on the beach, watching the other karts overtake you. But " +"don't eat the bananas! Watch for bowling balls, plungers, bubble gum, and " +"cakes thrown by your opponents." +msgstr "" + +#: supertuxkart.appdata.xml:14 +msgid "" +"You can do a single race against other karts, compete in one of several " +"Grand Prix, try to beat the high score in time trials on your own, play " +"battle mode against the computer or your friends, and more! For a greater " +"challenge, race online against players from all over the world and prove " +"your racing process!" +msgstr "" + +#: supertuxkart.appdata.xml:17 +msgid "This game is free and without ads." +msgstr "" + +#: supertuxkart.appdata.xml:35 +msgid "SuperTuxKart Team" +msgstr "" diff --git a/data/po/update_pot.sh b/data/po/update_pot.sh index 9dc17055e..91eb950f7 100755 --- a/data/po/update_pot.sh +++ b/data/po/update_pot.sh @@ -74,8 +74,9 @@ STK_DESKTOP_FILE_P1="[Desktop Entry]" # Split it to avoid SuperTuxKart being translated STK_DESKTOP_FILE_P2="Name=SuperTuxKart Icon=supertuxkart" -STK_DESKTOP_FILE_P3="#I18N: Generic name in desktop file entry, used in linux -GenericName=A kart racing game +STK_DESKTOP_FILE_P3="#I18N: Generic name in desktop file entry, \ +summary in AppData and short description in Google Play +GenericName=A 3D open-source kart racing game Exec=supertuxkart Terminal=false StartupNotify=false @@ -88,15 +89,96 @@ PrefersNonDefaultGPU=true" echo "${STK_DESKTOP_FILE_P1}" > supertuxkart.desktop echo "${STK_DESKTOP_FILE_P3}" >> supertuxkart.desktop -# Desktop entry +STK_APPDATA_P1="Karts. Nitro. Action! SuperTuxKart is a 3D open-source arcade racer \ +with a variety of characters, tracks, and modes to play. \ +Our aim is to create a game that is more fun than realistic, \ +and provide an enjoyable experience for all ages." +STK_APPDATA_P2="Discover the mystery of an underwater world, \ +or drive through the jungles of Val Verde and visit the famous Cocoa Temple. \ +Race underground or in a spaceship, through a rural farmland or a strange alien planet. \ +Or rest under the palm trees on the beach, watching the other karts overtake you. \ +But don't eat the bananas! Watch for bowling balls, plungers, bubble gum, \ +and cakes thrown by your opponents." +STK_APPDATA_P3="You can do a single race against other karts, \ +compete in one of several Grand Prix, \ +try to beat the high score in time trials on your own, \ +play battle mode against the computer or your friends, \ +and more! For a greater challenge, race online against players from all over the world \ +and prove your racing process!" +# Used in google play only for now +STK_APPDATA_P4="This game is free and without ads." + +STK_APPDATA_FILE_1=" + + supertuxkart.desktop + CC0-1.0 + GPL-3.0+" +# Split it to avoid SuperTuxKart being translated +STK_APPDATA_FILE_2=" SuperTuxKart" +STK_APPDATA_FILE_3=" A 3D open-source kart racing game + +

+ "${STK_APPDATA_P1}" +

+

+ "${STK_APPDATA_P2}" +

+

+ "${STK_APPDATA_P3}" +

" +STK_APPDATA_FILE_4="

+ "${STK_APPDATA_P4}" +

" +STK_APPDATA_FILE_5="
+ + + https://supertuxkart.net/images/8/83/Supertuxkart-0.9.2-screenshot-3.jpg + Normal Race + + + https://supertuxkart.net/images/1/1f/Supertuxkart-0.9.2-screenshot-1.jpg + Battle + + + https://supertuxkart.net/images/2/2a/Supertuxkart-0.9.2-screenshot-2.jpg + Soccer + + + SuperTuxKart Team + supertuxkart-devel@lists.sourceforge.net + https://supertuxkart.net + https://github.com/supertuxkart/stk-code/issues + https://supertuxkart.net/Donate + https://supertuxkart.net/Community + https://supertuxkart.net/Translating_STK + + mild + intense + +
" + +echo "${STK_APPDATA_FILE_1}" > supertuxkart.appdata.xml +echo "${STK_APPDATA_FILE_3}" >> supertuxkart.appdata.xml +echo "${STK_APPDATA_FILE_4}" >> supertuxkart.appdata.xml +echo "${STK_APPDATA_FILE_5}" >> supertuxkart.appdata.xml + +# Desktop and AppData entry xgettext -j -d supertuxkart --add-comments="I18N:" \ -p ./data/po -o supertuxkart.pot \ - --package-name=supertuxkart supertuxkart.desktop + --package-name=supertuxkart supertuxkart.desktop supertuxkart.appdata.xml echo "${STK_DESKTOP_FILE_P1}" > supertuxkart.desktop echo "${STK_DESKTOP_FILE_P2}" >> supertuxkart.desktop echo "${STK_DESKTOP_FILE_P3}" >> supertuxkart.desktop +echo "${STK_APPDATA_FILE_1}" > supertuxkart.appdata.xml +echo "${STK_APPDATA_FILE_2}" >> supertuxkart.appdata.xml +echo "${STK_APPDATA_FILE_3}" >> supertuxkart.appdata.xml +# Skip google play message +echo "${STK_APPDATA_FILE_5}" >> supertuxkart.appdata.xml + +# Manually copy zh_TW to zh_HK for fallback +cp data/po/zh_TW.po data/po/zh_HK.po for PO in $(ls data/po/*.po); do LANG=$(basename $PO .po) if [ "$LANG" = "en" ]; then @@ -106,8 +188,11 @@ for PO in $(ls data/po/*.po); do done msgfmt --desktop -d data/po --template supertuxkart.desktop -o data/supertuxkart.desktop +msgfmt --xml -d data/po --template supertuxkart.appdata.xml -o data/supertuxkart.appdata.xml rm -f ./supertuxkart.desktop +rm -f ./supertuxkart.appdata.xml rm -f ./data/po/LINGUAS +rm -f ./data/po/zh_HK.po echo " Done" echo "---------------------------"