Releases: tobozo/YAMLDuino
Releases · tobozo/YAMLDuino
1.4.2
1.4.1
1.4.0
1.3.0
Changes
- Tested and enabled support for Teensy core
- Added i18n setLocate() + yaml/json gettext() as an optional module
I18n and L10N support
Note: Support is disabled with WIO Terminal (needs a proper fs::FS implementation).
- Load the module with
#include <i18n/i18n.hpp>
. - Assign a filesystem with
i18n.setFS()
. - Load a locale with
i18n.setLocale()
. - Use
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);
}
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
- proper implementation of boolean types as per https://yaml.org/type/bool.html
- better serialization from cJSON (all strings were being quoted)
special thanks to @mongonta0716 for testing and reporting 🙇