Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2005, 05:10 PM
divisortheory divisortheory is offline
 
Join Date: Oct 2005
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default hack for multiple language support

Well, this is my last attempt at getting help with this problem. I really wish I was better at PHP so I didn't have to keep coming back here and posting this and getting no response, but anyway...

My forum supports multiple languages using the Phrase Manager. This works great for menus, standard text, etc but it doesn't work for the title and description of each forum. The reason is that in the Admin CP I am only allowed to choose one and only name for the forum. Now, regardless of what Language a visitor to the forum chooses, they will only see the one and only one title that I have chosen for the forum (likewise with description).

What I would like is to be able to add a phrase through Phrase Manager, and insert a translation for all of the languages that my forum supports. Then, somehow have the title and description fields reference these variable, and have the vBulletin system choose the correct translation based on the language setting. Just as an example, say I have a simple forum with only one forum called Milk. My forum supports two langauges, English & Spanish. If the user has selected English, I want it to say "Milk", and if the user has selected Spanish, it should say "Leche".

I looked at index.php, and I see some code that could maybe potentially be changed. (btw, I don't know -anything- about PHP although I am experienced in other non web related languages, so I just pinpointed this as potential code, I don't know specifically what its doing)

foreach ($parentlist AS $forumID)
{
$forumTitle =& $vbulletin->forumcache["$forumID"]['title'];
$navbits['forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$forumID"] = $forumTitle;
}

What would be some appropriate code to do it and where would I put that code?

Thanks kindly for any suggestions
Zachary Turner
Reply With Quote
  #2  
Old 10-06-2005, 05:46 PM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Possibly if you post in the correct section, you'd get more help.
Reply With Quote
  #3  
Old 10-06-2005, 06:26 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First off, yeah wrong forum

Second off, not sure if it's possible but perhaps someone else can clue in on this.

First off, lets use the milk example.

Name a forum "milk"

Then add a hook in global_start to do something like

Code:
$forum[title] = $vbphrase[forumnames_$forum[title]];
Now, create a global phrase called

forumnames_milk

with a translation for each language Milk, Leche, etc

Wonder if that would work...

If not, you'll have to do like a mass replace in the templates changing

$forum[title]

to

$vbphrase[forumnames_$forum[title]]

and then add a global phrase.

Do that for each forum, that's prolly your best bet *shrug*
Reply With Quote
  #4  
Old 10-06-2005, 06:41 PM
divisortheory divisortheory is offline
 
Join Date: Oct 2005
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea I realized after I posted it this was the wrong forum. But then again, I also posted it another more appropriate forum a few days ago, and no response. Anyway thanks for the suggestion, sorry again about the wrong forum :ermm:

Just curious, would it work to actually use Admin CP to set the name and description of the forum to PHP code which indicate a variable name? For example:

Set forum name in Admin CP to

$vbphrase[forumnames_milk]

Then in the index.php read this and instead of simply displaying it for the forum name, look up its value? If that's possible, what would be the code to do it?
Reply With Quote
  #5  
Old 10-06-2005, 06:56 PM
Bad Bunny's Avatar
Bad Bunny Bad Bunny is offline
 
Join Date: Apr 2002
Posts: 555
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by divisortheory
Yea I realized after I posted it this was the wrong forum. But then again, I also posted it another more appropriate forum a few days ago, and no response. Anyway thanks for the suggestion, sorry again about the wrong forum :ermm:

Just curious, would it work to actually use Admin CP to set the name and description of the forum to PHP code which indicate a variable name? For example:

Set forum name in Admin CP to

$vbphrase[forumnames_milk]

Then in the index.php read this and instead of simply displaying it for the forum name, look up its value? If that's possible, what would be the code to do it?
Last I checked, you can use html code, but I am pretty certain php would not work, since it's thrown right in the middle of the page and not parsed. It would be like me posting some php code here and hoping it would parse.
Reply With Quote
  #6  
Old 10-06-2005, 07:21 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I saw your post and i putted it on my list of hacks to make, but a bit busy right now.

PS moved thread
Reply With Quote
  #7  
Old 10-06-2005, 07:24 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I think you'd have to do it the way I mentioned, otherwise it won't parse the php I don't think.
Reply With Quote
  #8  
Old 10-06-2005, 09:04 PM
divisortheory divisortheory is offline
 
Join Date: Oct 2005
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the responses again I'll wait and see what Marco has in store for me, in the meantime possibly toying around with a test site running a test database. I suppose I should check this thread for progress updates?
Reply With Quote
  #9  
Old 10-29-2005, 01:49 AM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

has there been any progress on this?

I'm still majorly stressed out over this (orginally posted this same request ages ago. )

relevant links on exact same topic (little different in responses and ideas).
https://vborg.vbsupport.ru/showthread.php?t=97638
https://vborg.vbsupport.ru/showthrea...597#post791597

here was a past post about this (with screenies):

===========================================

This is HUGE problem (the biggest issue) for my forum/s (and I'm sure others):

How do I make it so the forum TITLE links could have titles switch languages according to the language selected??

That is, if a user chooses one language (english, for example) ...the forum titles appear in that English, but if the user switches to another language (Z language, for example), then the forum titles appear in Z language.

(I'm not talking about buttons and phrases! I know this is how the language sets work for BUTTONS and MENU items etc. I have korean and english languages running fine now. )

But there is nothing for dealing with forum titles/thread title links.

Right now, i have to do both languages in one title...which means:
  • many people see half BROKEN garbage text (VERY distracting and ugly)
  • AND I have to deal with unneccesarily long titles (have to write both english and korean for the same title).
  • some people want their language first written out first, ie: korean then english in the title, or vice versa. (yes, this actually is an issues sometimes).
  • often have to make sacrifices in just using one language and ask people to just deal.



I'm postiive others have to deal with the issue as well. And I know this would be giant boost towards internationalizing vbull.

Is their ANY way around this? to make two (multi) language sets available for the FORUM TITLES? (and subforum).

I would GREATLY appreciate any ideas or help.
thank you.


See example screenshots below:
Attached Images
File Type: gif twolanguages.gif (10.7 KB, 0 views)
File Type: gif twolanguages2.gif (10.3 KB, 0 views)
Reply With Quote
  #10  
Old 10-29-2005, 01:56 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Although I don't need it, I think this should be in the default vbulletin features...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04690 seconds
  • Memory Usage 2,284KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete