#1 2014-07-21 18:09:25

epescol
Member
Registered: 2012-05-27
Posts: 86

[SOLVED] Dots problem in static translations items

in order to sort a little translations items in (bigger) modules we have use dots ...

example:

$lang['request-bar.nights']                                         = 'nights';
$lang['request-bar.people']                                         = 'people';

Now, if we want to use the native ionize translation module
CONTENT => TRANSLATIONS

when we save the translations, ionize drop the first part of the translation name until the dot :-(

Is it possible to fix this limitation or should we avoid to use dots in translation items ?

Thank you

Last edited by epescol (2014-10-10 07:46:03)

Offline

#2 2014-07-22 09:53:12

Michel-Ange
Ionize Core Team
From: Paris, France
Registered: 2010-03-22
Posts: 927
Website

Re: [SOLVED] Dots problem in static translations items

We add the dots support in 1.0.7

If you use a previous version, you can edit : application/helpers/MY_url_helper.php :

Replace, line 270 : 

$str = preg_replace('/([^a-z0-9]+)/', $separator, html_entity_decode($str, ENT_COMPAT, $charset));

by :

$str = preg_replace('/([^a-z0-9.]+)/', $separator, html_entity_decode($str, ENT_COMPAT, $charset));

Inspiration & Innovation : Websites by Partikule, Agence Web Paris

Offline

#3 2014-10-08 17:57:10

epescol
Member
Registered: 2012-05-27
Posts: 86

Re: [SOLVED] Dots problem in static translations items

Thank you :-)

this works, but Static translations dont find translation keys with dots in views  :-(

I use version 1.0.7

How must I modify /application/controllers/admin/translation.php to find also translation items with dots ?

	// Reg Expression used to find translation items in views files.
	private $reg_keys = array(
		"%ion:lang[\s]*term=\"([-_ \w:]+?)\" *\/>%",
		"%ion:lang[\s]*key=[\"']([-_ \w:]+?)[\"']([^>]*?) \/>%",
		'% Lang.get\(([-_ \w:\']+?)\)%'
	);

Last edited by epescol (2014-10-08 18:12:13)

Offline

#4 2014-10-10 07:45:14

epescol
Member
Registered: 2012-05-27
Posts: 86

Re: [SOLVED] Dots problem in static translations items

I change the function to

	// Reg Expression used to find translation items in views files.
	private $reg_keys = array(
		"%ion:lang[\s]*term=\"([\.-_ \w:]+?)\" *\/>%",
		"%ion:lang[\s]*key=[\"']([\.-_ \w:]+?)[\"']([^>]*?) \/>%",
		'% Lang.get\(([\.-_ \w:\']+?)\)%'
	);

and now it is also possible to use dots in translation items.

It would be nice if you could fix this in future releases.

Thank you for your nice work

Last edited by epescol (2014-10-10 07:49:38)

Offline

#5 2014-10-18 10:05:50

Michel-Ange
Ionize Core Team
From: Paris, France
Registered: 2010-03-22
Posts: 927
Website

Re: [SOLVED] Dots problem in static translations items

Added for next version.
Thanks for posting your fix !


Inspiration & Innovation : Websites by Partikule, Agence Web Paris

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations