File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -254,22 +254,12 @@ YAML::setYAMLIndent( 3 );
254254
255255## I18N and L10N
256256
257+ Note: Support is disabled with WIO Terminal (needs a proper fs::FS implementation).
257258
258- Sample example `/lang/en-GB.yml` stored in LittleFS:
259-
260- ```yml
261- en-GB:
262- hello: world
263- blah:
264- my_array:
265- - first
266- - second
267- - third
268-
269- ```
270-
271- Load the module with ` #include <i18n/i18n.hpp> ` , assign a filesystem with ` i18n.setFS() `
272- and a locale with ` i18n.setLocale() ` , then use ` i18n.gettext() ` to access localized strings.
259+ * Load the module with `#include <i18n/i18n.hpp>`.
260+ * Assign a filesystem with `i18n.setFS()`.
261+ * Load a locale with `i18n.setLocale()`.
262+ * Use `i18n.gettext()` to access localized strings.
273263
274264
275265```cpp
@@ -280,14 +270,24 @@ and a locale with `i18n.setLocale()`, then use `i18n.gettext()` to access locali
280270#include <YAMLDuino.h>
281271#include <i18n/i18n.hpp>
282272
273+ // Sample example `/lang/en-GB.yml` stored in LittleFS:
274+ //
275+ // en-GB:
276+ // hello: world
277+ // blah:
278+ // my_array:
279+ // - first
280+ // - second
281+ // - third
282+
283283
284284void setup()
285285{
286286 Serial.begin(115200);
287287 LittleFS.begin();
288288
289- i18n.setFS( &LittleFS );
290- i18n.setLocale("en-GB"); // loads "/lang/en-GB.yml" file from LittleFS
289+ i18n.setFS( &LittleFS ); // assign LittleFS
290+ i18n.setLocale("en-GB"); // will load "/lang/en-GB.yml" language file
291291
292292 Serial.println( i18n.gettext("hello" ) ); // prints "world"
293293 Serial.println( i18n.gettext("blah:my_array:2" ) ); // prints "third"
You can’t perform that action at this time.
0 commit comments