Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Internationalize contents of your site

Documentation / Quick help & how-to's / Internationalize contents of your site

A quick list of actions to achieve content internationalization in Cotonti Siena

 

Here are the essential steps:

  1. Install the "Content Internationalization" plugin in Administration / Extensions.
  2. Go to Administration / Configuration / Content Internationalization.
  3. Set there root category codes where you want to apply i18n, e.g. "articles, news".
  4. Set there locales it will be translated into (the first locale is the main one), e.g.: 
    en|English
    nl|Nederlands
    de|Deutsch
  5. Go to Administration / Structure / Pages / Structure Internationalization and translate category names and descriptions into each of your (non-main) locales.
  6. Add these controls to your page.tpl
    <!-- BEGIN: I18N_LANG -->
    {PHP.L.Language}:
    <ul>
    	<!-- BEGIN: I18N_LANG_ROW -->
    	<li><a href="{I18N_LANG_ROW_URL}">{I18N_LANG_ROW_TITLE}</a></li>
    	<!-- END: I18N_LANG_ROW -->
    </ul>
    <!-- END: I18N_LANG -->
    {PAGE_I18N_TRANSLATE} {PAGE_I18N_DELETE}
  7. Now if you open a page from one of the category trees you specified in 2) you can click "Translate" and translate into one of the other locales.
  8. If you need a language selector in your header.tpl, here is what it might look like:
    <!-- BEGIN: I18N_LANG -->
    <ul>
    	<!-- BEGIN: I18N_LANG_ROW -->
    	<li>
    		<a href="{I18N_LANG_ROW_URL}" title="{I18N_LANG_ROW_TITLE}"><img src="images/flags/{I18N_LANG_ROW_FLAG}.png" alt="{I18N_LANG_ROW_CODE}" /></a>
    	</li>
    	<!-- END: I18N_LANG_ROW -->
    </ul>
    <!-- END: I18N_LANG -->

That's it.



1. elfrenazo  2012-06-20 05:39

Thanks: 0

thanks

2. Denisbox  2016-08-15 06:35

Thanks: 0

Спасибо за дополнение!

3. cotemplate  2017-01-04 11:41

Thanks: 0

# Language selector
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(ru|ua|en|de|nl)/(.*) index.php?rwr=$2&l=$1 [QSA,NC,NE]

Так лушче

4. cotemplate  2017-01-04 19:05

Thanks: 0

Финальный вариант:

# Language selector
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]{2})/(.*)$  $2?l=$1 [L,QSA]
RewriteRule ^([a-z]{2})$  index.php?l=$1 [L,QSA]

Total: 4, on page: 4

Only registered users can post new comments