96 explicit FGTranslate(
const std::string& domain =
"core");
119 getResource(
const std::string& resourceName)
const;
143 std::string
get(
const std::string& resource,
const std::string& basicId,
144 int index = 0)
const;
156 const std::string& basicId,
int index = 0)
const;
170 const std::string& basicId,
171 const std::string& defaultValue,
172 int index = 0)
const;
185 intType cardinalNumber,
const std::string& resource,
186 const std::string& basicId,
const std::string& defaultValue,
187 int index = 0)
const;
197 std::vector<std::string>
getAll(
const std::string& resource,
198 const std::string& basicId)
const;
208 std::size_t
getCount(
const std::string& resource,
209 const std::string& basicId)
const;
223 std::shared_ptr<TranslationUnit>
224 translationUnit(
const std::string& resource,
const std::string& basicId,
225 int index = 0)
const;
234 using TranslationDomainRef = std::shared_ptr<const TranslationDomain>;
235 TranslationDomainRef _domain;
Information on plural forms for the supported languages.
Container for all TranslationResource's belonging to a domain.
flightgear::LanguageInfo::intType intType
std::vector< std::string > getAll(const std::string &resource, const std::string &basicId) const
Get all translations associated to an id (tag name).
FGTranslate(const std::string &domain="core")
Constructor.
std::size_t getCount(const std::string &resource, const std::string &basicId) const
Get the number of translatable strings with a given id (tag name).
std::string getPluralWithDefault(intType cardinalNumber, const std::string &resource, const std::string &basicId, const std::string &defaultValue, int index=0) const
Same as getWithDefault(), but for a string that has plural forms.
std::string getPlural(intType cardinalNumber, const std::string &resource, const std::string &basicId, int index=0) const
Same as get(), but for a string that has plural forms.
static void setupGhost()
Set up a Nasal type that wraps FGTranslate.
flightgear::TranslationDomain::ResourceRef getResource(const std::string &resourceName) const
Get the specified resource.
std::string getWithDefault(const std::string &resource, const std::string &basicId, const std::string &defaultValue, int index=0) const
Get a single translation, with default for missing or empty strings.
std::string get(const std::string &resource, const std::string &basicId, int index=0) const
Get a single translation.
std::shared_ptr< TranslationUnit > translationUnit(const std::string &resource, const std::string &basicId, int index=0) const
Return a shared pointer to a TranslationUnit.
FGTranslate & setDomain(const std::string &domain)
Change the domain from which to retrieve translations.
Class that holds translation resources within a domain.
std::shared_ptr< TranslationResource > ResourceRef