Converting site from English to Swedish messes navigation

Help with problem solving.

Converting site from English to Swedish messes navigation

Postby maxbrooker » Wed Jul 27, 2011 1:34 pm

Hi,

I'm converting an english language site to a swedish one.

I've literally made a copy of the English website and am replacing the text with Swedish. The content is fine and all the Special Swedish Characters such as umlauts and rings appear OK.

However, any page name with special swedish characters messes with the navigation, for example in the "Tjänster" (Services) menu, which should be a drop down menu to reveal a sub category, it has replaced the slab page name with "slabid-2" (index.php?slab=slabid-2). Any renamed pages that don't contain special swedish characters work OK.

I guess this is something to do with Character Encodings - I have tried to edit my template files to include <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />, am I barking up the wrong tree? is there somewhere else I need to set something?

Any guidance would be much appreciated... newbie, still learning about back-end stuff here!

Thanks,
Max
maxbrooker
 
Posts: 35
Joined: Fri Jan 23, 2009 12:19 pm

Re: Converting site from English to Swedish messes navigatio

Postby maxbrooker » Wed Jul 27, 2011 2:37 pm

After a more comprehensive search of the Forum, I have found the Foreign Title Support Blade pack!

Apologies - I should have looked harder - this fixes the 'slabid' thing, but still no drop down-down menu - but I guess that's a category naming issue... will persevere and post again one-way or another...

Thanks,
Max
maxbrooker
 
Posts: 35
Joined: Fri Jan 23, 2009 12:19 pm

Re: Converting site from English to Swedish messes navigatio

Postby maxbrooker » Wed Jul 27, 2011 3:15 pm

Sorted!

Because I'd created a sub-category attached to one of the main navigation titles on the original English site, when I changed the word "Services" to Tjänster in Swedish, it was no longer associated with it.

Obvious really when you think about it! But it took me a while to realise it. I deleted the old Sub-cat and created a new one under Tjänster and it worked!!!

Smiffy - just out of interest, foreign title support converts the letter ä to ae - would it not be better to convert just to a plain letter a ? It's in the back-end so viewers of the website won't be effected, so it's not crucial.

Many thanks!
maxbrooker
 
Posts: 35
Joined: Fri Jan 23, 2009 12:19 pm

Re: Converting site from English to Swedish messes navigatio

Postby Adminer » Wed Jul 27, 2011 9:25 pm

maxbrooker wrote:Sorted!
Smiffy - just out of interest, foreign title support converts the letter ä to ae - would it not be better to convert just to a plain letter a ?
Many thanks!


You can create your own swedish "conversion" if you are using utf-8 characters - polish and german example is here:
viewtopic.php?f=5&t=831#p4112

UTF-8 code for swedish language are described here:
http://www.eki.ee/letter/chardata.cgi?l ... ript=latin

In this example you have (in this table, for this example): UTF-8 (c3, 84) Ä
So, you have code c384 from Ä to convert it on small 'a' in your links.
You can create your own table conversion for Swedish language, for utf-8 characters only, and all your keyboard special characters.

Tables for '+' and 'Ä' - an example:
Code: Select all
$utfchars = array('+','c384');
$normchars = array('-','a');

You can add next character 'ä'

Tables only for '+' , 'Ä', 'ä' - an example:
Code: Select all
<?php
///////////////////////////////////////////////////////////
// Blade Pack                                            //
// Foreign Title Support                                 //
// GPLv3                                                 //
// Version 2.3 Swedish                                   //
// Adminer - Remigiusz Waszkiewicz                       //
// 07/2011                                               //
///////////////////////////////////////////////////////////

///////////////////////
// Socket Allocation //
///////////////////////

// Add Blades to Sockets $bladeList['blade'] = 'socket'; //
$bladeList['foreignTitleSupport'] = 'clean-title-support';

///////////////////////
//      Blades       //
///////////////////////

// blade - convert polish and german special characters to english equivelent //

  function str2url($str) {
$str = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$wyrzucamy=array('^','\'','"','`','~');
$str = str_replace($wyrzucamy, '-', $str );
$filtracja = trim(preg_replace('/ +/',' ',preg_replace('/[^a-zA-Z0-9\s\+\-\_\.]/','',strtolower($str))));
return $filtracja;
}

function foreignTitleSupport($slabTitle)
{
   $slabTitle = str2url($slabTitle); 

// Swedish table conversion //
// Demo table for '+' , 'Ä', 'ä'  only //
/////////////// 1,     2,     3 ///////
$utfchars = array('+','c384', 'c3a4');
$normchars = array('-','a','a');

// end of Swedish table conversion set //

$slabTitle = str_replace($utfchars,$normchars,$slabTitle);
}
// end /////////////////////////////////////////
?>


In this way you can add next characters and create all Swedish conversion table, and save it in system_foreignTitleSupport.php file, together with system_foreignTitleSupport.xml file:

Code: Select all
<?xml version="1.0" ?>
<bladepack>
    <details>
        <name>Swedish characters</name>
        <version>v2.3sv</version>
        <class>system</class>
        <author>Remigiusz Waszkiewicz</author>
        <description>Swedish Converter</description>
    </details>
    <archive>
        <archive_file>system_foreignTitleSupport.zip</archive_file>
        <xml_file>system_foreignTitleSupport.xml</xml_file>
        <bladepack_file>system_foreignTitleSupport.php</bladepack_file>
    </archive>
    <note>
        <p>Swedish converter for SEF URL</p>
    </note>
</bladepack>


It's only works with utf-8 - if you like it and set in RazorCMS Settings menu.

Regards
Adminer
 
Posts: 555
Joined: Wed Apr 08, 2009 9:52 pm
Location: Poland

Re: Converting site from English to Swedish messes navigatio

Postby maxbrooker » Fri Jul 29, 2011 2:42 pm

Excellent!

Thanks Adminer
maxbrooker
 
Posts: 35
Joined: Fri Jan 23, 2009 12:19 pm


Return to Problems Using razorCMS

Who is online

Users browsing this forum: No registered users and 0 guests

cron