diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 17 |
1 files changed, 1 insertions, 16 deletions
| @@ -667,22 +667,7 @@ int main(int argc, char *argv[]) | |||
| 667 | else | 667 | else |
| 668 | content = xs_dup(url); | 668 | content = xs_dup(url); |
| 669 | 669 | ||
| 670 | msg = msg_note(&snac, content, NULL, NULL, attl, 0); | 670 | msg = msg_note(&snac, content, NULL, NULL, attl, 0, getenv("LANG")); |
| 671 | |||
| 672 | /* set a post language according the LANG environment variable */ | ||
| 673 | const char *lang_env = getenv("LANG"); | ||
| 674 | if (xs_type(lang_env) == XSTYPE_STRING) { | ||
| 675 | /* split at the first _ */ | ||
| 676 | xs *l0 = xs_split(lang_env, "_"); | ||
| 677 | const char *lang = xs_list_get(l0, 0); | ||
| 678 | |||
| 679 | if (xs_type(lang) == XSTYPE_STRING && strlen(lang) == 2) { | ||
| 680 | /* a valid ISO language id */ | ||
| 681 | xs *cmap = xs_dict_new(); | ||
| 682 | cmap = xs_dict_set(cmap, lang, xs_dict_get(msg, "content")); | ||
| 683 | msg = xs_dict_set(msg, "contentMap", cmap); | ||
| 684 | } | ||
| 685 | } | ||
| 686 | 671 | ||
| 687 | c_msg = msg_create(&snac, msg); | 672 | c_msg = msg_create(&snac, msg); |
| 688 | 673 | ||