Skip to content

Commit

Permalink
feat: Add translatable helptxt var
Browse files Browse the repository at this point in the history
  • Loading branch information
MissAllSunday committed Feb 4, 2021
1 parent 18267b9 commit b1d3c09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Themes/default/Admin.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1117,13 +1117,21 @@ function template_edit_profile_field()
<dl class="settings">
<dt>
<strong><label for="field_name">', $txt['custom_edit_name'], ':</label></strong>
<a id="field_reg_require" href="', $scripturl, '?action=helpadmin;help=translatable_fields" onclick="return reqOverlayDiv(this.href);" class="help">
<span class="main_icons help" title="', $txt['help'], '"></span>
</a>
<strong><label for="field_name">', $txt['custom_edit_name'], ':</label></strong><br>
<span class="smalltext">', $txt['custom_edit_name_desc'], '</span>
</dt>
<dd>
<input type="text" name="field_name" id="field_name" value="', $context['field']['name'], '" size="20" maxlength="40">
</dd>
<dt>
<strong><label for="field_desc">', $txt['custom_edit_desc'], ':</label></strong>
<a id="field_reg_require" href="', $scripturl, '?action=helpadmin;help=translatable_fields" onclick="return reqOverlayDiv(this.href);" class="help">
<span class="main_icons help" title="', $txt['help'], '"></span>
</a>
<strong><label for="field_desc">', $txt['custom_edit_desc'], ':</label></strong><br>
<span class="smalltext">', $txt['custom_edit_name_desc'], '</span>
</dt>
<dd>
<textarea name="field_desc" id="field_desc" rows="3" cols="40">', $context['field']['desc'], '</textarea>
Expand Down
4 changes: 4 additions & 0 deletions Themes/default/languages/Help.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@

$helptxt['field_reg_require'] = 'If this field is required during registration, it will also be required on profile changes.';

$helptxt['translatable_fields'] = 'If you wish to provide multi-language support for your custom profile fields you can use translatable tokens on both the name and description fields.<br>
Anything enclosed with braces {} will be considered as a token and will be matched against a $txt string, for example, the token: {gender} will be replaced by the value of $txt[\'gender\']<br>
It is <strong>very important</strong> to note you need to add the matched $txt string to <strong>ALL</strong> currently installed languages, it is recommended to put them on index.language.php for the translation to be available across your forum.';

// argument(s): $boarddir, $boardurl
$helptxt['cron_is_real_cron'] = 'By default, SMF adds to every page a small bit of JavaScript that prompts the user\'s browser to trigger SMF\'s cron.php in the background. This approach allows SMF to execute its scheduled tasks on a regular basis without requiring the admin to do any extra server configuration. However, some admins might prefer to configure their servers to directly execute cron.php on a regular basis. If you have done this, you can disable the JavaScript method.<br><br><strong>Note:</strong> Configuring your server to run scheduled tasks this way cannot be done from within SMF. You will need to use your server configuration software to do so. Typical tools for this purpose include <code>cron</code> (for Linux servers), <code>schtasks.exe</code> (for Windows servers), and <code>launchd</code> (for macOS servers). Most web hosting companies provide some sort of control panel interface to allow their customers to access these tools.<br><br>The path and URL for your forum\'s cron.php are:<br>Path: %1$s/cron.php<br>URL: %2$s/cron.php';

Expand Down
1 change: 1 addition & 0 deletions Themes/default/languages/ManageSettings.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
$txt['custom_edit_input'] = 'Input Settings';
$txt['custom_edit_advanced'] = 'Advanced Settings';
$txt['custom_edit_name'] = 'Name';
$txt['custom_edit_name_desc'] = 'You can use translatable tokens on this field';
$txt['custom_edit_desc'] = 'Description';
$txt['custom_edit_profile'] = 'Profile Section';
$txt['custom_edit_profile_desc'] = 'Section of profile the users will be able to edit this in.';
Expand Down

0 comments on commit b1d3c09

Please sign in to comment.