diff options
author | RaK <RaK@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-02-23 15:17:50 +0000 |
---|---|---|
committer | RaK <RaK@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-02-23 15:17:50 +0000 |
commit | da41cc77e5600aad1f37c8409cb112dbe071de67 (patch) | |
tree | 2c2eb72239541614464bac668f437dac1349c819 | |
parent | 53fbd7857faa6572e90b7ddaac17034ba7f0c486 (diff) | |
download | vdr-plugin-muggle-da41cc77e5600aad1f37c8409cb112dbe071de67.tar.gz vdr-plugin-muggle-da41cc77e5600aad1f37c8409cb112dbe071de67.tar.bz2 |
- first i18n attempt
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@42 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | TODO | 10 | ||||
-rw-r--r-- | gd_content_interface.c | 22 | ||||
-rw-r--r-- | gd_content_interface.h | 11 | ||||
-rw-r--r-- | i18n.c | 109 | ||||
-rw-r--r-- | i18n.h | 16 | ||||
-rwxr-xr-x | mg_content_interface.c | 13 | ||||
-rw-r--r-- | muggle.c | 7 | ||||
-rw-r--r-- | vdr_menu.c | 16 | ||||
-rw-r--r-- | vdr_menu.h | 13 |
10 files changed, 190 insertions, 33 deletions
@@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.7 2004/02/12 09:15:07 LarsAC Exp $ +# $Id: Makefile,v 1.8 2004/02/23 15:41:21 RaK Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. @@ -40,13 +40,13 @@ PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): -INCLUDES += -I$(VDRDIR) -I$(DVBDIR)/include -I/usr/include/mysql/ +INCLUDES += -I$(VDRDIR) -I$(VDRDIR)/include -I$(DVBDIR)/include -I/usr/include/mysql/ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): -OBJS = $(PLUGIN).o vdr_menu.o mg_database.o mg_content_interface.o gd_content_interface.o mg_tools.o mg_media.o mg_filters.o +OBJS = $(PLUGIN).o vdr_menu.o mg_database.o mg_content_interface.o gd_content_interface.o mg_tools.o mg_media.o mg_filters.o i18n.o BINOBJS = mg_database.o mg_content_interface.o gd_content_interface.o mg_tools.o mg_media.o mg_filters.o ### Targets: @@ -5,6 +5,7 @@ Code polishing ============== - check for memory leaks - check for (reasonably) consistent usage of char*/string +- mg_database is not used Short term items ================ @@ -14,9 +15,6 @@ OSD - DisplayTrackInfo - DisplayAlbumInfo - Edit playlist (means moving tracks around?) -- handle filters: - - create tracklist from filter - - create tree from filter - i18n Content @@ -41,3 +39,9 @@ Visions - handle films - handle off-line media (CDs, DVDs) - handle EPG + +Already Done +============ +- handle filters: + - create tracklist from filter + - create tree from filter diff --git a/gd_content_interface.c b/gd_content_interface.c index 7913744..0f741c0 100644 --- a/gd_content_interface.c +++ b/gd_content_interface.c @@ -3,8 +3,8 @@ * \brief Data Objects for content (e.g. mp3 files, movies) * for the vdr muggle plugindatabase ******************************************************************** - * \version $Revision: 1.16 $ - * \date $Date: 2004/02/14 22:02:45 $ + * \version $Revision: 1.17 $ + * \date $Date: 2004/02/23 15:41:21 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner * \author file owner: $Author: RaK $ * @@ -22,6 +22,7 @@ #include "gd_content_interface.h" #include "mg_tools.h" +#include "i18n.h" using namespace std; @@ -92,9 +93,9 @@ gdFilterSets::gdFilterSets() rating->push_back("++"); // title - filter = new mgFilterString("title", ""); set->push_back(filter); + filter = new mgFilterString(tr("title"), ""); set->push_back(filter); // artist - filter = new mgFilterString("artist", ""); set->push_back(filter); + filter = new mgFilterString(tr("artist"), ""); set->push_back(filter); // genre filter = new mgFilterString("genre", ""); set->push_back(filter); // year-from @@ -132,9 +133,9 @@ gdFilterSets::gdFilterSets() // artist filter = new mgFilterString("playlist author", ""); set->push_back(filter); // title - filter = new mgFilterString("title", ""); set->push_back(filter); + filter = new mgFilterString(tr("title"), ""); set->push_back(filter); // artist - filter = new mgFilterString("artist", ""); set->push_back(filter); + filter = new mgFilterString(tr("artist"), ""); set->push_back(filter); // genre filter = new mgFilterString("genre", ""); set->push_back(filter); // year-from @@ -209,12 +210,12 @@ string gdFilterSets::computeRestriction(int *viewPrt) sql_str = sql_str + " AND album.artist like '%%" + (*iter)->getStrVal() + "%%'"; } - else if(strcmp((*iter)->getName(), "title") == 0 ) + else if(strcmp((*iter)->getName(), tr("title")) == 0 ) { sql_str = sql_str + " AND tracks.title like '%%" + (*iter)->getStrVal() + "%%'"; } - else if(strcmp((*iter)->getName(), "artist") == 0 ) + else if(strcmp((*iter)->getName(), tr("artist")) == 0 ) { sql_str = sql_str + " AND tracks.artist like '%%" + (*iter)->getStrVal() + "%%'"; @@ -1290,7 +1291,7 @@ bool GdTreeNode::expand() "Album -> Track" , // label, m_restriction); m_children.push_back(new_child); - } else { + } else { new_child = new GdTreeNode(this, // parent "" , // id "Search Result", // label, @@ -1389,6 +1390,9 @@ mgContentItem* GdTreeNode::getSingleTrack() /* -------------------- begin CVS log --------------------------------- * $Log: gd_content_interface.c,v $ + * Revision 1.17 2004/02/23 15:41:21 RaK + * - first i18n attempt + * * Revision 1.16 2004/02/14 22:02:45 RaK * - mgFilterChoice Debuged * fehlendes m_type = CHOICE in mg_filters.c diff --git a/gd_content_interface.h b/gd_content_interface.h index ce86163..c572c75 100644 --- a/gd_content_interface.h +++ b/gd_content_interface.h @@ -3,10 +3,10 @@ * \brief Data Objects for content (e.g. mp3 files, movies) * for the vdr muggle plugindatabase ******************************************************************** - * \version $Revision: 1.5 $ - * \date $Date: 2004/02/12 09:15:07 $ + * \version $Revision: 1.6 $ + * \date $Date: 2004/02/23 15:41:21 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author file owner: $Author: LarsAC $ + * \author file owner: $Author: RaK $ * * Declares main classes of for content items and interfaces to SQL databases * @@ -31,6 +31,8 @@ #include "mg_media.h" #include "mg_filters.h" +#include "i18n.h" + // non-member function int GdInitDatabase(MYSQL *db); std::vector<std::string> *GdGetStoredPlaylists(MYSQL db); @@ -219,6 +221,9 @@ public: /* -------------------- begin CVS log --------------------------------- * $Log: gd_content_interface.h,v $ + * Revision 1.6 2004/02/23 15:41:21 RaK + * - first i18n attempt + * * Revision 1.5 2004/02/12 09:15:07 LarsAC * Moved filter classes into separate files * @@ -0,0 +1,109 @@ +/* + * i18n.c: Internationalization + * + * See the README file for copyright information and how to reach the author. + * + * $Id: i18n.c,v 1.1 2004/02/23 15:41:21 RaK Exp $ + */ + +#include "i18n.h" + +const tI18nPhrase Phrases[] = { + { "artist", + "Interpret", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, + { "title", + "Titel", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, + { "Add", + "Hinzufügen", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, + { "Cycle tree", + "Ansicht wechseln", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, + { "Playlist", + "Playlist", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, + { "Submenu", + "Untermenü", + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + "",// TODO + }, + { NULL } + }; @@ -0,0 +1,16 @@ +/* + * i18n.h: Internationalization + * + * See the README file for copyright information and how to reach the author. + * + * $Id: i18n.h,v 1.1 2004/02/23 15:41:21 RaK Exp $ + */ + +#ifndef _I18N__H +#define _I18N__H + +#include <vdr/i18n.h> + +extern const tI18nPhrase Phrases[]; + +#endif //_I18N__H diff --git a/mg_content_interface.c b/mg_content_interface.c index c6c2e63..5d60358 100755 --- a/mg_content_interface.c +++ b/mg_content_interface.c @@ -3,8 +3,8 @@ * \brief Data Objects for content (e.g. mp3 files, movies) * for the vdr muggle plugindatabase ******************************************************************** - * \version $Revision: 1.3 $ - * \date $Date: 2004/02/10 23:47:23 $ + * \version $Revision: 1.4 $ + * \date $Date: 2004/02/23 15:41:21 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner * \author file owner: $Author: RaK $ * @@ -320,7 +320,7 @@ mgContentItem* mgPlaylist::sneakNext() mgSelectionTreeNode::mgSelectionTreeNode(MYSQL db, int view) { m_db = db; - m_parent=NULL; + m_parent = NULL; m_level = 0; m_view = view; m_id = ""; @@ -347,7 +347,11 @@ mgSelectionTreeNode::~mgSelectionTreeNode() mgSelectionTreeNode* mgSelectionTreeNode::getParent() { + if (m_view < 100 || m_level > 1) { return m_parent; + } else { + return NULL; + } } void mgSelectionTreeNode::collapse() // removes all children (recursively) @@ -398,6 +402,9 @@ string mgSelectionTreeNode::getRestrictions() /* -------------------- begin CVS log --------------------------------- * $Log: mg_content_interface.c,v $ + * Revision 1.4 2004/02/23 15:41:21 RaK + * - first i18n attempt + * * Revision 1.3 2004/02/10 23:47:23 RaK * - views konsitent gemacht. siehe FROMJOIN * - isLeafNode angepasst fuer neue views 4,5,100,101 @@ -2,10 +2,10 @@ /*! \file muggle.c * \brief Implements a plugin for browsing media libraries within VDR ******************************************************************** - * \version $Revision: 1.3 $ - * \date $Date: 2004/02/09 19:27:52 $ + * \version $Revision: 1.4 $ + * \date $Date: 2004/02/23 15:41:21 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author file owner: $Author: MountainMan $ + * \author file owner: $Author: RaK $ */ /*******************************************************************/ @@ -21,6 +21,7 @@ static const char *MAINMENUENTRY = "Muggle"; #include "mg_content_interface.h" #include "mg_media.h" +#include "i18n.h" const char* mgMuggle::Version(void) { @@ -2,12 +2,12 @@ /*! \file vdr_menu.c * \brief Implements menu handling for browsing media libraries within VDR ******************************************************************** - * \version $Revision: 1.15 $ - * \date $Date: 2004/02/14 22:02:45 $ + * \version $Revision: 1.16 $ + * \date $Date: 2004/02/23 15:41:21 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner * \author file owner: $Author: RaK $ * - * $Id: vdr_menu.c,v 1.15 2004/02/14 22:02:45 RaK Exp $ + * $Id: vdr_menu.c,v 1.16 2004/02/23 15:41:21 RaK Exp $ */ /*******************************************************************/ @@ -24,6 +24,8 @@ #include "gd_content_interface.h" +#include "i18n.h" + #include <string> #include <vector> @@ -106,7 +108,7 @@ void mgMainMenu::SetButtons( ) if( m_state == TREE ) { - SetHelp( "Add", "Cycle tree", "Playlist", "Submenu" ); + SetHelp( tr("Add"), tr("Cycle tree"), tr("Playlist"), tr("Submenu") ); } else if( m_state == PLAYLIST ) { @@ -233,7 +235,8 @@ eOSState mgMainMenu::ProcessKey(eKeys key) { // Back pressed on root level... Go back to Main VDR menu - state = osBack; + // state = osBack; + state = osContinue; } } } @@ -638,6 +641,9 @@ void mgMainMenu::DisplayFilterSelector() /************************************************************ * * $Log: vdr_menu.c,v $ + * Revision 1.16 2004/02/23 15:41:21 RaK + * - first i18n attempt + * * Revision 1.15 2004/02/14 22:02:45 RaK * - mgFilterChoice Debuged * fehlendes m_type = CHOICE in mg_filters.c @@ -2,12 +2,12 @@ /*! \file vdr_menu.h * \brief Implements menu handling for broswing media libraries within VDR ******************************************************************** - * \version $Revision: 1.8 $ - * \date $Date: 2004/02/08 10:48:44 $ + * \version $Revision: 1.9 $ + * \date $Date: 2004/02/23 15:41:21 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author file owner: $Author: LarsAC $ + * \author file owner: $Author: RaK $ * - * $Id: vdr_menu.h,v 1.8 2004/02/08 10:48:44 LarsAC Exp $ + * $Id: vdr_menu.h,v 1.9 2004/02/23 15:41:21 RaK Exp $ * */ /*******************************************************************/ @@ -26,6 +26,8 @@ #include <list> +#include "i18n.h" + class mgMedia; class mgSelectionTreeNode; class mgPlaylist; @@ -108,6 +110,9 @@ class mgMainMenu : public cOsdMenu /************************************************************ * * $Log: vdr_menu.h,v $ + * Revision 1.9 2004/02/23 15:41:21 RaK + * - first i18n attempt + * * Revision 1.8 2004/02/08 10:48:44 LarsAC * Made major revisions in OSD behavior * |