DtMsgs.c 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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 libraries 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 <Dt/MsgCatP.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. CONST char _DtMsgIndicator_0000[] =
  170. "/var/mail/";
  171. /*** MenuButton.c ***/
  172. CONST char _DtMsgMenuButton_0000[] =
  173. "XmNmenuPost has illegal value.";
  174. CONST char _DtMsgMenuButton_0001[] =
  175. "DtMenuButtonWidget: Invalid Parent.";
  176. CONST char _DtMsgMenuButton_0002[] =
  177. "DtMenuButtonWidget: Invalid Submenu.";
  178. /*** SpinBox.c ***/
  179. CONST char _DtMsgSpinBox_0000[] =
  180. "DtSpinBoxWidget: Invalid arrowSensitivity resource (defaulting to DtARROWS_SENSITIVE).";
  181. CONST char _DtMsgSpinBox_0001[] =
  182. "DtSpinBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
  183. CONST char _DtMsgSpinBox_0002[] =
  184. "DtSpinBoxWidget: Invalid initialDelay resource (defaulting to 250).";
  185. CONST char _DtMsgSpinBox_0003[] =
  186. "DtSpinBoxWidget: Invalid marginHeight resource (defaulting to 2).";
  187. CONST char _DtMsgSpinBox_0004[] =
  188. "DtSpinBoxWidget: Invalid marginWidth resource (defaulting to 2).";
  189. CONST char _DtMsgSpinBox_0005[] =
  190. "DtSpinBoxWidget: Invalid arrowLayout resource (defaulting to DtARROWS_BEGINNING).";
  191. CONST char _DtMsgSpinBox_0006[] =
  192. "DtSpinBoxWidget: Invalid repeatDelay resource (defaulting to 200).";
  193. CONST char _DtMsgSpinBox_0007[] =
  194. "DtSpinBoxWidget: Invalid itemCount resource (defaulting to 0).";
  195. CONST char _DtMsgSpinBox_0008[] =
  196. "DtSpinBoxWidget: Invalid position resource (defaulting to 0).";
  197. CONST char _DtMsgSpinBox_0009[] =
  198. "DtSpinBoxWidget: Invalid position resource (defaulting to minimum).";
  199. CONST char _DtMsgSpinBox_0010[] =
  200. "DtSpinBoxWidget: Invalid decimalPoints resource (defaulting to 0).";
  201. CONST char _DtMsgSpinBox_0011[] =
  202. "DtSpinBoxWidget: Invalid minimum resource (defaulting to maximum).";
  203. CONST char _DtMsgSpinBox_0012[] =
  204. "DtSpinBoxWidget: Unable to set textField resource.";
  205. CONST char _DtMsgSpinBox_0013[] =
  206. "DtSpinBoxWidget: Unable to find item to set (DtSpinBoxSetItem).";
  207. CONST char _DtMsgSpinBox_0014[] =
  208. "SpinBox";
  209. /*** TitleBox.c ***/
  210. CONST char _DtMsgTitleBox_0000[] =
  211. "Incorrect title position.";
  212. CONST char _DtMsgTitleBox_0001[] =
  213. "Incorrect title alignment.";
  214. CONST char _DtMsgTitleBox_0002[] =
  215. "Only one child should be inserted in a frame.";
  216. CONST char _DtMsgTitleBox_0003[] =
  217. "Invalid margin width.";
  218. CONST char _DtMsgTitleBox_0004[] =
  219. "Invalid margin height.";
  220. #ifdef I18N_MSG
  221. /*****************************************************************************
  222. *
  223. * Function: _DtWidgetGetMessage
  224. *
  225. * Parameters:
  226. *
  227. * int set - The message catalog set number.
  228. *
  229. * int n - The message number.
  230. *
  231. * char *s - The default message if the message is not
  232. * retrieved from a message catalog.
  233. *
  234. * Returns: the string for set 'set' and number 'n'.
  235. *
  236. *****************************************************************************/
  237. char *
  238. _DtWidgetGetMessage(int set,
  239. int n,
  240. char *s)
  241. {
  242. char *msg;
  243. static int first = 1;
  244. static nl_catd nlmsg_fd;
  245. if ( first )
  246. {
  247. _DtProcessLock();
  248. if ( first)
  249. {
  250. nlmsg_fd = CATOPEN(_DTWIDGET_CAT_NAME, NL_CAT_LOCALE);
  251. first = 0;
  252. }
  253. _DtProcessUnlock();
  254. }
  255. msg=CATGETS(nlmsg_fd,set,n,s);
  256. return (msg);
  257. }
  258. #endif /* I18N_MSG */