From: <lk...@us...> - 2007-12-13 09:49:39
|
Revision: 1151 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1151&view=rev Author: lkuech Date: 2007-12-13 01:49:30 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Enabled multi language support. fixed the "my"-prefix bug. fixed a navigation bug with the menu of the BlueTwo skin. refactored the the namespace. Modified Paths: -------------- trunk/plugins/WorldMap/GUIWorldMap.csproj trunk/plugins/WorldMap/Installer/Worldmap.xmp trunk/plugins/WorldMap/PlugInBase.cs trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldMapSearchResults.cs trunk/plugins/WorldMap/WorldmapConfig.Designer.cs trunk/plugins/WorldMap/WorldmapConfig.cs trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/WorldmapSearch.cs trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml Added Paths: ----------- trunk/plugins/WorldMap/LocalizeStrings.cs trunk/plugins/WorldMap/language/ trunk/plugins/WorldMap/language/MyWorldmap/ trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml Modified: trunk/plugins/WorldMap/GUIWorldMap.csproj =================================================================== --- trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-12-13 09:49:30 UTC (rev 1151) @@ -61,6 +61,7 @@ </Reference> </ItemGroup> <ItemGroup> + <Compile Include="LocalizeStrings.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> Modified: trunk/plugins/WorldMap/Installer/Worldmap.xmp =================================================================== --- trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 09:49:30 UTC (rev 1151) @@ -8,7 +8,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\bin\Release\GUIWorldmap.dll</Source> <Id>01010</Id> <Option /> - <Guid>0390f2ca-304a-4184-9ef7-daa21547649f</Guid> + <Guid>150d9039-90cb-41c4-9e22-9e0382676428</Guid> </File> <File> <FileName>GUIWorldmap.xml</FileName> @@ -17,7 +17,7 @@ <Source>GUIWorldmap.xml</Source> <Id>01010</Id> <Option /> - <Guid>9869589b-dc7f-4d63-b12a-034131b4e642</Guid> + <Guid>b0f4f614-918d-4562-a378-62a490df965b</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -26,206 +26,224 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>54a37bf8-1c6b-4de9-81ce-50f90695872f</Guid> + <Guid>0e59df06-8cdd-4e4d-b061-92fcbfdce298</Guid> </File> <File> - <FileName>WMIPBlocked.jpeg</FileName> + <FileName>hover_worldmap.png</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> + <SubType>%Skin%\BlueTwo\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>be36be7a-3245-4fb0-a495-b5ca75a00dfe</Guid> + <Guid>6987f549-1f62-4670-8dc7-c62d60d6351a</Guid> </File> <File> - <FileName>WMprogressBarActive.png</FileName> + <FileName>MyWorldMap.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> + <SubType>%Skin%\BlueTwo wide</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>0d13ea2d-8fe9-46d1-a687-3e51821a773c</Guid> + <Guid>e3b4a7d2-45b3-44c3-92cf-d205d01bba3c</Guid> </File> <File> - <FileName>WMprogressBarQueued.png</FileName> + <FileName>MyWorldMap.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>248e6bb8-e410-4180-b25a-2037d466467d</Guid> + <Guid>05f01705-359d-4536-8023-7a33419e1f50</Guid> </File> <File> - <FileName>WMprogressDummy.png</FileName> + <FileName>MyWorldmapMenu.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> + <SubType>%Skin%\BlueTwo wide</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>374f1c3f-039f-424b-ab30-e3ce799fccc8</Guid> + <Guid>d595127f-9f85-4963-aa31-67ab316b3318</Guid> </File> <File> - <FileName>WMTileNotAvailable.jpeg</FileName> + <FileName>MyWorldmapMenu.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>70132c77-e7d2-4b7c-8297-41429bfde3b6</Guid> + <Guid>5b7b849a-065a-47a1-a62a-b5103594a570</Guid> </File> <File> - <FileName>WMTilePlaceholder.jpeg</FileName> + <FileName>MyWorldmapSearch.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> + <SubType>%Skin%\BlueTwo wide</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>9ec4cbd1-e94b-4cf0-9032-982fe1a21bf2</Guid> + <Guid>f0764712-a889-41b7-aa21-71e7f787d448</Guid> </File> <File> - <FileName>MyWorldMap.xml</FileName> + <FileName>MyWorldmapSearch.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>60ce0a34-e30e-40bf-bef0-e9fd75ea9a0a</Guid> + <Guid>01659dc8-3403-474a-8e2b-0af9e4718f02</Guid> </File> <File> - <FileName>MyWorldmapMenu.xml</FileName> + <FileName>MyWorldmapSearchResults.xml</FileName> <Type>Other</Type> <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>a5b6eb86-7ada-47f5-ae6b-3ad2175a6646</Guid> + <Guid>7fb93ce4-df48-41d7-95c5-4667fd9e597f</Guid> </File> <File> - <FileName>MyWorldmapSearch.xml</FileName> + <FileName>MyWorldmapSearchResults.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>7e67dab3-07dd-4fff-a585-db8c99683875</Guid> + <Guid>944e69b0-f988-4651-8a0f-74fbfb5b7e23</Guid> </File> <File> - <FileName>MyWorldmapSearchResults.xml</FileName> + <FileName>strings_de.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> + <SubType>%Language%\MyWorldmap</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_de.xml</Source> <Id>04010</Id> <Option /> - <Guid>df094da5-a0aa-476c-b57c-5e18d8c2c606</Guid> + <Guid>2a2845f6-3074-4960-90e1-38de1a9d969a</Guid> </File> <File> - <FileName>hover_worldmap.png</FileName> + <FileName>strings_en.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> + <SubType>%Language%\MyWorldmap</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_en.xml</Source> <Id>04010</Id> <Option /> - <Guid>e7c4af1b-6b07-413f-ade5-07b5a313335f</Guid> + <Guid>86b5bd30-e28e-4cf5-9eca-82d32847660c</Guid> </File> <File> + <FileName>System.Data.SQLite.DLL</FileName> + <Type>Plugin</Type> + <SubType>Window</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> + <Id>01010</Id> + <Option /> + <Guid>c14130a2-c7de-44ef-97ef-fcb5245a9989</Guid> + </File> + <File> <FileName>WMIPBlocked.jpeg</FileName> <Type>Other</Type> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> + <Id>04010</Id> + <Option /> + <Guid>d89c6076-9e44-41ab-b2a4-b829f4383d78</Guid> + </File> + <File> + <FileName>WMIPBlocked.jpeg</FileName> + <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>016a7236-aac2-4a08-a040-66127a30b586</Guid> + <Guid>5bad2483-c09a-460f-95dc-694da29643fc</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> <Type>Other</Type> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> + <Id>04010</Id> + <Option /> + <Guid>8d90b983-2ffa-48f6-a2fb-4f34046658bd</Guid> + </File> + <File> + <FileName>WMprogressBarActive.png</FileName> + <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>a644fa25-8291-4bf9-9dca-ebac34ac2d0e</Guid> + <Guid>802d738f-9bbc-494c-b4e3-8cd735214893</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>eff3f4b6-974a-4e7c-9454-746d215fba1b</Guid> + <Guid>421c2b25-8d9d-4d4a-af77-4f57d21ace90</Guid> </File> <File> - <FileName>WMprogressDummy.png</FileName> + <FileName>WMprogressBarQueued.png</FileName> <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>aae9fba4-a1b8-4e87-b444-32c1442f3e1f</Guid> + <Guid>2995e3ad-1d7c-4136-970e-a08326a696ba</Guid> </File> <File> - <FileName>WMTileNotAvailable.jpeg</FileName> + <FileName>WMprogressDummy.png</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>dc10ce65-0482-46a1-a136-6cd01d3b0976</Guid> + <Guid>0ab52df2-2ccf-460d-99b2-290eea92244e</Guid> </File> <File> - <FileName>WMTilePlaceholder.jpeg</FileName> + <FileName>WMprogressDummy.png</FileName> <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>8266623f-46ce-459c-b58e-a71b0f6922f1</Guid> + <Guid>83d51e8b-089c-4858-82c2-1e504bd9b3b8</Guid> </File> <File> - <FileName>MyWorldMap.xml</FileName> + <FileName>WMTileNotAvailable.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>779e4c1f-46b1-4472-9485-956ae2f7cee3</Guid> + <Guid>447d23fb-0661-466b-8b08-22a509534275</Guid> </File> <File> - <FileName>MyWorldmapMenu.xml</FileName> + <FileName>WMTileNotAvailable.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> + <SubType>%Skin%\BlueTwo\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>a3fc33c1-d828-4ebb-b08a-cb02a72ad920</Guid> + <Guid>3b44e93c-6d4c-4d21-abcc-3dd2b6329f2e</Guid> </File> <File> - <FileName>MyWorldmapSearch.xml</FileName> + <FileName>WMTilePlaceholder.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>581a0b87-504c-4189-b0c5-518c883ba397</Guid> + <Guid>9cdedc6a-6d29-4d8b-84ef-1c3bbbe61f2e</Guid> </File> <File> - <FileName>MyWorldmapSearchResults.xml</FileName> + <FileName>WMTilePlaceholder.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> + <SubType>%Skin%\BlueTwo\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>f116e37a-3d07-4aef-8f50-139de30e9d24</Guid> + <Guid>5659a223-6bec-4a9c-bfac-86611cfb4142</Guid> </File> - <File> - <FileName>System.Data.SQLite.DLL</FileName> - <Type>Plugin</Type> - <SubType>Window</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> - <Id>01010</Id> - <Option /> - <Guid>c4727184-da74-47b4-87b3-23809319926a</Guid> - </File> </FileList> <StringList /> <Actions /> Added: trunk/plugins/WorldMap/LocalizeStrings.cs =================================================================== --- trunk/plugins/WorldMap/LocalizeStrings.cs (rev 0) +++ trunk/plugins/WorldMap/LocalizeStrings.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -0,0 +1,262 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Globalization; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Localisation; + +namespace MediaPortal.GUI.MyWorldmap +{ + /// <summary> + /// This class will hold all text used in the application + /// The text is loaded for the current language from + /// the file language/[language]/strings.xml + /// </summary> + public class GUILocalizeStrings + { + #region Variables + static LocalisationProvider _stringProvider; + static Dictionary<string, string> _cultures; + static string[] _languages; + #endregion + + #region Constructors/Destructors + // singleton. Dont allow any instance of this class + private GUILocalizeStrings() + { + } + + static public void Dispose() + { + if (_stringProvider != null) + _stringProvider.Dispose(); + } + #endregion + + #region Public Methods + /// <summary> + /// Public method to load the text from a strings/xml file into memory + /// </summary> + /// <param name="strFileName">Contains the filename+path for the string.xml file</param> + /// <returns> + /// true when text is loaded + /// false when it was unable to load the text + /// </returns> + //[Obsolete("This method has changed", true)] + static public bool Load(string language) + { + bool isPrefixEnabled = true; + + using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + isPrefixEnabled = reader.GetValueAsBool("general", "myprefix", true); + if (language == null) language = reader.GetValueAsString("skin", "language", "English"); + } + + string directory = Config.GetSubFolder(Config.Dir.Language, "MyWorldmap"); + string cultureName = null; + if (language != null) cultureName = GetCultureName(language); + + Log.Info(" Loading localised Strings - Path: {0} Culture: {1} Language: {2} Prefix: {3}", directory, cultureName, language, isPrefixEnabled); + + _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled); + + GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters; + + return true; + } + + static public string CurrentLanguage() + { + if (_stringProvider == null) + Load(null); + + return _stringProvider.CurrentLanguage.EnglishName; + } + + static public void ChangeLanguage(string language) + { + if (_stringProvider == null) + Load(language); + else + _stringProvider.ChangeLanguage(GetCultureName(language)); + } + + /// <summary> + /// Get the translation for a given id and format the sting with + /// the given parameters + /// </summary> + /// <param name="dwCode">id of text</param> + /// <param name="parameters">parameters used in the formating</param> + /// <returns> + /// string containing the translated text + /// </returns> + static public string Get(int dwCode, object[] parameters) + { + if (_stringProvider == null) + Load(null); + + string translation = _stringProvider.GetString("unmapped", dwCode); + // if parameters or the translation is null, return the translation. + if ((translation == null) || (parameters == null)) + { + return translation; + } + // return the formatted string. If formatting fails, log the error + // and return the unformatted string. + try + { + return String.Format(translation, parameters); + } + catch (System.FormatException e) + { + Log.Error("Error formatting translation with id {0}", dwCode); + Log.Error("Unformatted translation: {0}", translation); + Log.Error(e); + return translation; + } + } + + /// <summary> + /// Get the translation for a given id + /// </summary> + /// <param name="dwCode">id of text</param> + /// <returns> + /// string containing the translated text + /// </returns> + static public string Get(int dwCode) + { + if (_stringProvider == null) + Load(null); + + string translation = _stringProvider.GetString("unmapped", dwCode); + + if (translation == null) + { + Log.Error("No translation found for id {0}", dwCode); + return String.Empty; + } + + return translation; + } + + static public void LocalizeLabel(ref string strLabel) + { + if (_stringProvider == null) + Load(null); + + if (strLabel == null) strLabel = String.Empty; + if (strLabel == "-") strLabel = ""; + if (strLabel == "") return; + // This can't be a valid string code if the first character isn't a number. + // This check will save us from catching unnecessary exceptions. + if (!char.IsNumber(strLabel, 0)) + return; + + int dwLabelID; + + try + { + dwLabelID = System.Int32.Parse(strLabel); + } + catch (FormatException e) + { + Log.Error(e); + strLabel = String.Empty; + return; + } + + strLabel = _stringProvider.GetString("unmapped", dwLabelID); + if (strLabel == null) + { + Log.Error("No translation found for id {0}", dwLabelID); + strLabel = String.Empty; + } + } + + public static string LocalSupported() + { + if (_stringProvider == null) + Load(null); + + CultureInfo culture = _stringProvider.GetBestLanguage(); + + return culture.EnglishName; + } + + public static string[] SupportedLanguages() + { + if (_languages == null) + { + if (_stringProvider == null) + Load(null); + + CultureInfo[] cultures = _stringProvider.AvailableLanguages(); + + SortedList sortedLanguages = new SortedList(); + foreach (CultureInfo culture in cultures) + sortedLanguages.Add(culture.EnglishName, culture.EnglishName); + + _languages = new string[sortedLanguages.Count]; + + for (int i = 0; i < sortedLanguages.Count; i++) + { + _languages[i] = (string)sortedLanguages.GetByIndex(i); + } + } + + return _languages; + } + + static public string GetCultureName(string language) + { + if (_cultures == null) + { + _cultures = new Dictionary<string, string>(); + + CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures); + + for (int i = 0; i < cultureList.Length; i++) + { + _cultures.Add(cultureList[i].EnglishName, cultureList[i].Name); + } + } + + if (_cultures.ContainsKey(language)) + return _cultures[language]; + + return null; + } + #endregion + } +} \ No newline at end of file Modified: trunk/plugins/WorldMap/PlugInBase.cs =================================================================== --- trunk/plugins/WorldMap/PlugInBase.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/PlugInBase.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -5,7 +5,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { public enum WorldmapWindowIDs { @@ -87,7 +87,7 @@ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { - strButtonText = "Worldmap"; + strButtonText = MyWorldmap.GUILocalizeStrings.Get(0); strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = @"hover_worldmap.png"; Modified: trunk/plugins/WorldMap/Settings.cs =================================================================== --- trunk/plugins/WorldMap/Settings.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/Settings.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -5,7 +5,7 @@ using MediaPortal.GUI.Library; using MAPS; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { class Settings { Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldMap.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -14,7 +14,7 @@ using System.IO; using MediaPortal.Configuration; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { //[PluginIcons("GUIWorldMap.worldmapicon.png", "worldmapicon_disabled.png")] public class WorldMap : PlugInBase @@ -118,10 +118,10 @@ mapTiles.mapType = currentMapType; - lblLongitude.Label = "Longitude: " + currentLongitude.ToString(); - lblLatitude.Label = "Latitude: " + currentLatitude.ToString(); + lblLongitude.Label = MyWorldmap.GUILocalizeStrings.Get(1) + currentLongitude.ToString(); + lblLatitude.Label = MyWorldmap.GUILocalizeStrings.Get(2) + currentLatitude.ToString(); lblMapType.Label = currentMapType.ToString(); - string tmpZoomModeString = "ZoomMode: " + currentZoomMode.ToString() + " : "; + string tmpZoomModeString = MyWorldmap.GUILocalizeStrings.Get(3) + currentZoomMode.ToString() + " : "; if (currentZoomMode == ZoomMode.Level) tmpZoomModeString += currentZoomLevel.ToString(); else tmpZoomModeString += currentZoomFactor.ToString(); lblZoomMode.Label = tmpZoomModeString; @@ -552,7 +552,7 @@ GUIDialogMenu Menu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); Menu.Reset(); - Menu.SetHeading("Choose a maptype"); + Menu.SetHeading(MyWorldmap.GUILocalizeStrings.Get(36)); Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); Modified: trunk/plugins/WorldMap/WorldMapSearchResults.cs =================================================================== --- trunk/plugins/WorldMap/WorldMapSearchResults.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldMapSearchResults.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -6,12 +6,14 @@ using MediaPortal.GUI.Library; using MediaPortal.Dialogs; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { class WorldMapSearchResults : GUIWindow { [SkinControlAttribute(5)] protected GUIListControl listview = null; + [SkinControlAttribute(24)] + protected GUILabelControl lblHeader = null; public List<MAPS.GeoCode> SearchResults = new List<MAPS.GeoCode>(); public int LastWindowID = -1; @@ -38,6 +40,8 @@ tmpMainWindow.FillMapTileRessources(); } + GUIControl.SetControlLabel(GetID, lblHeader.GetID, MyWorldmap.GUILocalizeStrings.Get(70)); // Search result + RefreshListView(); } Modified: trunk/plugins/WorldMap/WorldmapConfig.Designer.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -1,4 +1,4 @@ -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { partial class WorldmapConfig { Modified: trunk/plugins/WorldMap/WorldmapConfig.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapConfig.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -8,7 +8,7 @@ using MediaPortal.GUI.Library; using System.Collections; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { public partial class WorldmapConfig : Form Modified: trunk/plugins/WorldMap/WorldmapMenu.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -8,10 +8,12 @@ using MAPS; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { class WorldmapMenu : GUIWindow { + [SkinControlAttribute(1)] + protected GUILabelControl lblSearchHeader = null; [SkinControlAttribute(2)] protected GUIButtonControl btnSearchAdress = null; [SkinControlAttribute(3)] @@ -55,6 +57,14 @@ tmpMainWindow.FillMapTileRessources(); } + GUIControl.SetControlLabel(GetID, lblSearchHeader.GetID, MyWorldmap.GUILocalizeStrings.Get(30)); // Search... + GUIControl.SetControlLabel(GetID, btnSearchAdress.GetID, MyWorldmap.GUILocalizeStrings.Get(31)); // Address or Location + GUIControl.SetControlLabel(GetID, btnSearchplaceName.GetID, MyWorldmap.GUILocalizeStrings.Get(32)); // Special Location + GUIControl.SetControlLabel(GetID, btnLastResult.GetID, MyWorldmap.GUILocalizeStrings.Get(33)); // Last Search Result + GUIControl.SetControlLabel(GetID, btnPlacemarks.GetID, MyWorldmap.GUILocalizeStrings.Get(34)); // stored Placemarks + GUIControl.SetControlLabel(GetID, btnMapType.GetID, MyWorldmap.GUILocalizeStrings.Get(36)); // choose Maptype + GUIControl.SetControlLabel(GetID, btnOptions.GetID, MyWorldmap.GUILocalizeStrings.Get(37)); // options + base.OnPageLoad(); } @@ -74,7 +84,7 @@ WorldMap tmpMainWindow = (WorldMap)GUIWindowManager.GetWindow((int)WorldmapWindowIDs.MainWindow); tmpMainWindow.Render(timePassed); - btnZoomMode.Label = "Zoom" + tmpMainWindow.currentZoomMode.ToString() + " is active"; + btnZoomMode.Label = "Zoom" + tmpMainWindow.currentZoomMode.ToString() + MyWorldmap.GUILocalizeStrings.Get(35); base.Render(timePassed); } Modified: trunk/plugins/WorldMap/WorldmapSearch.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapSearch.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapSearch.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -5,7 +5,7 @@ using MediaPortal.Dialogs; using System.Threading; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { enum SearchType { @@ -99,6 +99,14 @@ tmpMainWindow.FillMapTileRessources(); } + GUIControl.SetControlLabel(GetID, lblHeader.GetID, MyWorldmap.GUILocalizeStrings.Get(50)); // Search for address or location + GUIControl.SetControlLabel(GetID, btnStreet.GetID, MyWorldmap.GUILocalizeStrings.Get(51)); // Street + GUIControl.SetControlLabel(GetID, btnCity.GetID, MyWorldmap.GUILocalizeStrings.Get(52)); // City + GUIControl.SetControlLabel(GetID, btnCountry.GetID, MyWorldmap.GUILocalizeStrings.Get(53)); // Country + GUIControl.SetControlLabel(GetID, btnPlacename.GetID, MyWorldmap.GUILocalizeStrings.Get(54)); // placename + GUIControl.SetControlLabel(GetID, btnSearch.GetID, MyWorldmap.GUILocalizeStrings.Get(55)); // Search + GUIControl.SetControlLabel(GetID, btnCancel.GetID, MyWorldmap.GUILocalizeStrings.Get(56)); // Cancel + if (SearchType == SearchType.none) SearchType = SearchType.Adress; lblStreet.Label = Street; @@ -247,8 +255,8 @@ else { GUIDialogOK tmpOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - tmpOK.SetHeading("Search Result"); - tmpOK.SetLine(1, "No result was empty"); + tmpOK.SetHeading(MyWorldmap.GUILocalizeStrings.Get(70)); + tmpOK.SetLine(1, MyWorldmap.GUILocalizeStrings.Get(71)); tmpOK.DoModal(this.GetID); } } Added: trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml (rev 0) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml 2007-12-13 09:49:30 UTC (rev 1151) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<Language name="German" characters="255"> + <Section name="unmapped"> + <String id="0" prefix="Meine ">Weltkarte</String> + <String id="1">Längengrad: </String> + <String id="2">Breitengrad: </String> + <String id="3">Zoom Modus: </String> + <String id="30">Suche...</String> + <String id="31">Adresse oder Ort</String> + <String id="32">Besondere Orte</String> + <String id="33">Letzte Suchergebnisse</String> + <String id="34">gespeicherte Orte</String> + <String id="35"> ist aktiv</String> + <String id="36">Kartentype wählen</String> + <String id="37">Optionen</String> + <String id="50">Suche Adresse oder Ort</String> + <String id="51">Straße:</String> + <String id="52">Stadt:</String> + <String id="53">Land:</String> + <String id="54">bes. Ort:</String> + <String id="55">Suche</String> + <String id="56">Abbruch</String> + <String id="70">Ergebnis der Suche</String> + <String id="71">Ergebnis war leer</String> + </Section> +</Language> \ No newline at end of file Added: trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml (rev 0) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml 2007-12-13 09:49:30 UTC (rev 1151) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<Language name="English" characters="255"> + <Section name="unmapped"> + <String id="0" prefix="My ">Worldmap</String> + <String id="1">Longitude: </String> + <String id="2">Latitude: </String> + <String id="3">Zoom Mode: </String> + <String id="30">Search...</String> + <String id="31">Address oder Location</String> + <String id="32">Special Location</String> + <String id="33">Last Search Result</String> + <String id="34">stored Placemarks</String> + <String id="35"> is active</String> + <String id="36">Choose MapType</String> + <String id="37">Options</String> + <String id="50">Search for address or location</String> + <String id="51">Street:</String> + <String id="52">City:</String> + <String id="53">Country:</String> + <String id="54">Placename:</String> + <String id="55">Search</String> + <String id="56">Cancel</String> + <String id="70">Search results</String> + <String id="71">Result was empty</String> + </Section> +</Language> \ No newline at end of file Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml 2007-12-13 09:49:30 UTC (rev 1151) @@ -91,7 +91,7 @@ <label>Switch To ...</label> <onleft>8</onleft> <onright>8</onright> - <onup>3</onup> + <onup>6</onup> <ondown>10</ondown> </control> @@ -105,8 +105,8 @@ <label>Choose maptype</label> <onleft>10</onleft> <onright>10</onright> - <onup>3</onup> - <ondown>2</ondown> + <onup>8</onup> + <ondown>12</ondown> </control> <control> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |