[Super-tux-commit] supertux/lib/app setup.cpp,1.22,1.23 setup.h,1.12,1.13
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2004-12-02 01:42:08
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv539/lib/app Modified Files: setup.cpp setup.h Log Message: Made lispfiles translatable. This time the translations are stored externally in .po files in the same directory as the lisp files. So you can have translation files for complete level subsets now. Because Ricardo added a hacked solution before and because people already used that, someone has to go over all the maps now, extract the translations and put them into separate files, I'm too lazy to do that now, I just translated some files for testing. Translation-Patches are always welcome ;-) Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- setup.cpp 2 Dec 2004 00:25:27 -0000 1.22 +++ setup.cpp 2 Dec 2004 01:41:57 -0000 1.23 @@ -252,6 +252,15 @@ return sdirs; } +std::string FileSystem::dirname(const std::string& filename) +{ + std::string::size_type p = filename.find_last_of('/'); + if(p == std::string::npos) + return ""; + + return filename.substr(0, p+1); +} + void Setup::init(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version) Index: setup.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- setup.h 2 Dec 2004 00:25:27 -0000 1.12 +++ setup.h 2 Dec 2004 01:41:57 -0000 1.13 @@ -35,6 +35,8 @@ static std::set<std::string> read_directory(const std::string& pathname); static std::set<std::string> dsubdirs(const std::string& rel_path, const std::string& expected_file); static std::set<std::string> dfiles(const std::string& rel_path, const std::string& glob, const std::string& exception_str); + + static std::string dirname(const std::string& filename); }; /// All you need to get an application up and running |