DtMsgs.c 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these librararies and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: DtMsgs.c /main/7 1996/06/19 11:27:11 cde-dec $ */
  24. /*
  25. * DtWidget/DtMsgs.c
  26. */
  27. /*** const causes the HP compiler to complain. Remove reference until ***
  28. *** the build and integration people can figure out how to get this to ***
  29. *** work. ***/
  30. /* #define CONST const */
  31. #define CONST
  32. #ifdef I18N_MSG
  33. #include <nl_types.h>
  34. #if !defined(NL_CAT_LOCALE)
  35. #define NL_CAT_LOCALE 0
  36. #endif
  37. #define _DTWIDGET_CAT_NAME "DtWidget"
  38. #endif /* I18N_MSG */
  39. #include <DtWidgetI.h>
  40. /*** Common messages across libDtWidget ***/
  41. CONST char _DtMsgCommon_0000[] =
  42. "Close";
  43. CONST char _DtMsgCommon_0001[] =
  44. "Help";
  45. /*** ComboBox.c ***/
  46. CONST char _DtMsgComboBox_0000[] =
  47. "DtComboBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
  48. CONST char _DtMsgComboBox_0001[] =
  49. "DtComboBoxWidget: Invalid marginHeight resource (defaulting to 2).";
  50. CONST char _DtMsgComboBox_0002[] =
  51. "DtComboBoxWidget: Invalid marginWidth resource (defaulting to 2).";
  52. CONST char _DtMsgComboBox_0003[] =
  53. "DtComboBoxWidget: Invalid horizontalSpacing resource (defaulting to 0).";
  54. CONST char _DtMsgComboBox_0004[] =
  55. "DtComboBoxWidget: Invalid verticalSpacing resource (defaulting to 0).";
  56. CONST char _DtMsgComboBox_0005[] =
  57. "DtComboBoxWidget: Invalid orientation resource (defaulting to DtRIGHT).";
  58. CONST char _DtMsgComboBox_0006[] =
  59. "DtComboBoxWidget: Invalid itemCount resource (defaulting to 0).";
  60. CONST char _DtMsgComboBox_0007[] =
  61. "DtComboBoxWidget: Invalid selectedPosition resource (defaulting to 0).";
  62. CONST char _DtMsgComboBox_0008[] =
  63. "DtComboBoxWidget: Unable to set textField resource.";
  64. CONST char _DtMsgComboBox_0009[] =
  65. "DtComboBoxWidget: Unable to find item to set (DtComboBoxSetItem).";
  66. CONST char _DtMsgComboBox_0010[] =
  67. "DtComboBoxWidget: Unable to find item to select (DtComboBoxSelectItem).";
  68. CONST char _DtMsgComboBox_0011[] =
  69. "Resizing failed. Maybe longest item is wider than space allowed.";
  70. CONST char _DtMsgComboBox_0012[] =
  71. "ComboBox";
  72. CONST char _DtMsgComboBox_0013[] =
  73. "cvtStringToType: wrongParameters, String to XmRType conversion needs no extra arguments";
  74. CONST char _DtMsgComboBox_0014[] =
  75. "DtComboBoxDeletePos: wrongParameters, Invalid position value";
  76. /*** DialogBox.c TitleBox.c ***/
  77. CONST char _DtMsgDialogBox_0000[] =
  78. "Incorrect child type.";
  79. /*** DialogBox.c ***/
  80. CONST char _DtMsgDialogBox_0001[] =
  81. "Invalid button position.";
  82. /*** Editor.c & SearchDlg.c ***/
  83. /* Default value for DtNformatSettingsDialogTitle */
  84. CONST char _DtMsgEditor_0000[] =
  85. "Format Settings";
  86. /* Default values for DtNleftMarginFieldLabel and DtNrightMarginFieldLabel */
  87. CONST char _DtMsgEditor_0001[] =
  88. "Right Margin:";
  89. CONST char _DtMsgEditor_0002[] =
  90. "Left Margin:";
  91. /* Default values for DtNleftAlignToggleLabel, DtNrightAlignToggleLabel, */
  92. /* DtNjustifyToggleLabel, and DtNcenterToggleLabel */
  93. CONST char _DtMsgEditor_0003[] =
  94. "Left Align";
  95. CONST char _DtMsgEditor_0004[] =
  96. "Right Align";
  97. CONST char _DtMsgEditor_0005[] =
  98. "Justify";
  99. CONST char _DtMsgEditor_0006[] =
  100. "Center";
  101. /* Default values for DtNformatParagraphButtonLabel and */
  102. /* DtNformatAllButtonLabel */
  103. CONST char _DtMsgEditor_0007[] =
  104. "Paragraph";
  105. CONST char _DtMsgEditor_0008[] =
  106. "All";
  107. /* Default value for DtNspellDialogTitle resource */
  108. CONST char _DtMsgEditor_0009[] =
  109. "Spell";
  110. /* Default value for DtNfindChangeDialogTitle resource */
  111. CONST char _DtMsgEditor_0010[] =
  112. "Find/Change";
  113. /* Default value for DtNmisspelledListLabel resource */
  114. CONST char _DtMsgEditor_0011[] =
  115. "Misspelled Words:";
  116. /* Default value for DtNfindFieldLabel resource */
  117. CONST char _DtMsgEditor_0012[] =
  118. "Find:";
  119. /* Default value for DtNchangeFieldLabel resource */
  120. CONST char _DtMsgEditor_0013[] =
  121. "Change To:";
  122. /* Default value for DtNfindButtonLabel, DtNchangeButtonLabel, and */
  123. /* DtNchangeAllButtonLabel resources */
  124. CONST char _DtMsgEditor_0014[] =
  125. "Find";
  126. CONST char _DtMsgEditor_0015[] =
  127. "Change";
  128. CONST char _DtMsgEditor_0016[] =
  129. "Change All";
  130. /* 'Unable to locate word' message */
  131. CONST char _DtMsgEditor_0017[] =
  132. "Unable to find the string %s in the current document.";
  133. /* Default value for DtNinformationDialogTitle resource */
  134. CONST char _DtMsgEditor_0018[] =
  135. "Information";
  136. /* Default values for DtNcurrentLineLabel, DtNtotalLineCountLabel,
  137. * DtNoverstrikeLabel, and DtNinsertLabel resources */
  138. CONST char _DtMsgEditor_0019[] =
  139. "Line:";
  140. CONST char _DtMsgEditor_0020[] =
  141. "Total:";
  142. CONST char _DtMsgEditor_0021[] =
  143. "Overstrike";
  144. CONST char _DtMsgEditor_0022[] =
  145. " ";
  146. /* Default values for messages and title when spell filter is
  147. * not executable or not found */
  148. CONST char _DtMsgEditor_0023[] =
  149. "Error executing spell filter.";
  150. CONST char _DtMsgEditor_0024[] =
  151. "Check to see if filter, %s, is installed and in the path.";
  152. CONST char _DtMsgEditor_0025[] =
  153. "Editor Error";
  154. /*** Icon.c ***/
  155. CONST char _DtMsgIcon_0000[] =
  156. "Incorrect alignment.";
  157. CONST char _DtMsgIcon_0001[] =
  158. "Incorrect behavior.";
  159. CONST char _DtMsgIcon_0002[] =
  160. "Incorrect fill mode.";
  161. CONST char _DtMsgIcon_0003[] =
  162. "Incorrect string or pixmap position.";
  163. CONST char _DtMsgIcon_0004[] =
  164. "Incorrect margin width or height.";
  165. /*** Icon.c TitleBox.c ***/
  166. CONST char _DtMsgIcon_0005[] =
  167. "Incorrect shadow type.";
  168. /*** Indicator.c ***/
  169. #ifdef _SUN_OS
  170. CONST char _DtMsgIndicator_0000[] =
  171. "/usr/spool/mail/";
  172. #else
  173. CONST char _DtMsgIndicator_0000[] =
  174. "/usr/mail/";
  175. #endif
  176. /*** MenuButton.c ***/
  177. CONST char _DtMsgMenuButton_0000[] =
  178. "XmNmenuPost has illegal value.";
  179. CONST char _DtMsgMenuButton_0001[] =
  180. "DtMenuButtonWidget: Invalid Parent.";
  181. CONST char _DtMsgMenuButton_0002[] =
  182. "DtMenuButtonWidget: Invalid Submenu.";
  183. /*** SpinBox.c ***/
  184. CONST char _DtMsgSpinBox_0000[] =
  185. "DtSpinBoxWidget: Invalid arrowSensitivity resource (defaulting to DtARROWS_SENSITIVE).";
  186. CONST char _DtMsgSpinBox_0001[] =
  187. "DtSpinBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
  188. CONST char _DtMsgSpinBox_0002[] =
  189. "DtSpinBoxWidget: Invalid initialDelay resource (defaulting to 250).";
  190. CONST char _DtMsgSpinBox_0003[] =
  191. "DtSpinBoxWidget: Invalid marginHeight resource (defaulting to 2).";
  192. CONST char _DtMsgSpinBox_0004[] =
  193. "DtSpinBoxWidget: Invalid marginWidth resource (defaulting to 2).";
  194. CONST char _DtMsgSpinBox_0005[] =
  195. "DtSpinBoxWidget: Invalid arrowLayout resource (defaulting to DtARROWS_BEGINNING).";
  196. CONST char _DtMsgSpinBox_0006[] =
  197. "DtSpinBoxWidget: Invalid repeatDelay resource (defaulting to 200).";
  198. CONST char _DtMsgSpinBox_0007[] =
  199. "DtSpinBoxWidget: Invalid itemCount resource (defaulting to 0).";
  200. CONST char _DtMsgSpinBox_0008[] =
  201. "DtSpinBoxWidget: Invalid position resource (defaulting to 0).";
  202. CONST char _DtMsgSpinBox_0009[] =
  203. "DtSpinBoxWidget: Invalid position resource (defaulting to minimum).";
  204. CONST char _DtMsgSpinBox_0010[] =
  205. "DtSpinBoxWidget: Invalid decimalPoints resource (defaulting to 0).";
  206. CONST char _DtMsgSpinBox_0011[] =
  207. "DtSpinBoxWidget: Invalid minimum resource (defaulting to maximum).";
  208. CONST char _DtMsgSpinBox_0012[] =
  209. "DtSpinBoxWidget: Unable to set textField resource.";
  210. CONST char _DtMsgSpinBox_0013[] =
  211. "DtSpinBoxWidget: Unable to find item to set (DtSpinBoxSetItem).";
  212. CONST char _DtMsgSpinBox_0014[] =
  213. "SpinBox";
  214. /*** TitleBox.c ***/
  215. CONST char _DtMsgTitleBox_0000[] =
  216. "Incorrect title position.";
  217. CONST char _DtMsgTitleBox_0001[] =
  218. "Incorrect title alignment.";
  219. CONST char _DtMsgTitleBox_0002[] =
  220. "Only one child should be inserted in a frame.";
  221. CONST char _DtMsgTitleBox_0003[] =
  222. "Invalid margin width.";
  223. CONST char _DtMsgTitleBox_0004[] =
  224. "Invalid margin height.";
  225. #ifdef I18N_MSG
  226. /*****************************************************************************
  227. *
  228. * Function: _DtWidgetGetMessage
  229. *
  230. * Parameters:
  231. *
  232. * int set - The message catalog set number.
  233. *
  234. * int n - The message number.
  235. *
  236. * char *s - The default message if the message is not
  237. * retrieved from a message catalog.
  238. *
  239. * Returns: the string for set 'set' and number 'n'.
  240. *
  241. *****************************************************************************/
  242. char *
  243. _DtWidgetGetMessage(int set,
  244. int n,
  245. char *s)
  246. {
  247. char *msg;
  248. nl_catd catopen();
  249. char *catgets();
  250. static int first = 1;
  251. static nl_catd nlmsg_fd;
  252. if ( first )
  253. {
  254. _DtProcessLock();
  255. if ( first)
  256. {
  257. nlmsg_fd = catopen(_DTWIDGET_CAT_NAME, NL_CAT_LOCALE);
  258. first = 0;
  259. }
  260. _DtProcessUnlock();
  261. }
  262. msg=catgets(nlmsg_fd,set,n,s);
  263. return (msg);
  264. }
  265. #endif /* I18N_MSG */