~ubuntu-branches/ubuntu/vivid/notecase/vivid

« back to all changes in this revision

Viewing changes to src/gui/GuiLanguage.h

  • Committer: Bazaar Package Importer
  • Author(s): Vijay(Vijay)
  • Date: 2007-06-14 00:13:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070614001348-z9e2vbgtenb9nhoo
Tags: 1.5.6-0ubuntu1
* New Upstream release 
*  The libgnomevfs2-dev is also added to Build-Depends 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
////////////////////////////////////////////////////////////////////////////
2
 
// NoteCase notes manager project <http://notecase.sf.net>
3
 
//
4
 
// This code is licensed under BSD license.See "license.txt" for more details.
5
 
//
6
 
// File: Class for handling internationalisation issues (message catalogs)
7
 
////////////////////////////////////////////////////////////////////////////
8
 
 
9
 
#ifndef GUILANGUAGE_H__
10
 
#define GUILANGUAGE_H__
11
 
 
12
 
#if _MSC_VER > 1000
13
 
#pragma once
14
 
#endif // _MSC_VER > 1000
15
 
 
16
 
#ifdef _WIN32
17
 
 #pragma warning (disable: 4786)
18
 
#endif
19
 
#include <vector>
20
 
#include <string>
21
 
#include <locale.h>     //LC_ALL
22
 
 
23
 
class GuiLanguage  
24
 
{
25
 
public:
26
 
        GuiLanguage(const char *szPackage, const char *szLocaleDir, const char *szSourceISO = NULL);
27
 
        virtual ~GuiLanguage();
28
 
 
29
 
        //sets locale
30
 
        void Initialize(const char *szIsoCode);
31
 
 
32
 
        std::string GetCurLanguage(){ return m_strCurLang; }
33
 
        int  GetCatalogCount(){ return m_lstCatalogs.size(); };
34
 
        std::string GetCatalogAt(int nIdx){ return m_lstCatalogs[nIdx]; };
35
 
        
36
 
        int      GetLocaleIdx(const char *szLocale);
37
 
        bool IsLocaleAvailable(const char *szLocale);
38
 
 
39
 
        int  GetLocaleTableIdx(const char *locale);
40
 
        const char *GetLocale();
41
 
 
42
 
        static const char *GetLangName(const char *locale);
43
 
        static const char *GetLocaleCode(const char *szLocale);
44
 
        static const char *QueryLocale(int category = LC_ALL);
45
 
 
46
 
protected:
47
 
        void ListAvailableCatalogs();
48
 
 
49
 
protected:
50
 
        std::string m_strPackage;               //usually program name
51
 
        std::string m_strLocaleDir;             //directory where to keep localisations (message catalogs)
52
 
        std::string m_strCurLang;               //current language ISO code ("en","hr",...)
53
 
        std::string m_strDefaultISO;    //ISO code of language used within source code ("en","hr",...)
54
 
        
55
 
        std::vector<std::string> m_lstCatalogs; //list of available locales
56
 
};
57
 
 
58
 
#endif // GUILANGUAGE_H__
 
1
////////////////////////////////////////////////////////////////////////////
 
2
// NoteCase notes manager project <http://notecase.sf.net>
 
3
//
 
4
// This code is licensed under BSD license.See "license.txt" for more details.
 
5
//
 
6
// File: Class for handling internationalisation issues (message catalogs)
 
7
////////////////////////////////////////////////////////////////////////////
 
8
 
 
9
#ifndef GUILANGUAGE_H__
 
10
#define GUILANGUAGE_H__
 
11
 
 
12
#if _MSC_VER > 1000
 
13
#pragma once
 
14
#endif // _MSC_VER > 1000
 
15
 
 
16
#if _MSC_VER > 1000
 
17
  #pragma warning (disable: 4786)
 
18
#endif
 
19
 
 
20
#include <vector>
 
21
#include <string>
 
22
#include <locale.h>     //LC_ALL
 
23
 
 
24
class GuiLanguage  
 
25
{
 
26
public:
 
27
        GuiLanguage(const char *szPackage, const char *szLocaleDir, const char *szSourceISO = NULL);
 
28
        virtual ~GuiLanguage();
 
29
 
 
30
        //sets locale
 
31
        void Initialize(const char *szIsoCode);
 
32
 
 
33
        std::string GetCurLanguage(){ return m_strCurLang; }
 
34
        int  GetCatalogCount(){ return m_lstCatalogs.size(); };
 
35
        std::string GetCatalogAt(int nIdx){ return m_lstCatalogs[nIdx]; };
 
36
        bool IsCurLangRTL();
 
37
        
 
38
        int      GetLocaleIdx(const char *szLocale);
 
39
        bool IsLocaleAvailable(const char *szLocale);
 
40
 
 
41
        int  GetLocaleTableIdx(const char *locale);
 
42
        const char *GetLocale();
 
43
 
 
44
        static const char *GetLangName(const char *locale);
 
45
        static const char *GetLocaleCode(const char *szLocale);
 
46
        static const char *QueryLocale(int category = LC_ALL);
 
47
 
 
48
        void ListAvailableCatalogs();
 
49
 
 
50
protected:
 
51
        std::string m_strPackage;               //usually program name
 
52
        std::string m_strLocaleDir;             //directory where to keep localisations (message catalogs)
 
53
        std::string m_strCurLang;               //current language ISO code ("en","hr",...)
 
54
        std::string m_strDefaultISO;    //ISO code of language used within source code ("en","hr",...)
 
55
        
 
56
        std::vector<std::string> m_lstCatalogs; //list of available locales
 
57
        bool m_bCatalogsListed;
 
58
        int m_nLangIdx;
 
59
};
 
60
 
 
61
#endif // GUILANGUAGE_H__