I have an indefinite of texts which needs to be translated into different languages,
e.g. $text1 needs to be translated in French and Hungarian.
$text1 = array ('fr', 'hr');
$text2 = array ('bg', 'el', 'hr');
$text3 = array ('bg', 'el', 'en', 'es');
$text4 = array ('bg', 'el', 'en', 'es');
$text5 = array ('bg', 'el', 'en', 'es', 'fr', 'hr');
Now I am looking for a way to combine texts and languages in order to get a minimum of language combinations, to get something like this:
$order1 = array('languages' => array('bg', 'el'), 'texts' => array ('text2', 'text3', 'text4', 'text5'));
$order2 = array('languages' => array('en', 'es'), 'texts' => array ('text3', 'text4', 'text5'));
$order3 = array('languages' => array('hr'), 'texts' => array ('text1', 'text2', 'text5'));
$order4 = array('languages' => array('fr'), 'texts' => array ('text1', 'text5'));
I have absolutly no idea how to start. Could anybody please give me a hint? Thank you very much.
$text1 = array ('fr', 'hr','text1');