Commit 45489776 authored by merlinofchaos's avatar merlinofchaos
Browse files

Add translation documentation, plus ensure .ini files can be translated.

parent ef2743cc
......@@ -487,11 +487,16 @@ function advanced_help_get_topics() {
$info = parse_ini_file("./$help_path/$module/$module.help.ini", TRUE);
}
if (!empty($info)) {
// Get translated titles:
global $language;
if (file_exists("$module_path/po/help/$language->language/module.help.ini")) {
$translation = parse_ini_file("$module_path/po/help/$language->language/module.help.ini", TRUE);
}
foreach ($info as $name => $topic) {
// each topic should have a name, a title, a file and of course the path.
$topics[$module][$name] = array(
'name' => $name,
'title' => $topic['title'],
'title' => !empty($translation['name']['title']) ? $translation['name']['title'] : $topic['title'],
'weight' => isset($topic['weight']) ? $topic['weight'] : 0,
'parent' => isset($topic['parent']) ? $topic['parent'] : 0,
'file' => $topic['file'] . '.html', // require extension
......
[using-advanced-help]
title = Using advanced help
file = using-advanced-help
weight = -10
[translation]
title = Translating advanced help
file = translation
\ No newline at end of file
<p>To translate advanced help, first create a <b>po/help/$language</b> directory
in the module directory. Then, copy the .ini file and all .html files from
the help directory.</p>
<p>The .ini file only needs to keep the titles; those should be translated. The rest of the data in the .ini file maybe discarded or ignored.</p>
<p>Each file should then be translated in place.</p>
\ No newline at end of file
......@@ -35,6 +35,6 @@ link to link.</p>
within the help directory, such as images to embed within the help.</p>
<p>
If the search module is enabled, this help system will be indexed on cron. If you enable new modules and immediately want to search its help, visit <a href="/admin/settings/run-cron">run cron</a> to facilitate this.</p>
If the search module is enabled, this help system will be indexed on cron. If you enable new modules and immediately want to search its help, visit <a href="/admin/reports/status/run-cron">run cron</a> to facilitate this.</p>
<p>Example: <a href="path:nowhere.jpg">Don't click this!</a></p>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment