diff options
author | Didier Raboud <odyx@debian.org> | 2012-12-26 14:56:12 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2012-12-27 09:56:38 +0100 |
commit | a75f02089cd97b62cb7cf1505bd38e32da14eb69 (patch) | |
tree | 98b8de4e4714a84947fe907146bb9a34c0a40c04 /src/desktop | |
parent | c793d2d4c67a5556e39300988f42a630fc51e68d (diff) | |
download | colobot-a75f02089cd97b62cb7cf1505bd38e32da14eb69.tar.gz colobot-a75f02089cd97b62cb7cf1505bd38e32da14eb69.tar.bz2 colobot-a75f02089cd97b62cb7cf1505bd38e32da14eb69.zip |
Add translated freedesktop 'Desktop Entry' file
- Add po4a as build-dependency for travis
(but it fallsback to english-only if not found)
- Add (easy) french translation
Diffstat (limited to 'src/desktop')
-rw-r--r-- | src/desktop/CMakeLists.txt | 25 | ||||
-rw-r--r-- | src/desktop/colobot.desktop.in | 4 | ||||
-rw-r--r-- | src/desktop/colobot.ini | 3 | ||||
-rwxr-xr-x | src/desktop/create_desktop_file.sh | 18 | ||||
-rw-r--r-- | src/desktop/po/colobot-desktop.pot | 32 | ||||
-rw-r--r-- | src/desktop/po/fr.po | 32 | ||||
-rw-r--r-- | src/desktop/po4a.cfg | 3 |
7 files changed, 117 insertions, 0 deletions
diff --git a/src/desktop/CMakeLists.txt b/src/desktop/CMakeLists.txt new file mode 100644 index 0000000..6deac2f --- /dev/null +++ b/src/desktop/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 2.8) + +# Install Desktop Entry file +set(COLOBOT_DESKTOP_FILE colobot.desktop) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE} + COMMAND ./create_desktop_file.sh > ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Build ${COLOBOT_DESKTOP_FILE}" + ) +add_custom_target(desktopfile ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE}) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${COLOBOT_DESKTOP_FILE} + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/ + ) + +find_program(PO4A po4a) + +if(PO4A) + add_custom_target(desktop_po4a + COMMAND ${PO4A} po4a.cfg + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + add_dependencies(desktopfile desktop_po4a) +endif() diff --git a/src/desktop/colobot.desktop.in b/src/desktop/colobot.desktop.in new file mode 100644 index 0000000..ddb7264 --- /dev/null +++ b/src/desktop/colobot.desktop.in @@ -0,0 +1,4 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=colobot diff --git a/src/desktop/colobot.ini b/src/desktop/colobot.ini new file mode 100644 index 0000000..136e008 --- /dev/null +++ b/src/desktop/colobot.ini @@ -0,0 +1,3 @@ +Name="Colobot" +GenericName="Game to learn programming" +Comment="Colonize with bots" diff --git a/src/desktop/create_desktop_file.sh b/src/desktop/create_desktop_file.sh new file mode 100755 index 0000000..e0f120b --- /dev/null +++ b/src/desktop/create_desktop_file.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +# Create colobot.desktop from various colobot.ini's + +fname=colobot.ini + +cat colobot.desktop.in + +linguas=$([ ! -d lang ] || ( cd lang ; ls)); + +for type in Name GenericName Comment; do + egrep "^$type=" $fname | sed -e "s/^$type=\"\(.*\)\"$/$type=\1/g" + for l in $linguas; do + egrep "^$type=" lang/$l/$fname | sed -e "s/^$type=\"\(.*\)\"$/$type[$l]=\1/g" + done +done diff --git a/src/desktop/po/colobot-desktop.pot b/src/desktop/po/colobot-desktop.pot new file mode 100644 index 0000000..e74136a --- /dev/null +++ b/src/desktop/po/colobot-desktop.pot @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2012-12-26 15:05+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: colobot.ini:1 +#, no-wrap +msgid "Colobot" +msgstr "" + +#: colobot.ini:2 +#, no-wrap +msgid "Game to learn programming" +msgstr "" + +#: colobot.ini:3 +#, no-wrap +msgid "Colonize with bots" +msgstr "" diff --git a/src/desktop/po/fr.po b/src/desktop/po/fr.po new file mode 100644 index 0000000..63dbb23 --- /dev/null +++ b/src/desktop/po/fr.po @@ -0,0 +1,32 @@ +# French translations for PACKAGE package +# Copyright (C) 2012 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2012-12-26 15:05+0100\n" +"PO-Revision-Date: 2012-12-26 15:05+0100\n" +"Last-Translator: Didier Raboud <odyx@debian.org>\n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: colobot.ini:1 +#, no-wrap +msgid "Colobot" +msgstr "Colobot" + +#: colobot.ini:2 +#, no-wrap +msgid "Game to learn programming" +msgstr "Apprentissage de la programmation par le jeu" + +#: colobot.ini:3 +#, no-wrap +msgid "Colonize with bots" +msgstr "Colonise avec des roBots" diff --git a/src/desktop/po4a.cfg b/src/desktop/po4a.cfg new file mode 100644 index 0000000..eda2985 --- /dev/null +++ b/src/desktop/po4a.cfg @@ -0,0 +1,3 @@ +[po_directory] po/ + +[type:ini] colobot.ini $lang:lang/$lang/colobot.ini |