# TRANSLATORS: Tranlate the values in quotes
volatile.q_label = "Q"; # appears before questions as Q:
volatile.a_label = "A"; # appears before answers as A:
# NO TRANSLATION NEEDED BEYOND THIS POINT
# KHP 18/Aug/2010 - added base_util, required by get_current_language()
include "templates.util.base_util";
# docs_user_chapter_link() returns a link to an option documentation page in the user guide, given the shortcut or option name
subroutine(docs_user_chapter_link(string chapter), (
expand("");
$("docs.user_guide.page_titles." . chapter);
"";
)); # docs_user_chapter_link
# start_docs_page() starts a documentation page with the specified title
subroutine(start_docs_page(string title), (
# KHP 06/Sep/2010 - Set output language
string user_node_name = node_name(volatile.authenticated_user_node_path);
string current_language = get_current_language(user_node_name);
set_language(current_language);
# debug_message("#### start_docs_page() - user_node_name: " . user_node_name . "\n");
# debug_message("#### start_docs_page() - current_language: " . current_language . "\n");
volatile.docs_page_title = title;
#debug_message("volatile.docs_page_title: " . volatile.docs_page_title . "\n");
docs.header;
'
\n';
" \n";
expand(' ' . title . ' | \n');
"
\n";
"
\n";
'\n';
" \n";
" \n";
if (internal.docs.tab eq 'USER') and (internal.docs.index eq 'FALSE') then (
' ';
'';
)
else (
' ';
);
));
subroutine(end_docs_page, (
" | \n";
"
\n";
"
\n";
docs.footer;
));
# docs_option_link() returns a link to an option documentation page, given the shortcut or option name
subroutine(docs_option_link(string option), (
# Get the full node name for this option
# echo("option: " . option);
string fullOptionName;
if (node_exists("default_profile." . option)) then
fullOptionName = "default_profile." . option;
else if (node_exists(option)) then
fullOptionName = option;
# 2011-09-26: If it's a subnode of log source, use the option path as the full option name (it's in "default" in default_profile, but not in lang_options).
else if (matches_regular_expression(option, "^default_profile[.]log[.]source[.](.*)$")) then
fullOptionName = option;
else
fullOptionName = get_node_name_from_shortcut(option);
# echo("fullOptionName: " . fullOptionName);
# Get the option name within the profile
string optionNameForURL = fullOptionName;
if (starts_with(fullOptionName, "default_profile.")) then
optionNameForURL = "profile." . substr(optionNameForURL, length("default_profile."));
# Get the option label
string label;
if (optionNameForURL ne "") then
label = $("lang_options." . optionNameForURL . ".label");
else
label = "[unknown]";
string result = expand("$label");
result;
)); # docs_option_link
# remove_prefix() -- this removes a prefix p from string s
subroutine(remove_prefix(string s, string p), (
if (starts_with(s, p)) then
s = substr(s, length(p));
s;
));
# docs_chapter_link() returns a link to an option documentation page, given the shortcut or option name
subroutine(docs_chapter_link(string chapter), (
expand("");
$("docs.technical_manual.page_titles." . chapter);
"";
)); # docs_chapter_link
# docs_chapter_link_with_anchor() returns a link to an option documentation page, given the shortcut or option name
subroutine(docs_chapter_link_with_anchor(string chapter, string anchor, string label), (
expand("");
label;
"";
)); # docs_chapter_link_with_anchor
# docs_function_link() returns a link to a Salang function
subroutine(docs_function_link(string function), (
"";
"" . function . "()
";
"";
)); # docs_function
# docs_faq_link() returns a link to an FAQ entry, given the name
subroutine(docs_faq_link(string name), (
expand("");
$("docs.faq.db." . name . ".label");
"";
)); # docs_faq_link
# docs_user_faq_link() returns a link to an FAQ entry in the User FAQ, given the name
subroutine(docs_user_faq_link(string name), (
expand("");
$("docs.user_faq.db." . name . ".label");
"";
)); # docs_user_faq_link
# docs_faq_short_description() returns a short description of a FAQ entry
subroutine(docs_faq_short_description(string name), (
expand("$volatile.q_label: ") . $("docs.faq.db." . name . ".question") . "
\n";
expand("$volatile.a_label: ") . $("docs.faq.db." . name . ".short_answer") . "\n";
"For full details, see " . docs_faq_link(name) . ".
\n";
"
\n";
)); # docs_faq_short_description
# docs_user_faq_short_description() returns a short description of a FAQ entry from the User FAQ
subroutine(docs_user_faq_short_description(string name), (
expand("$volatile.q_label: ") . $("docs.user_faq.db." . name . ".question") . "
\n";
expand("$volatile.a_label: ") . $("docs.user_faq.db." . name . ".short_answer") . "\n";
"For full details, see " . docs_user_faq_link(name) . ".
\n";
"
\n";
)); # docs_user_faq_short_description