Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Bilingual forum: special cases problems
Hi folks,
I'm currently working on a bilingual forum using Language Selector. it works fine, but there are several things which aren't in the definition.php files, and I wonder how to include them.
- How could I translate the Discussion Labels? They're specified in conf/settings.php and I don't see how to change them for two different languages.
- How could I translate the date and the months' names? From what I understand it comes from a specific PHP function and there's no file in Vanilla allowing to change it, am I wrong?
I'm currently working on a bilingual forum using Language Selector. it works fine, but there are several things which aren't in the definition.php files, and I wonder how to include them.
- How could I translate the Discussion Labels? They're specified in conf/settings.php and I don't see how to change them for two different languages.
- How could I translate the date and the months' names? From what I understand it comes from a specific PHP function and there's no file in Vanilla allowing to change it, am I wrong?
0
This discussion has been closed.
Comments
OldPostDateFormatCode
. The default value isM jS Y
, which will come out asAug 28th 2006
(for instance). You can change the parameter value, and you can check the documentation of the PHP date function for which values are allowed. For the translation I did (Swedish), I changed it toj M Y
which outputs something like2006 08 28
.Apparently there is a way to change the names of months, but it involves a bit of tinkering with PHP code, using setlocale() and strftime(). I have never done anything with those functions, but I guess in theory you could change the Vanilla code.
In short: overload the label definition in you language definitions.php file.
//labels, see settings $Configuration['TEXT_WHISPERED'] = 'chuchoté'; $Configuration['TEXT_STICKY'] = 'affiché'; $Configuration['TEXT_CLOSED'] = 'fermé'; $Configuration['TEXT_HIDDEN'] = 'masqué'; $Configuration['TEXT_SINK'] = 'coulé'; $Configuration['TEXT_BOOKMARKED'] = 'signet';
About translation in general, I stumbled upon another problem : most extensions don't include everything. For some of them the title in the settings tab is missing, others lack a couple of words not always seen (for example, "guest" in the Who's Online extension)... It's not a real problem for me because I was still able to add these definitions after digging a bit and modifying the extensions. However, I'd like to share my work with the community: I've translated to french a dozen of extensions, but some of my custom definitions won't work because they aren't included by default in these extensions.
So, do you think I should upload the modified extensions, knowing I suck at PHP and may have changed something wrong while adding new definitions, or upload only the dictionary part, knowing some definitions won't work unless people modify their extensions by themselves?
$Context->SetDefinition('code', 'definition')
should be used instead of
$Context->Dictionary['code'] = 'definition';
You still can use $Context->Dictionary['code'] = 'definition'; in definition.php.
When you translate an extension, what you can :
- Translate the definitons and put them in conf/language.php (or in your case in definitions.php);
- If the extension use "$Context->Dictionary['code'] = 'definition';",
Transform them into $Context->SetDefinition('code', 'definition') or delete them
And ask the author set SetDefinition in the next release of his extension
- Ask the maintainer of the language to add your translation.
<p>'.$this->User->Role.'</p>
by
<p>'.$this->Context->GetDefinition($this->User->Role).'</p>
And create the definitions for your role in definitions.php
However the translation isn't displayed in the user search results. I've looked for something similar to change in themes/search_results_users.php and I suppose it has something to do with the end of this line:
<a href="'.GetUrl($this->Context->Configuration, 'account.php', '', 'u', $u->UserID).'">'.$u->Name.'</a> ('.$u->Role.')'
Problem is I know nothing in PHP syntax, so I don't know what to change.