nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Catalog Class Reference

#include <translations.h>

Public Member Functions

const char * Find (std::string_view context, std::string_view text) const
 The translation, or null for one there isn't.
const char * Find (std::string_view context, std::string_view one, uint64_t n) const
 A plural's form for the count, by its English for one, or null.

Static Public Member Functions

static absl::StatusOr< Catalog > Parse (std::string_view po)
static absl::StatusOr< Catalog > PseudoFrom (std::string_view pot)

Detailed Description

A language's translations, from a gettext PO file: what each English string is in the language, by its context, if it has one, with the rule its plurals follow.

Definition at line 43 of file translations.h.

Member Function Documentation

◆ Find() [1/2]

const char * nanommo::Catalog::Find ( std::string_view context,
std::string_view one,
uint64_t n ) const

A plural's form for the count, by its English for one, or null.

Definition at line 509 of file translations.cc.

◆ Find() [2/2]

const char * nanommo::Catalog::Find ( std::string_view context,
std::string_view text ) const

The translation, or null for one there isn't.

Definition at line 500 of file translations.cc.

◆ Parse()

absl::StatusOr< Catalog > nanommo::Catalog::Parse ( std::string_view po)
static

Reads a PO file. What's marked fuzzy, or left untranslated, is left out, and so is a translation with a placeholder, $0 to $9, that its English doesn't have, which absl::Substitute would have no argument for: each of those shows in English.

Definition at line 446 of file translations.cc.

◆ PseudoFrom()

absl::StatusOr< Catalog > nanommo::Catalog::PseudoFrom ( std::string_view pot)
static

The pseudo-language, from the template: each of its strings with its letters marked, a third longer, in brackets, so that the screen shows what isn't translated, and what a longer language would cut off.

Definition at line 480 of file translations.cc.


The documentation for this class was generated from the following files: