|
|
|
@ -23,6 +23,15 @@ static const char* langs[] = {
|
|
|
|
|
"ja",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const char* string_for_language( int lang )
|
|
|
|
|
{
|
|
|
|
|
if( lang == 0 ) { return NULL; }
|
|
|
|
|
if( lang == clang_unknown ) { return NULL; }
|
|
|
|
|
if( lang - 1 >= sizeof(langs)/sizeof(langs[0]) ) { return NULL; }
|
|
|
|
|
|
|
|
|
|
return langs[ lang - 1 ];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool context_eat( struct json_pull_parser* jpp, int* save )
|
|
|
|
|
{
|
|
|
|
|
json_pull_parser_read_value(jpp,NULL);
|
|
|
|
@ -121,9 +130,11 @@ static bool context_writer( struct json_writer* jw, const char* field_name, void
|
|
|
|
|
first = false;
|
|
|
|
|
json_write_string( jw->f, ctx->extra.items[i] );
|
|
|
|
|
}
|
|
|
|
|
if( ctx->language ) {
|
|
|
|
|
const char* lang_string = string_for_language( ctx->language );
|
|
|
|
|
if( lang_string ) {
|
|
|
|
|
if( !first ) { fprintf( jw->f, "," ); }
|
|
|
|
|
fprintf( jw->f, ",{ \"@language\":\"%s\"", langs[ctx->language-1] );
|
|
|
|
|
first = false;
|
|
|
|
|
fprintf( jw->f, "{\"@language\":\"%s\"}", lang_string );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( items > 1 ) {
|
|
|
|
|