Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Multilingualcontent Custom


Reply

5 Posts   1326 Views

Avatar
Gabbs

30 June 2010 at 11:50pm (Last edited: 30 June 2010 11:53pm), Community Member, 5 Posts

I have my site working now in Welsh and English (US). Under my Navigation I have the Language option English (US) or Welsh.

Is there any way I can customise the language navigation names English (US) to just English and change Welsh to Cymraeg

Thanks in advance for any help.

Gabbs

Avatar
swaiba

2 July 2010 at 3:07am Forum Moderator, 1796 Posts

Hi there,

Quick search through the files for the word 'Welsh' yeilds the following...

C:\wamp\www\2.4\sapphire\core\i18n.php(186): 'cy_GB' => 'Welsh (United Kingdom)',
C:\wamp\www\2.4\sapphire\core\i18n.php(607): 'cy' => array('Welsh', 'Welsh/Cymraeg'),
C:\wamp\www\2.4\sapphire\core\i18n.php(699): 'cy_GB' => array('Welsh', 'Welsh/Cymraeg'),

I am sure you could just edit those files directly, but I don't know what you want to change... the drop down in the CMS or the stuff on the live site? If it is on the live site there is an awesome example in the the book that shows flags instead... I use that (it needed a smal hack but works a treat).

Barry

Avatar
Gabbs

2 July 2010 at 3:21am Community Member, 5 Posts

Thanks Barry your a star, I actually have the book, but haven't got round to reading it yet, silly me I should have looked in there first.
Yes I wanted the change the names on the live site, instead of English (US) and Welsh I want to have English and Cymraeg.

Cheers

Gabbs

Avatar
Gabbs

2 July 2010 at 4:04am Community Member, 5 Posts

Great change the i18n.php did the trick, thanks so much, been a great help.

Gabbs

Avatar
swaiba

2 July 2010 at 8:30pm (Last edited: 4 October 2010 4:03am), Forum Moderator, 1796 Posts

Happy to help...

If you choose to use the flags solution for the front page... this was my take on it...

         <% if Translations %>
<% control Translations %>
               <a href="$Link" hreflang="$Locale.RFC1766" title="$Title - $Locale.Nice">
   <img width="40" height="26" src="<<YOURSITEDIR>>/flags/<% sprintf(_t('IMAGE','%2.2s'),$Locale.RFC1766) %>.jpg">
</a>
<% end_control %>
         <% end_if %>

(flag source - http://www.famfamfam.com/lab/icons/flags/)

by renaming the flag image names you can get the flags to auto display - might be an issue when you start having different languages in one country (or vice versa) but for most this will work...

Barry