tnlshello.pp 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {
  2. rstconv -i tnlshello.rst -o tnlshello_ru_UTF8.pot
  3. msgfmt tnlshello_ru_UTF8.pot
  4. mv messages.mo ru
  5. }
  6. program nlshello;
  7. {$mode objfpc}
  8. uses
  9. gettext, libc, ncurses;
  10. resourcestring
  11. hello_world = 'Hello world!';
  12. press_key = 'Press any key to continue!';
  13. var
  14. win : pWINDOW;
  15. begin
  16. setlocale(LC_ALL, '');
  17. try
  18. initscr();
  19. start_color;
  20. noecho;
  21. win:= newwin ( 10, COLS - 20, 5, 10);
  22. init_pair(1,COLOR_WHITE,COLOR_BLUE);
  23. init_pair(2,COLOR_RED,COLOR_BLUE);
  24. wbkgd(win, COLOR_PAIR(1));
  25. erase;
  26. refresh;
  27. box(win, ACS_VLINE, ACS_HLINE);
  28. wrefresh(win);
  29. mvwaddstr(win,1,3, curses_version);
  30. TranslateResourcestrings('%s/messages.mo');
  31. wattron(win,A_BLINK OR A_BOLD OR COLOR_PAIR(2));
  32. mvwaddstr(win,3,3, PChar(hello_world));
  33. wattroff(win,A_BLINK OR A_BOLD OR COLOR_PAIR(2));
  34. mvwaddstr(win,5,3, PChar(press_key));
  35. wrefresh(win);
  36. getch();
  37. finally
  38. endwin();
  39. end;
  40. end.