Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Extensions / Content Internationalization (i18n) of Sienna

123>>>

pieter
#1 2011-02-06 21:39
@Trustmaster,

How does the new Content Internationalization (i18n) of Sienna works?
... can we help you ...
Trustmaster
#2 2011-02-07 01:33
It works as a plugin on top of page, structure and tags. After you install the plugin, you need to specify in its configuration locales present on your site and categories where you want to apply i18n. The original locale of the contents is considered as main/reference locale. Other locales' information is stored in separate tables, so it does not affect original pages/structure.

Once you've chosen i18n categories, you'd need to translate them first. To do so, go to Admin => Pages => Structure and click "Structure Internationalization" there.

To localize a page in one of your i18n categories, enter the original page there and click on "Translate" button. It will create a new translation in a locale you choose. After that you'll be able to edit localized page just as a separate entry.

If localizations are available for current category/page, they are presented in a list (Wikipedia-style). They have similar URLs but with l=LOCALE parameter added.

If tags plugin is used, localized versions have their own tags in their native language. Support for Search and News plugins is also included.
May the Source be with you!
diablo
#3 2011-07-19 09:44

hi , great work on that plugin Trustmaster. but its lacking information how to use it. Can you explain the plugin in detail as it is on 0.94 with updates? how do we translate menu items ?

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
Twiebie
#4 2011-07-19 11:35

For menu items you can just use custom language files for your theme, such as {PHP.M.Item1} in theme.en.lang.php and for example theme.nl.lang.php.
That way they will automatically be translated when the language changes.

In the configuration you can set the categories that i18n should be applied on, such as news,files,links,downloads for example.
Then you can set the languages it needs to include such as nl|Dutch and en|English. (1 language per line).

It's best to grab the latest version of i18n from Cotonti's repository as Trustmaster has updated it recently.

Hope that helps.


This post was edited by Twiebie (2011-07-20 07:59, 7 years ago)
diablo
#5 2011-07-20 09:09

it needs a .htaccess file to work. can we get that file? i have no knowledge about redirect and rewrite modules

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
Trustmaster
#6 2011-07-20 18:31

Example for nginx webserver:

# Language selector
rewrite "^/(en|ru|de|nl)/(.*)?(.*)$" /$2?$3&l=$1;
rewrite "^/(en|ru|de|nl)/(.*)" /$2?l=$1;

Example for Apache webserver:

# Language selector
RewriteRule "^(en|ru|de|nl)/(.*)?(.*)$" $2?$3&l=$1
RewriteRule "^(en|ru|de|nl)/(.*)" $2?l=$1

Added 22 hours later:

Example language selector for header.tpl:

<!-- BEGIN: I18N_LANG -->
	<!-- 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 -->
<!-- END: I18N_LANG -->
May the Source be with you!

This post was edited by Trustmaster (2011-07-21 16:47, 7 years ago)
diablo
#7 2011-07-26 14:44

found a bug about its URL. url returns wrong link when the page is a plugin.

contact us plugin url returns as contact.php?e=contact&l=ru

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
Twiebie
#8 2011-07-26 16:33

Yep, got the same problem here..

pieter
#9 2011-07-27 06:19

This part I don't get. Where can I find this? Do I need to change something in the tpl's?

#28254 Trustmaster: 
Once you've chosen i18n categories, you'd need to translate them first. To do so, go to Admin => Pages => Structure and click "Structure Internationalization" there.

To localize a page in one of your i18n categories, enter the original page there and click on "Translate" button. It will create a new translation in a locale you choose. After that you'll be able to edit localized page just as a separate entry.
... can we help you ...
diablo
#10 2011-07-27 09:31

you need to add tags first.

Added 1 minute later:

BTW found another problem. when you change the codes of categories after you translate them everything goes down. had to make a clean siena installation since it ruined whole CMS for some reason

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
Twiebie
#11 2011-07-27 09:58
#30295 pieter:

This part I don't get. Where can I find this? Do I need to change something in the tpl's?

> #28254 Trustmaster: 
Once you've chosen i18n categories, you'd need to translate them first. To do so, go to Admin => Pages => Structure and click "Structure Internationalization" there.

To localize a page in one of your i18n categories, enter the original page there and click on "Translate" button. It will create a new translation in a locale you choose. After that you'll be able to edit localized page just as a separate entry.

Use the tag: {PAGE_I18N_TRANSLATE} in for example page.tpl

pieter
#12 2011-07-27 14:56

I'm getting there, but I get the following error:

 

Fatal error: SQL error 42S22: Column not found: 1054 Unknown column 'tag_locale' in 'where clause'

#0  cot_diefatal(SQL error 42S22: Column not found: 1054 Unknown column 'tag_locale' in 'where clause') called at [/home/k3098kru/public_html/_subsites/sai_siena/system/database.php:436]
#1  CotDB->query(SELECT `tag` FROM cot_tag_references
		WHERE tag_item = 2 AND tag_area = 'pages' AND tag_locale = 'nl') called at [/home/k3098kru/public_html/_subsites/sai_siena/plugins/tags/inc/tags.functions.php:204]
#2  cot_tag_list(2, pages, Array ([tag_locale] => nl)) called at [/home/k3098kru/public_html/_subsites/sai_siena/plugins/tags/tags.page.main.php:33]
#3  include(/home/k3098kru/public_html/_subsites/sai_siena/plugins/tags/tags.page.main.php) called at [/home/k3098kru/public_html/_subsites/sai_siena/modules/page/inc/page.main.php:128]
#4  require_once(/home/k3098kru/public_html/_subsites/sai_siena/modules/page/inc/page.main.php) called at [/home/k3098kru/public_html/_subsites/sai_siena/page.php:46]

Do I need to add it manually, or is it done via the setup?
... can we help you ...
GHengeveld
#13 2011-07-27 16:33

The tag_locale column should've been added to the cot_tag_references table by the i18n plugin installer. See plugins/i18n/setup/i18n.install.php. You can run those queries manually to fix it. It seems that you installed the tags plugin after installing the i18n plugin, which caused this code to not be executed.

pieter
#14 2011-07-27 16:45

I installed it with the install script. It was a fresh install of Siena.

 

... can we help you ...
GHengeveld
#15 2011-07-27 18:16

Likely the install script installs i18n first, then tags. If so that should be fixed.

123>>>