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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Multilingualcontent Custom


Go to End


5 Posts   1805 Views

Avatar
Gabbs

Community Member, 5 Posts

30 June 2010 at 11:50pm

Edited: 30/06/2010 11:53pm

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

Forum Moderator, 1899 Posts

2 July 2010 at 3:07am

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

Community Member, 5 Posts

2 July 2010 at 3:21am

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

Community Member, 5 Posts

2 July 2010 at 4:04am

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

Gabbs

Avatar
swaiba

Forum Moderator, 1899 Posts

2 July 2010 at 8:30pm

Edited: 04/10/2010 4:03am

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