|
@ -508,26 +508,35 @@ function game_detectlanguage( $word){ |
|
|
|
|
|
|
|
|
//The words maybe are in two languages e.g. greek or english |
|
|
//The words maybe are in two languages e.g. greek or english |
|
|
//so I try to find the correct one. |
|
|
//so I try to find the correct one. |
|
|
function game_getallletters( $word, $lang='') |
|
|
function game_getallletters( $word, $lang='', $userlanguage='') |
|
|
{ |
|
|
{ |
|
|
for(;;) |
|
|
for(;;) |
|
|
{ |
|
|
{ |
|
|
$strings = get_string_manager()->load_component_strings( 'game', ($lang == '' ? 'en' : $lang)); |
|
|
if( $lang == 'user') |
|
|
if( isset( $strings[ 'lettersall'])) |
|
|
|
|
|
{ |
|
|
{ |
|
|
$letters = $strings[ 'lettersall']; |
|
|
$letters = $userlanguage; |
|
|
$word2 = game_upper( $word, $lang); |
|
|
if( hangman_existall( $word, $letters)) |
|
|
if( hangman_existall( $word2, $letters)) |
|
|
|
|
|
return $letters; |
|
|
return $letters; |
|
|
} |
|
|
else |
|
|
|
|
|
return ''; |
|
|
|
|
|
}else |
|
|
|
|
|
{ |
|
|
|
|
|
$strings = get_string_manager()->load_component_strings( 'game', ($lang == '' ? 'en' : $lang)); |
|
|
|
|
|
if( isset( $strings[ 'lettersall'])) |
|
|
|
|
|
{ |
|
|
|
|
|
$letters = $strings[ 'lettersall']; |
|
|
|
|
|
$word2 = game_upper( $word, $lang); |
|
|
|
|
|
if( hangman_existall( $word2, $letters)) |
|
|
|
|
|
return $letters; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if( $lang == '') |
|
|
if( $lang == '') |
|
|
break; |
|
|
break; |
|
|
else |
|
|
else |
|
|
$lang = ''; |
|
|
$lang = ''; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ''; |
|
|
return ''; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|