Skip to content

Instantly share code, notes, and snippets.

@seyyah
Created November 22, 2018 10:05
Show Gist options
  • Save seyyah/00827524799a46e160cb63bdaac901e6 to your computer and use it in GitHub Desktop.
Save seyyah/00827524799a46e160cb63bdaac901e6 to your computer and use it in GitHub Desktop.
LittlevGL i18n Suggesstion
lv_label_set_text(label, "Welcome");
lv_label_set_text(label, t("Hello world!");
lv_label_set_text(label, t("There are %d errors");
lv_label_set_text(label, t("Missing translation");

📋 Reference

  1. https://github.com/votchallenge/trax/blob/master/src/strmap.c
  2. https://stackoverflow.com/questions/1472138/c-default-arguments
  3. https://guides.rubyonrails.org/i18n.html

typedef struct { int i; double x; } f_args;

#define f(...) var_f((f_args){VA_ARGS});

double var_f(f_args in){ int i_out = in.i ? in.i : 8; double x_out = in.x ? in.x : 3.14; return f_base(i_out, x_out); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment