feat(translation): const-correct arrays of strings (#9147)

This commit is contained in:
Victor Wheeler
2025-10-30 10:15:34 -06:00
committed by GitHub
parent 6bc9ba8e23
commit 360060a963
10 changed files with 46 additions and 38 deletions
@@ -3,9 +3,10 @@
static void add_static(void)
{
static const char * languages[] = {"en", "de", "es", NULL};
static const char * tags[] = {"tiger", "lion", "rabbit", "elephant", NULL};
static const char * translations[] = {
/* Arrays are defined `const` to place them in program space instead of RAM. */
static const char * const languages[] = {"en", "de", "es", NULL};
static const char * const tags[] = {"tiger", "lion", "rabbit", "elephant", NULL};
static const char * const translations[] = {
"The Tiger", "Der Tiger", "El Tigre",
"The Lion", "Der Löwe", "El León",
"The Rabbit", "Das Kaninchen", "El Conejo",
@@ -2,12 +2,13 @@
#if LV_USE_TRANSLATION && LV_USE_DROPDOWN && LV_USE_LABEL && LV_BUILD_EXAMPLES
static const char * tags[] = {"tiger", "lion", "rabbit", "elephant", NULL};
static const char * languages[] = {"English", "Deutsch", "Español", NULL};
/* Arrays are defined `const` to place them in program space instead of RAM. */
static const char * const tags[] = {"tiger", "lion", "rabbit", "elephant", NULL};
static const char * const languages[] = {"English", "Deutsch", "Español", NULL};
static void add_static_translations(void)
{
static const char * translations[] = {
static const char * const translations[] = {
"The Tiger", "Der Tiger", "El Tigre",
"The Lion", "Der Löwe", "El León",
"The Rabbit", "Das Kaninchen", "El Conejo",
+4 -3
View File
@@ -2,12 +2,13 @@
#if LV_USE_TRANSLATION && LV_USE_DROPDOWN && LV_USE_LABEL && LV_BUILD_EXAMPLES
static const char * tags[] = {"tiger", "lion", "rabbit", "elephant", NULL};
static const char * languages[] = {"English", "Deutsch", "Español", NULL};
/* Arrays are defined `const` to place them in program space instead of RAM. */
static const char * const tags[] = {"tiger", "lion", "rabbit", "elephant", NULL};
static const char * const languages[] = {"English", "Deutsch", "Español", NULL};
static void add_static_translations(void)
{
static const char * translations[] = {
static const char * const translations[] = {
"The Tiger", "Der Tiger", "El Tigre",
"The Lion", "Der Löwe", "El León",
"The Rabbit", "Das Kaninchen", "El Conejo",