Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2010, 05:21 AM
Nikola Bosnjak Nikola Bosnjak is offline
 
Join Date: Jul 2010
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need code, auto change site's language

I'm using vB 4.0.5 CMS, and site is in 2 languages. I have articles in Croatian and English. I would like vBulletin change the system language depending on what content a user is reading. So, when a user is reading our company info in english, I want "read more..." link in english, but when local user is reading a company info in croatian, I need the same link "read more..." to be in croatian.

So far, I have idea to stick each language to a CMS layout, something like "if layout=1 then langid=1 else langid=2...) but I'm not programmer. I don't know how to do this. Is it possible?

Could I do this with sections, maybe? Becouse all my english content belong to one section, and croatian to another. If I could define default language for a section (I know it's impossible without programming), than my problem is solved.
Reply With Quote
  #2  
Old 10-22-2010, 05:39 AM
lemonadesoda lemonadesoda is offline
 
Join Date: Nov 2009
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Nikola, I'm not sure if that really is a good idea. Example: EN speaking User cannot read CR has EN language option in their User Settings. Goes to CR language page and loses EN language for orientation and gets lost. Conversely, CR speaking User cannot read EN has CR language options in their User Settings. Lands on an EN page and loses CR language for orientation and gets lost.

Your idea only works for bilingual Users and not monolingual Users. But bilingual Users can do fine in either language so it really isnt a problem.

Oh wait, your idea is helpful for Guests who have no language settings. That means your condition should include "if guest...". Alternatively, make a flag icon on the CMS template to switch languages easily.
Reply With Quote
  #3  
Old 10-22-2010, 08:19 AM
Nikola Bosnjak Nikola Bosnjak is offline
 
Join Date: Jul 2010
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lemonadesoda View Post
Oh wait, your idea is helpful for Guests who have no language settings. That means your condition should include "if guest...". Alternatively, make a flag icon on the CMS template to switch languages easily.
I must agree that it is not mandatory for every-day users, but site is made some days ago and all users are new. I made two flags above title image that links to ".../content.php?49&langid=1" and ".../content.php?langid=2". This is almost enough, klick on english flag changes the content that is in use and also changes the language to english. The problem is that there is a lot of ways how each user can see CR content and EN links, and this looks silly. For example, klick back on browser and refresh a page, or if a user comes via google... Let's say you enter some EN keywords in google and come to our site. It is obvious wou want to use EN on our site.
Reply With Quote
  #4  
Old 10-28-2010, 06:11 AM
Nikola Bosnjak Nikola Bosnjak is offline
 
Join Date: Jul 2010
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is our site:

www.hora-elektronik.hr

As you see, it has 2 flags in the header, each of them is changing both language and section. So, how to make that better? How would a code that changes language depending on layout look like?
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 02:11 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.03461 seconds
  • Memory Usage 2,184KB
  • Queries Executed 11 (?)
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_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete