?
avatar humblehumanbeing
humblehumanbeing
11 Mar 2017

Steps to reproduce the issue

Add the "public static function transliterate($string)" block to language\en-GB\en-GB.localise.php to replace all accented UTF-8 characters by unaccented ones

public static function transliterate($string)  {
                $str = JString::strtolower($string);
 
                //Specific language transliteration.
                //This one is for latin 1, latin supplement , extended A, Cyrillic, Greek
 
                $glyph_array = array(
                'a'            =>   'à,á,â,ã,ä,å,ā,ă,ą,ḁ,α,ά,ā',
                'ae'   =>   'æ',
                'b'            =>   'β,б',
                'c'            =>   'ç,ć,ĉ,ċ,č,ч,ћ,ц',
                'ch'   =>   'ч',
                'd'            =>   'ď,đ,Ð,д,ђ,δ,ð,ḍ',
                'dz'   =>   'џ',
                'e'            =>   'è,é,ê,ë,ē,ĕ,ė,ę,ě,э,ε,έ,ə,ē',
                'f'            =>   'ƒ,ф',
                'g'            =>   'ğ,ĝ,ğ,ġ,ģ,г,γ',
                'h'            =>   'ĥ,ħ,Ħ,х',
                'i'            =>   'ì,í,î,ï,ı,ĩ,ī,ĭ,į,и,й,ъ,ы,ь,η,ή',
                'ij'   =>   'ij',
                'j'            =>   'ĵ',
                'ja'   =>   'я',
                'ju'   =>   'яю',
                'k'            =>   'ķ,ĸ,κ',
                'l'            =>   'ĺ,ļ,ľ,ŀ,ł,л,λ,ḷ',
                'lj'   =>   'љ',
                'm'            =>   'μ,ṁ',
                'n'            =>   'ñ,ņ,ň,ʼn,ŋ,н,ν,ṅ,ṇ',
                'nj'   =>   'њ',
                'o'            =>   'ö,ò,ó,ô,õ,ø,ō,ŏ,ő,ο,ό,ω,ώ',
                'oe'   =>   'œ,ö',
                'p'            =>   'п,π',
                'ph'   =>   'φ',
                'ps'   =>   'ψ',
                'r'            =>   'ŕ,ŗ,ř,р,ρ,σ,ς,ṟ',
                's'            =>   'ṣ,ş,ś,ŝ,ş,š,с',
                'ss'   =>   'ß,ſ',
                'sh'   =>   'ш',
                'shch' =>   'щ',
                't'            =>   'ţ,ť,ŧ,τ,ṭ',
                'th'   =>   'θ',
                'u'            =>   'ù,ú,û,ü,ũ,ū,ŭ,ů,ű,ų,у',
                'v'            =>   'в',
                'w'            =>   'ŵ',
                'x'            =>   'χ,ξ',
                'y'            =>   'ý,þ,ÿ,ŷ',
                'z'            =>   'ź,ż,ž,з,ж,ζ'
                );
 
                foreach( $glyph_array as $letter => $glyphs ) {
                        $glyphs = explode( ',', $glyphs );
                        $str = str_replace( $glyphs, $letter, $str );
                }
 
                return $str;
        }

Add field/field groups with titles of non-Latin characters.

Expected result

Field/field group aliases should be in transliterated form

Actual result

They are not

System information (as much as possible)

Joomla! 3.7.0-beta3 under Wampserver

Additional comments

avatar humblehumanbeing humblehumanbeing - open - 11 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Mar 2017
avatar Bakual
Bakual - comment - 11 Mar 2017

Why do you think they should be transliterated? The "alias" here isn't used in URLs.

avatar humblehumanbeing
humblehumanbeing - comment - 11 Mar 2017

Alias of a field title like 'Współczesny' will be 'wspczesny' when saved. Is this a desired result?
On the other hand if alias isn't used in URLs then it is obsolete in field/field groups.

avatar brianteeman
brianteeman - comment - 11 Mar 2017

Url.is not the purpose of the field here

On 11 Mar 2017 6:33 p.m., "humblehumanbeing" notifications@github.com
wrote:

Alias of a field title like 'Współczesny' will be 'wspczesny' when saved.
Is this a desired result?
On the other hand if alias isn't used in URLs then it is obsolete in
field/field groups.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#14497 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8WuQlIMhz1nTsb0Rgc_72TSKZIfpks5rkuj2gaJpZM4MaSQ1
.

avatar humblehumanbeing
humblehumanbeing - comment - 11 Mar 2017

The problem is that transliteration works everywhere except fields.
Even if alias is not used for any purpose do you think transliteration is not necessary here?

avatar Bakual
Bakual - comment - 11 Mar 2017

There is no alias in "field groups" anyway. We're only talking about fields which have an alias (hopefully renamed to "name" soon).

The problem is that transliteration works everywhere except fields.

I don't know why it doesn't work to be honest. We use the Joomla method JApplicationHelper::stringURLSafe() to sanitise the alias here. That method should also do the transliterating.

Even if alias is not used for any purpose do you think transliteration is not necessary here?

I don't know if it is needed or not. The "alias" is used as the name and id of the field in a form. It isn't anything that is visible for the user except if he is going to look at the source code. So it's very likely it doesn't matter at all.

avatar Bakual
Bakual - comment - 11 Mar 2017

Can you try if #14499 fixes it? That's the only difference I saw to com_content.

avatar humblehumanbeing
humblehumanbeing - comment - 11 Mar 2017

It solves the problem.
Thanks.

avatar zero-24 zero-24 - change - 11 Mar 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-03-11 20:08:10
Closed_By zero-24
avatar zero-24 zero-24 - close - 11 Mar 2017
avatar zero-24
zero-24 - comment - 11 Mar 2017

Thanks @humblehumanbeing for the feedback can you add yout test to that PR using issues.joomla.org? https://issues.joomla.org/tracker/joomla-cms/14499 ?

I'm closing here as we have a PR that fixes the issue. Thanks @Bakual

avatar Bakual
Bakual - comment - 11 Mar 2017

It solves the problem.

Cool ?

Add a Comment

Login with GitHub to post a comment