2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 13:26:02 +00:00

UConv: fix compasspoint

git-svn-id: https://svn.fhem.de/fhem/trunk@12422 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-10-24 16:45:54 +00:00
parent ef5cb71a99
commit 1c79942a4d

View File

@ -13,15 +13,15 @@ package UConv;
#################### ####################
# Translations # Translations
my %pressure_trend_sym = { 0 => "=", 1 => "+", 2 => "-" }; my %pressure_trend_sym = ( 0 => "=", 1 => "+", 2 => "-" );
my %pressure_trend_txt = { my %pressure_trend_txt = (
"en" => { 0 => "steady", 1 => "rising", 2 => "falling" }, "en" => { 0 => "steady", 1 => "rising", 2 => "falling" },
"de" => { 0 => "gleichbleibend", 1 => "steigend", 2 => "fallend" }, "de" => { 0 => "gleichbleibend", 1 => "steigend", 2 => "fallend" },
"nl" => { 0 => "stabiel", 1 => "stijgend", 2 => "dalend" }, "nl" => { 0 => "stabiel", 1 => "stijgend", 2 => "dalend" },
"fr" => { 0 => "stable", 1 => "croissant", 2 => "décroissant" }, "fr" => { 0 => "stable", 1 => "croissant", 2 => "décroissant" },
"pl" => { 0 => "stabilne", 1 => "rośnie", 2 => "spada" }, "pl" => { 0 => "stabilne", 1 => "rośnie", 2 => "spada" },
}; );
my %compasspoint_txt = ( my %compasspoint_txt = (
"en" => [ "en" => [
@ -46,7 +46,7 @@ my %compasspoint_txt = (
], ],
); );
my %wdays_txt_en = { my %wdays_txt_en = (
"en" => { "en" => {
'Mon' => 'Mon', 'Mon' => 'Mon',
'Tue' => 'Tue', 'Tue' => 'Tue',
@ -92,7 +92,7 @@ my %wdays_txt_en = {
'Sat' => 'Sob', 'Sat' => 'Sob',
'Sun' => 'Nie', 'Sun' => 'Nie',
}, },
}; );
################################# #################################
### Inner metric conversions ### Inner metric conversions
@ -256,16 +256,16 @@ sub ft2m($;$) {
sub degrees2compasspoint($;$) { sub degrees2compasspoint($;$) {
my ( $azimuth, $lang ) = @_; my ( $azimuth, $lang ) = @_;
my @directions_txt_i18n; my $directions_txt_i18n;
if ( $lang && defined( $compasspoint_txt{$lang} ) ) { if ( $lang && defined( $compasspoint_txt{$lang} ) ) {
@directions_txt_i18n = $compasspoint_txt{$lang}; $directions_txt_i18n = $compasspoint_txt{$lang};
} }
else { else {
@directions_txt_i18n = $compasspoint_txt{en}; $directions_txt_i18n = $compasspoint_txt{en};
} }
return @directions_txt_i18n[ int( ( ( $azimuth + 11.25 ) % 360 ) / 22.5 ) ]; return @$directions_txt_i18n[ int( ( ( $azimuth + 11.25 ) % 360 ) / 22.5 ) ];
} }
################################# #################################