Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
custom:text.ini [2023/10/26 16:48] – [See Also] digital mancustom:text.ini [2024/03/11 21:33] (current) – link to gettext.js page digital man
Line 1: Line 1:
 ====== text.ini file ====== ====== text.ini file ======
  
-New in Synchronet v3.20, the ''text.ini'' file is an optional configuration file that a sysop can create in their Synchronet ''[[dir:ctrl]]'' directory to over-ride one or more string values in the ''text.dat'' file.+New in Synchronet v3.20, the ''text.ini'' file is an optional configuration file that a sysop can create in their Synchronet ''[[dir:ctrl]]'' directory to over-ride one or more string values in the ''text.dat'' file or in some JavaScript files (e.g. ''default.js'').
  
 The ''text.ini'' method of ''text.dat'' customization has the following advantages over modifying the ''text.dat'' file itself: The ''text.ini'' method of ''text.dat'' customization has the following advantages over modifying the ''text.dat'' file itself:
Line 13: Line 13:
   * The string syntax a bit simpler than JavaScript or Baja   * The string syntax a bit simpler than JavaScript or Baja
  
-===== How-to =====+===== How-to for text.dat string =====
 Follow the following steps to customize your ''text.dat'' strings using the ''text.ini'' file. Follow the following steps to customize your ''text.dat'' strings using the ''text.ini'' file.
  
Line 44: Line 44:
 At the minimum, users will have to logoff and back on to see any ''text.ini'' string changes. If a server doesn't automatically recycle or otherwise reload configuration files, you may need to force a recycle or restart of the server manually. At the minimum, users will have to logoff and back on to see any ''text.ini'' string changes. If a server doesn't automatically recycle or otherwise reload configuration files, you may need to force a recycle or restart of the server manually.
  
 +===== How-to for JavaScript strings =====
 +
 +Follow the following steps to customize JavaScript strings using the ''text.ini'' file.
 +
 +The text string you wish to customize must be wrapped in a call to ''gettext()'' in a JavaScript file (e.g. ''*.js'', ''*.ssjs'', or ''*.xjs'').
 +
 +  - Edit the ''[[dir:ctrl]]/text.ini'' file (create, if it doesn't already exist) using a text editor.
 +  - Add the ''[JS]'' section to end of the ''text.ini'' file, if it doesn't already exist.
 +  - Add the original string followed by equals (''='') then the new custom string, or colon ('':'') and the new custom string as a string literal
 +  - The JavaScript file must ''require()'' or ''load()'' the ''[[custom:javascript:lib:gettext.js]]'' load library.
 +
 +Example
 +<code ini>
 +[JS]
 +Find Text in Messages = find yo text bro
 +</code>
 ===== Alternate Languages =====  ===== Alternate Languages ===== 
  
 Variants of the ''text.ini'' file are supported for multiple-language support: ''[[dir:ctrl]]/text.//lang//.ini''. These files use the same format as ''text.ini'', but are required to include a ''LANG'' key/value pair (to specify the //name// of the language) and will be automatically loaded upon logon for terminal server user's that have chosen that alternate language for their user account. Variants of the ''text.ini'' file are supported for multiple-language support: ''[[dir:ctrl]]/text.//lang//.ini''. These files use the same format as ''text.ini'', but are required to include a ''LANG'' key/value pair (to specify the //name// of the language) and will be automatically loaded upon logon for terminal server user's that have chosen that alternate language for their user account.
 +
 +The alternate language ''text.//lang//.ini'' files also support the ''[JS]'' section for translated JavaScript strings.
  
 ===== See Also ===== ===== See Also =====
-  * [[text.dat]] File 
   * [[:custom:|custom index]]   * [[:custom:|custom index]]
 +  * [[text.dat]] File
 +  * [[custom:javascript:lib:gettext.js]] Library
 +  * [[:custom:localization]]
  
 {{tag>text.dat}} {{tag>text.dat}}