Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 27, 2008, 12:54:00 AM (16 years ago)
Author:
landauf
Message:

changed naming in Language: translation → localisation, name → label

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/orxonox/core/Language.h

    r826 r838  
    3030    @brief Definition of the Language and the LanguageEntry class.
    3131
    32     The Language class is used, to get a translation of a string in the configured language.
    33     The string is identified by another string, the name of the entry.
     32    The Language class is used, to get a localisation of a string in the configured language.
     33    The string is identified by another string, the label of the entry.
    3434    If the translation in the configured language isn't available, the default entry, defined in the code, is used.
    3535
    3636    Usage:
    3737     - Set the entry with the default string:
    38        Language::getLanguage()->addEntry("name of the entry", "the string to translate");
     38       Language::getLanguage()->addEntry("label of the entry", "the string to translate");
    3939
    40      - Get the translation of the entry in the configured language:
    41        std::cout << Language::getLanguage()->getTranslation("name of the entry") << std::endl;
     40     - Get the localisation of the entry in the configured language:
     41       std::cout << Language::getLanguage()->getLocalisation("name of the entry") << std::endl;
    4242*/
    4343
     
    6161        public:
    6262            explicit LanguageEntry(const std::string& fallbackEntry);
    63             void setTranslation(const std::string& translation);
     63            void setLocalisation(const std::string& localisation);
    6464            void setDefault(const std::string& fallbackEntry);
    6565
    6666            /**
    67               @brief Returns the translated entry in the configured language.
     67              @brief Returns the localised entry in the configured language.
    6868              @return The translated entry
    6969            */
    70             inline const std::string& getTranslation()
    71                 { return this->translatedEntry_; }
     70            inline const std::string& getLocalisation()
     71                { return this->localisedEntry_; }
    7272
    7373            /**
     
    8080        private:
    8181            std::string fallbackEntry_;                             //!< The default entry: Used, if no translation is available or no language configured
    82             std::string translatedEntry_;                           //!< The translated entry in the configured language
    83             bool bTranslationSet_;                                  //!< True if the translation was set
     82            std::string localisedEntry_;                            //!< The localised entry in the configured language
     83            bool bLocalisationSet_;                                 //!< True if the translation was set
    8484    };
    8585    template class _CoreExport orxonox::ClassIdentifier<LanguageEntry>;
     
    9999            static Language& getLanguage();
    100100            void setConfigValues();
    101             void addEntry(const LanguageEntryName& name, const std::string& entry);
    102             const std::string& getTranslation(const LanguageEntryName& name) const;
     101            void addEntry(const LanguageEntryLabel& label, const std::string& entry);
     102            const std::string& getLocalisation(const LanguageEntryLabel& label) const;
    103103
    104104        private:
     
    111111            void writeDefaultLanguageFile() const;
    112112            static const std::string getFileName(const std::string& language);
    113             LanguageEntry* createEntry(const LanguageEntryName& name, const std::string& entry);
     113            LanguageEntry* createEntry(const LanguageEntryLabel& label, const std::string& entry);
    114114
    115115            std::string language_;                                  //!< The configured language
    116116            std::string defaultLanguage_;                           //!< The default language
    117             std::string defaultTranslation_;                        //!< The returned string, if an entry unavailable entry is requested
    118             std::map<std::string, LanguageEntry*> languageEntries_; //!< A map to store all LanguageEntry objects and their name
     117            std::string defaultLocalisation_;                       //!< The returned string, if an entry unavailable entry is requested
     118            std::map<std::string, LanguageEntry*> languageEntries_; //!< A map to store all LanguageEntry objects and their labels
    119119    };
    120120    template class _CoreExport orxonox::ClassIdentifier<Language>;
Note: See TracChangeset for help on using the changeset viewer.