adding third column with phrase
authorVolker Birk <vb@pep-project.org>
Thu, 12 May 2016 20:00:51 +0200
changeset 6170caa732cf9a4
parent 616 6d4ea9ea1016
child 618 32fe7c8bee51
adding third column with phrase
src/pEpEngine.c
sync/gen_statemachine.ysl2
     1.1 --- a/src/pEpEngine.c	Thu May 12 19:51:53 2016 +0200
     1.2 +++ b/src/pEpEngine.c	Thu May 12 20:00:51 2016 +0200
     1.3 @@ -232,7 +232,7 @@
     1.4          sql_crashdump = "select timestamp, title, entity, description, comment"
     1.5                          " from log order by timestamp desc limit ?1 ;";
     1.6  
     1.7 -        sql_languagelist = "select lang, name from i18n_language order by lang ;";
     1.8 +        sql_languagelist = "select i18n_language.lang, name, phrase from i18n_language join i18n_token using (lang);" ;
     1.9  
    1.10          sql_i18n_token = "select phrase from i18n_token where lang = lower(?1) and id = ?2 ;";
    1.11  
    1.12 @@ -1293,6 +1293,7 @@
    1.13  
    1.14      const char *lang = NULL;
    1.15      const char *name = NULL;
    1.16 +    const char *phrase = NULL;
    1.17  
    1.18      sqlite3_reset(session->languagelist);
    1.19  
    1.20 @@ -1304,12 +1305,17 @@
    1.21          case SQLITE_ROW:
    1.22              lang = (const char *) sqlite3_column_text(session->languagelist, 0);
    1.23              name = (const char *) sqlite3_column_text(session->languagelist, 1);
    1.24 +            phrase = (const char *) sqlite3_column_text(session->languagelist, 2);
    1.25  
    1.26              _languages = _concat_string(_languages, lang, ',');
    1.27              if (_languages == NULL)
    1.28                  goto enomem;
    1.29  
    1.30 -            _languages = _concat_string(_languages, name, '\n');
    1.31 +            _languages = _concat_string(_languages, name, ',');
    1.32 +            if (_languages == NULL)
    1.33 +                goto enomem;
    1.34 +
    1.35 +            _languages = _concat_string(_languages, phrase, '\n');
    1.36              if (_languages == NULL)
    1.37                  goto enomem;
    1.38  
     2.1 --- a/sync/gen_statemachine.ysl2	Thu May 12 19:51:53 2016 +0200
     2.2 +++ b/sync/gen_statemachine.ysl2	Thu May 12 20:00:51 2016 +0200
     2.3 @@ -20,6 +20,7 @@
     2.4          // types
     2.5  
     2.6          typedef pEp_identity * Identity;
     2.7 +        typedef stringlist_t * Stringlist;
     2.8          typedef union _param { const Identity partner; const stringlist_t *keylist; } param_t;
     2.9  
    2.10          // error values