mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
98_help.pm: support for german
git-svn-id: https://svn.fhem.de/fhem/trunk@8035 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ba76cb5106
commit
d0c7e6b060
@ -1,4 +1,4 @@
|
|||||||
# $Id$
|
# $Id: 98_help.pm 8032 2015-02-18 18:36:37Z betateilchen $
|
||||||
#
|
#
|
||||||
package main;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
@ -13,8 +13,13 @@ sub help_Initialize($$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub CommandHelp {
|
sub CommandHelp {
|
||||||
my ($cl, $mod) = @_;
|
my ($cl, $arg) = @_;
|
||||||
|
|
||||||
|
my ($mod,$lang) = split(" ",$arg);
|
||||||
|
|
||||||
|
$lang //= "";
|
||||||
|
$lang = (lc($lang) eq 'de') ? '_DE' : '';
|
||||||
|
|
||||||
if($mod) {
|
if($mod) {
|
||||||
$mod = lc($mod);
|
$mod = lc($mod);
|
||||||
my %mods;
|
my %mods;
|
||||||
@ -37,9 +42,9 @@ sub CommandHelp {
|
|||||||
my ($err,@text) = FileRead({FileName => $mods{$mod}, ForceType => 'file'});
|
my ($err,@text) = FileRead({FileName => $mods{$mod}, ForceType => 'file'});
|
||||||
return $err if $err;
|
return $err if $err;
|
||||||
foreach my $l (@text) {
|
foreach my $l (@text) {
|
||||||
if($l =~ m/^=begin html$/) {
|
if($l =~ m/^=begin html$lang$/) {
|
||||||
$skip = 0;
|
$skip = 0;
|
||||||
} elsif($l =~ m/^=end html$/) {
|
} elsif($l =~ m/^=end html$lang$/) {
|
||||||
$skip = 1;
|
$skip = 1;
|
||||||
} elsif(!$skip) {
|
} elsif(!$skip) {
|
||||||
$output .= $l;
|
$output .= $l;
|
||||||
@ -97,13 +102,15 @@ sub CommandHelp {
|
|||||||
<a name="help"></a>
|
<a name="help"></a>
|
||||||
<h3>?, help</h3>
|
<h3>?, help</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<code>? [<moduleName>]</code><br/>
|
<code>? [<moduleName>] [de]</code><br/>
|
||||||
<code>help [<moduleName>]</code><br/>
|
<code>help [<moduleName>] [de]</code><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<ul>
|
<ul>
|
||||||
<li>returns a list of available commands, when called without a
|
<li>Returns a list of available commands, when called without a
|
||||||
moduleName</li>
|
moduleName.</li>
|
||||||
<li>returns a module dependent helptext, same as in commandref</li>
|
<li>Returns a module dependent helptext, same as in commandref.</li>
|
||||||
|
<li>When called with de as last parameter, module dependent help will be shown in German.<br/>
|
||||||
|
Please be aware: Not every modules provides a German documentation.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -114,12 +121,16 @@ sub CommandHelp {
|
|||||||
<a name="help"></a>
|
<a name="help"></a>
|
||||||
<h3>?, help</h3>
|
<h3>?, help</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<code>? [<moduleName>]</code><br/>
|
<code>? [<moduleName>] [de]</code><br/>
|
||||||
<code>help [<moduleName>]</code><br/>
|
<code>help [<moduleName>] [de]</code><br/>
|
||||||
<br>
|
<br>
|
||||||
Liefert eine Liste aller Befehle mit einer Kurzbeschreibung zurück.
|
<ul>
|
||||||
Falls moduleName spezifiziert ist, wird die modul-spezifische Hilfe
|
<li>Liefert eine Liste aller Befehle mit einer Kurzbeschreibung zurück.</li>
|
||||||
aus commandref zurückgeliefert.
|
<li>Falls moduleName spezifiziert ist, wird die modul-spezifische Hilfe
|
||||||
|
aus commandref zurückgeliefert.</li>
|
||||||
|
<li>Wird die modulspezifische Hilfe mit Parameter de aufgerufen, wird nach der deutschen Doku gesucht.<br/>
|
||||||
|
Eine deutsche Hilfe ist allerdings nicht in jedem Modul verfügbar!</li>
|
||||||
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
=end html_DE
|
=end html_DE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user