Bot releases are visible (Hide)
Published by tobozo almost 2 years ago
Published by tobozo almost 2 years ago
Note: Support is disabled with WIO Terminal (needs a proper fs::FS implementation).
#include <i18n/i18n.hpp>
.i18n.setFS()
.i18n.setLocale()
.i18n.gettext()
to access localized strings.
#include <LittleFS.h>
#include <ArduinoJson.h>
#define YAML_DISABLE_CJSON // not needed here
#include <YAMLDuino.h>
#include <i18n/i18n.hpp>
// Sample example `/lang/en-GB.yml` stored in LittleFS:
//
// en-GB:
// hello: world
// blah:
// my_array:
// - first
// - second
// - third
void setup()
{
Serial.begin(115200);
LittleFS.begin();
i18n.setFS( &LittleFS ); // assign LittleFS
i18n.setLocale("en-GB"); // will load "/lang/en-GB.yml" language file
Serial.println( i18n.gettext("hello" ) ); // prints "world"
Serial.println( i18n.gettext("blah:my_array:2" ) ); // prints "third"
}
void loop()
{
delay(1000);
}
Published by tobozo almost 2 years ago
Published by tobozo almost 2 years ago
Published by tobozo almost 2 years ago
Published by tobozo about 2 years ago
YAML_LITERAL_SCALAR_STYLE
Published by tobozo about 2 years ago
special thanks to @mongonta0716 for testing and reporting 🙇
Published by tobozo about 2 years ago
Published by tobozo about 2 years ago
Published by tobozo about 2 years ago
Published by tobozo about 2 years ago
Published by tobozo about 2 years ago
initial release 🥳