Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
(2013-05-05, 03:11:15)Kida Wrote: because I need a function, that returns the content to me and not prints it out directly Sad
I guess, I'll have to try writing my own return_i18n_content or sth...

... okay, done. that was quite simple actually Big Grin Big Grin now I have a return_i18n_content Wink

You can use the following to return the pages's XML and get the content using a $slug without language:
Code:
$xml = I18nFrontend::getPageData($slug);
$content = stripslashes(htmlspecialchars_decode($xml->content, ENT_QUOTES));

(2013-05-05, 12:12:16)yojoe Wrote:
Code:
find_i18n_url('samplepage',$language);

The second parameter should be the parent or null. In your case it outputs the current language and the parent (both 'en').

(2013-05-05, 12:12:16)yojoe Wrote: 2. I wanted to get a standalone link to parent (in respective language), and show it on all its slugs.
Is there maybe a builtin' function for this, rather than using below sample code ?
Code:
$bc = return_i18n_breadcrumbs(return_page_slug());
echo '<a href="'.find_i18n_url($bc[0]['url'],$language)">'.$bc[0]['menu'].'</a></li>';

Your code gives a link to top-most ancestor (if you are on third level or below) - and the second parameter to find_i18n_url is wrong again. In general you don't need to specify the language, if it should not change.

To get a link to the parent, you can also use
Code:
get_i18n_link(get_parent(false));
If you use fancy urls, use the newest plugin version 3.1.1.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
rewrite language problem - by tomkop - 2013-03-27, 06:34:44
RE: Support for multilanguage sites, Internationalization (I18N) - by mvlcek - 2013-05-05, 15:37:16
Enhancement suggestion - by hameau - 2013-05-12, 04:17:12
Enhancement request - by hameau - 2013-06-14, 20:02:07
RE: Enhancement request - by mvlcek - 2013-06-14, 22:04:12
RE: Enhancement request - by hameau - 2013-06-14, 23:01:36
Duplicate language cookies bug - by enzy - 2013-08-20, 07:03:26
RE: Duplicate language cookies bug - by ohayo - 2013-08-20, 18:12:25
Plugin is not shown - by tosho - 2013-09-15, 12:10:37
1000 pages limit in i18n_navigation - by titus - 2014-10-13, 21:58:36
Bug found - by lbarsov - 2014-10-17, 03:41:53
Menu with picture - by Dimi - 2015-04-28, 16:05:45
Rendering Menu in Component - by Alexander_ - 2016-05-04, 23:06:51
Meta desc for different languages - by Alexander_ - 2017-02-14, 20:29:32
Hierarchical Menus - by celextel - 2019-07-26, 16:41:47
Ri18n_navigation - by celextel - 2021-02-19, 16:07:48



Users browsing this thread: 3 Guest(s)