#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import shutil
import sys
def traslate_po(po, translation):
search = 'msgid "' + translation + '"'
idx = po.find(search)
if idx == -1:
return ''
# 9 characters after msgid "xxx" for the translated message
begin = idx + len(search) + 9
# Search next " with newline
end = po.find('"\n', begin)
if end == -1:
return ''
return po[begin : end]
STK_DESCRIPTION = 'A 3D open-source kart racing game'
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, summary in AppData and short description in Google Play
GenericName=""" + STK_DESCRIPTION + """
Exec=supertuxkart
Terminal=false
StartupNotify=false
Type=Application
Categories=Game;ArcadeGame;
#I18N: Keywords in desktop entry, translators please keep it separated with semicolons
Keywords=tux;game;race;
PrefersNonDefaultGPU=true
"""
desktop_file = open('supertuxkart.desktop', 'w')
desktop_file.write(STK_DESKTOP_FILE_P1 + STK_DESKTOP_FILE_P3)
desktop_file.close()
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 = 'We have several tracks with various themes for players to enjoy, \
from driving underwater, rural farmlands, jungles or even in space! \
Try your best while avoiding other karts as they may 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, join online and meet players from all over the world \
and prove your racing skills!'
# Used in google play only for now
STK_APPDATA_P4 = 'This game has no ads.'
# Used in google play beta only for now
STK_APPDATA_P5 = 'This is an unstable version of SuperTuxKart that contains latest improvements. \
It is released mainly for testing, to make stable STK as good as possible.'
STK_APPDATA_P6 = 'This version can be installed in parallel with the stable version on the device.'
STK_APPDATA_P7 = 'If you need more stability, consider using the stable version: %s'
STK_STABLE_URL = 'https://play.google.com/store/apps/details?id=org.supertuxkart.stk'
STK_APPDATA_FILE_1 = """
net.supertuxkart.SuperTuxKartCC0-1.0GPL-3.0+supertuxkart.desktop
"""
# Split it to avoid SuperTuxKart being translated
STK_APPDATA_FILE_2 = """ SuperTuxKart
"""
STK_APPDATA_FILE_3 = """ """ + STK_DESCRIPTION + """