(2015-09-21, 03:35:04)mvlcek Wrote:(2015-09-20, 22:41:54)Frens Wrote: Is it posible witch languages/pages are present for make links on the page.
You can use return_i18n_available_languages() to get all available languages.
Thank for help
I make :
PHP Code:
<a href="<?php echo htmlspecialchars(return_i18n_available_languages() ); ?>">test</a>
dont now if this is the right,
now got ONE link (with name test) , if have 4 different anguae pages . so need 4 links if is posible.
i can do
PHP Code:
<div align="left">
<?php $langs = return_i18n_available_languages(return_page_slug()); ?>
<?php if (in_array('de', $langs)) { ?>
<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>">deutsch</a>
<?php } ?>
<?php if (in_array('de', $langs) && in_array('en', $langs)) { echo '|'; } ?>
<?php if (in_array('de', $langs)) { ?>
<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('en')); ?>">english</a>
<?php } ?>
</div>
But when the user ad a new language/page , they must add/edit/delete code again in the theme.
When not posible , ik make al the posible languages in the condition as above