5324 Posts in 1596 Topics by 1167 members
Page: 1 2
|Go to End||Next >|
11 September 2012 at 2:44am
I have a website in both English and French and with potentially more languages tomorrow.
Today, the "French" label is used to refer to a language that the people who speak it call "Français". I'm expecting language names to be expressed in the language and script that the people who read and write that language use. I wouldn't expect someone who speaks only Russian to know that "Russian" is the call sign for their language… Rather, I'm expecting "Russian" to be written using the Cyrillic alphabet and reading what the Russians call their language.
So my question is: "where can I modify the language names"? Is it in some configuration file or hardcoded in a source file? Whatever the case, can someone please tell me which file it is?
12 September 2012 at 2:20am
Are you referring to the languagse dropdown in the cms or to a language switcher on the webste?
12 September 2012 at 4:12am
Thanks for your reply. I am referring to a language switcher on the actual website.
I am the only content editor for my website and I read both English and French so the back end side of things isn't an issue.
12 September 2012 at 4:39am
Ok, in that case - can you tell us more about the languageswitcher you're using, maybe post the code used to build it, is it an existing module or widget, or do you have a link to the tutorial/docs it came from?
12 September 2012 at 5:41am
The website design and template were made by an intern and I don't have much info. But it doesn't look like there's a plugin involved. I've attached the a screen capture of the appropriate code in Header.ss and a screen capture of its rendition on the website.
13 September 2012 at 12:51am Last edited: 13 September 2012 12:52am
$Locale.Nice (in your Header.ss template) should normally return the languagename based on the current users language. So if you're currently at the English site, you'll get 'English' and 'French'. At the French site, the names should now read 'Anglais' and 'Français'.
If you'd want the names to be in their native form always (English, Français), you should be able to do (haven't tested this):
Don't forget to ?flush=1 after changing your template...
15 September 2012 at 3:18am Last edited: 15 September 2012 3:19am
$Locale.nice(true) did the trick but the first letter for "Français" is lower case.
<% ucfirst($Locale.Nice(true)) %>
but these appear as such on the webpage.
I've read the documentation on templates but I don't see a way to call a PHP function. Is it possible to do so?
15 September 2012 at 6:47am Last edited: 15 September 2012 6:49am
You'll find the list of $common_locales in framework/i18n/i18n.php. The native name for french is indeed lowercase.
I think you can easily define your own (shorter!) list of common locales from your _config.php. Something like:
i18n::$common_locales = array(
'af_ZA' => array('Afrikaans', 'Afrikaans'),
Page: 1 2
|Go to Top||Next >|