1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 #include "nel/misc/displayer.h"
25 #include "gus_client_manager.h"
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37 // the text set for a given language
42 CLangText(const NLMISC::CSString
& languageCode
);
43 const NLMISC::CSString
& getLanguageCode() const;
45 const ucstring
& get(const NLMISC::CSString
& tokenName
) const;
46 void set(const NLMISC::CSString
& tokenName
,const ucstring
& txt
);
47 void set(const NLMISC::CSString
& tokenName
,const NLMISC::CSString
& txt
);
51 void getTokenNameSet(std::set
<NLMISC::CSString
>& result
,bool clearResultFirst
=true);
54 NLMISC::CSString _Code
;
55 typedef std::map
<NLMISC::CSString
,ucstring
> TTexts
;
60 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
67 // read a file of text strings
68 bool read(const NLMISC::CSString
& fileName
);
70 // set the active language
71 void setLanguage(const NLMISC::CSString
& languageCode
);
72 // lookup a string trying the active lagugage first, and otherwise the default string set
73 const ucstring
& get(const NLMISC::CSString
& tokenName
) const;
75 // lookup a string for a given language
76 const ucstring
& get(const NLMISC::CSString
& languageCode
,const NLMISC::CSString
& tokenName
) const;
77 // set a string for a given language
78 void set(const NLMISC::CSString
& languageCode
,const NLMISC::CSString
& tokenName
,const ucstring
& txt
);
79 // set a string for the default string set
80 void set(const NLMISC::CSString
& tokenName
,const ucstring
& txt
);
82 // display a little info on the set of languages loaded
85 // get hold of the set of token names
86 void getTokenNameSet(std::set
<NLMISC::CSString
>& result
);
89 NLMISC::CSString _ActiveLanguage
;
90 typedef std::vector
<CLangText
> TLangTexts
;
91 TLangTexts _LangTexts
;
97 //-----------------------------------------------------------------------------