diff --git a/build.xml b/build.xml index 0dc4529fb..4756419ae 100644 --- a/build.xml +++ b/build.xml @@ -739,6 +739,13 @@ classpath="build/" /> + + + + + diff --git a/data/freecol.png b/data/freecol.png new file mode 100644 index 000000000..23e46739f Binary files /dev/null and b/data/freecol.png differ diff --git a/data/strings/FreeColMessages.properties b/data/strings/FreeColMessages.properties index 54a81779a..f759570d0 100644 --- a/data/strings/FreeColMessages.properties +++ b/data/strings/FreeColMessages.properties @@ -20,6 +20,9 @@ # --1-- General, Menus and File Manipulation +freecol.desktopEntry.GenericName=Strategy Game +freecol.desktopEntry.Comment=A turn-based strategy game based on "Sid Meier's Colonization". + ok=OK cancel=Cancel reset=Reset diff --git a/data/strings/FreeColMessages_de.properties b/data/strings/FreeColMessages_de.properties index 6909b192e..1c4ce112f 100644 --- a/data/strings/FreeColMessages_de.properties +++ b/data/strings/FreeColMessages_de.properties @@ -29,6 +29,9 @@ # Author: Umherirrender # Author: Xqt +freecol.desktopEntry.GenericName=Strategiespiel +freecol.desktopEntry.Comment=Ein von "Sid Meier's Colonization" inspiriertes, rundenbasiertes Strategiespiel. + ok=Okay cancel=Abbrechen reset=Zurücksetzen diff --git a/src/net/sf/freecol/tools/DesktopEntry.java b/src/net/sf/freecol/tools/DesktopEntry.java new file mode 100644 index 000000000..57a702d32 --- /dev/null +++ b/src/net/sf/freecol/tools/DesktopEntry.java @@ -0,0 +1,108 @@ +/** + * Copyright (C) 2002-2011 The FreeCol Team + * + * This file is part of FreeCol. + * + * FreeCol is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * FreeCol is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FreeCol. If not, see . + */ + + +package net.sf.freecol.tools; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.FilenameFilter; + + +public class DesktopEntry { + + private static final File SOURCE_DIRECTORY = + new File("data/strings"); + + private static final String GENERIC_NAME = + "freecol.desktopEntry.GenericName"; + private static final String COMMENT = + "freecol.desktopEntry.Comment"; + + + public static void main(String[] args) throws Exception { + + FileWriter result = new FileWriter(".desktop"); + result.append("[Desktop Entry]\n"); + result.append("Version=1.0\n"); + result.append("Type=Application\n"); + result.append("Name=FreeCol\n"); + result.append("Exec=freecol\n"); + result.append("Icon=data/freecol.png\n"); + result.append("Categories=Game;StrategyGame;\n"); + + String[] sourceFiles = SOURCE_DIRECTORY.list(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.startsWith("FreeColMessages") + && name.endsWith(".properties"); + } + }); + + for (String name : sourceFiles) { + + System.out.println("Processing source file: " + name); + + String languageCode = null; + if (name.startsWith("FreeColMessages_")) { + int index = name.indexOf('.', 16); + languageCode = name.substring(16, index) + .replace('-', '@'); + } + + boolean found = false; + File sourceFile = new File(SOURCE_DIRECTORY, name); + FileReader fileReader = new FileReader(sourceFile); + BufferedReader bufferedReader = new BufferedReader(fileReader); + String line = bufferedReader.readLine(); + while (line != null) { + int index = line.indexOf('='); + if (index >= 0) { + String key = line.substring(0, index).trim(); + if (GENERIC_NAME.equals(key)) { + result.append("GenericName"); + } else if (COMMENT.equals(key)) { + result.append("Comment"); + } else { + line = bufferedReader.readLine(); + continue; + } + if (languageCode != null) { + result.append("[" + languageCode + "]"); + } + result.append("="); + result.append(line.substring(index + 1).trim()); + result.append("\n"); + if (found) { + break; + } else { + found = true; + } + } + line = bufferedReader.readLine(); + } + } + + result.flush(); + result.close(); + + } +} + diff --git a/src/net/sf/freecol/tools/InstallerTranslations.java b/src/net/sf/freecol/tools/InstallerTranslations.java index 940b144d0..96acffc94 100644 --- a/src/net/sf/freecol/tools/InstallerTranslations.java +++ b/src/net/sf/freecol/tools/InstallerTranslations.java @@ -58,7 +58,7 @@ public class InstallerTranslations { { "ms", "mys", "Malaysian" }, { "nl", "ned", "Nederlands" }, { "nn", "nor", "Norwegian" }, - { "pl", "pol", "Polnish" }, + { "pl", "pol", "Polish" }, { "pt_BR", "por", "Portuguese (Brazilian)" }, { "pt_PT", "prt", "Portuguese (European)" }, { "ro", "rom", "Romanian" },