ONO::Lib::Audio::Pro::Music::LangKit

package ONO::Lib::Audio::Pro::Music::LangKit;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2000-2025 Jos KIRPS [ www.kirps.com | jos_AT_kirps_DOT_com ]
# and The Joopita Project [ www.joopita.org | contact_AT_joopita_DOT_com ]
#
# This file, as well as other parts of the ONO Software Project or related
# elements, are FREE SOFTWARE available under the ARTISTIC LICENSE 2.0.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full license, see /ono/osr/license/LICENSE.txt, or write to
# jos_AT_kirps_DOT_com or contact_AT_joopita_DOT_com.
#
################################################################################
# END OF COPYRIGHT / LICENSE, HERE COMES THE CODE ... #
################################################################################

use strict;

###############################################################################
# music
###############################################################################

my @list = (

"### ^ENGLISH ^DEUTSCH ^FRANCAIS ^LETZEBUERGESCH ^NEDERLANDS ^ESPANOL ^ITALIANO ^PORTUGUES ^DANSK ^SUOMI ^NORSK ^SVENSKA ",
"### ^en ^de ^fr ^lu ^nl ^es ^it ^pt ^da ^fi ^no ^sv ",
"music ^music ^Musik ^musique ^Musék ^ ^ ^ ^ ^ ^ ^ ^ ",
"scale ^scale ^Tonart ^gamme ^Tounart ^ ^ ^ ^ ^ ^ ^ ^ ",
"scale2 ^scale ^Tonleiter ^gamme ^Tounleeder ^ ^ ^ ^ ^ ^ ^ ^ ",
"note ^note ^Note ^note ^Nout ^ ^ ^ ^ ^ ^ ^ ^ ",
"notes ^notes ^Noten ^notes ^Nouten ^ ^ ^ ^ ^ ^ ^ ^ ",
"all_notes ^all notes ^alle Noten ^toutes les notes ^all Nouten ^ ^ ^ ^ ^ ^ ^ ^ ",
"chord ^chord ^Akkord ^accord ^Akkord ^ ^ ^ ^ ^ ^ ^ ^ ",
"chords ^chords ^Akkorde ^accords ^Akkorden ^ ^ ^ ^ ^ ^ ^ ^ ",
"major ^major ^Dur ^majeur ^Majeur ^ ^ ^ ^ ^ ^ ^ ^ ",
"minor ^mineur ^moll ^mineur ^mineur ^ ^ ^ ^ ^ ^ ^ ^ ",
"pentatonic ^pentatonic ^pentatonisch ^pentatonique ^pentatonesch ^ ^ ^ ^ ^ ^ ^ ^ ",
"blues ^blues ^Blues ^blues ^Blues ^ ^ ^ ^ ^ ^ ^ ^ ",
"flamenco ^flamenco ^Flamenco ^flamenco ^Flamenco ^ ^ ^ ^ ^ ^ ^ ^ ",

);

sub get {

#: Get the ONO Pro Audio Music langkit, this will return a hash
#: containing a number of music-related keywords.

my $lang = $_[1];

my %BLK;

foreach my $item (@list) {

if ($item !~ /^#/) {

$item =~ s~ ~~g;
$item =~ s~ \^~\^~g;

my @item_parts = split(/\^/,$item);

my $key = $item_parts[0];
my $Key = ucfirst $item_parts[0];
my $use = $item_parts[1];

if ($lang eq "de") {
if (!$item_parts[2]) {$item_parts[2] = $item_parts[1]}
$use = $item_parts[2];
}
if ($lang eq "fr") {
if (!$item_parts[3]) {$item_parts[3] = $item_parts[1]}
$use = $item_parts[3];
}
if ($lang eq "lu") {
if (!$item_parts[4]) {$item_parts[4] = $item_parts[1]}
$use = $item_parts[4];
}
if ($lang eq "nl") {
if (!$item_parts[5]) {$item_parts[5] = $item_parts[1]}
$use = $item_parts[5];
}
if ($lang eq "es") {
if (!$item_parts[6]) {$item_parts[6] = $item_parts[1]}
$use = $item_parts[6];
}
if ($lang eq "it") {
if (!$item_parts[7]) {$item_parts[7] = $item_parts[1]}
$use = $item_parts[7];
}
if ($lang eq "pt") {
if (!$item_parts[8]) {$item_parts[8] = $item_parts[1]}
$use = $item_parts[8];
}
if ($lang eq "da") {
if (!$item_parts[9]) {$item_parts[9] = $item_parts[1]}
$use = $item_parts[9];
}
if ($lang eq "fi") {
if (!$item_parts[10]) {$item_parts[10] = $item_parts[1]}
$use = $item_parts[10];
}
if ($lang eq "no") {
if (!$item_parts[11]) {$item_parts[11] = $item_parts[1]}
$use = $item_parts[11];
}
if ($lang eq "sv") {
if (!$item_parts[12]) {$item_parts[12] = $item_parts[1]}
$use = $item_parts[12];
}

$BLK{$key} = $use;
$BLK{$Key} = ucfirst $use;

}
}

return \%BLK;

}

###############################################################################
# end of script
###############################################################################

1;

__END__