Jump to:

22999 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Multilingualcontent Custom

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

Page: 1
Go to End
Author Topic: 1238 Views
  • Gabbs
    Avatar
    Community Member
    5 Posts

    Multilingualcontent Custom Link to this post

    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

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Multilingualcontent Custom Link to this post

    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

  • Gabbs
    Avatar
    Community Member
    5 Posts

    Re: Multilingualcontent Custom Link to this post

    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

  • Gabbs
    Avatar
    Community Member
    5 Posts

    Re: Multilingualcontent Custom Link to this post

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

    Gabbs

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Multilingualcontent Custom Link to this post

    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

    1238 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.