Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Text home link tied to language  (Read 3937 times)

0 Members and 1 Guest are viewing this topic.

coopersita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Text home link tied to language
« on: August 08, 2004, 04:42:12 am »

Hi, I'm new to Coppermine. I was wondering if there is a way to add custom links that will also change language along with the standard menu items?

I was thinking of at least adding a function that changes those links (home, About us, Contact) between the two most common languages I expect users to use (Spanish, and English also as default for all other languages), but I'm not sure in which variable is the language chosen by the user stored...

Any ideas on how to do it? I figured it would be simple (a simple if-else structure)...

Any help will be welcomed.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Text home link tied to language
« Reply #1 on: August 08, 2004, 11:11:22 am »

coppermine uses language files you are encouraged to modify as needed. If you need a "home" link in the classic theme for example, you edit themes/classic/theme.php, find
Code: [Select]
// HTML template for main menu
$template_main_menu = <<<EOT
                <span class="topmenu">
and add after it
Code: [Select]
                        <a href="{HOME_LINK_TGT}" title="{HOME_LINK_TITLE}">{HOME_LINK_LNK}</a> ::Then you find
Code: [Select]
    $param = array('{ALB_LIST_TGT}' => "index.php$cat_l",
        '{ALB_LIST_TITLE}' => $lang_main_menu['alb_list_title'],
        '{ALB_LIST_LNK}' => $lang_main_menu['alb_list_lnk'],
and add after it
Code: [Select]
        '{HOME_LINK_TGT}' => "index.php",
        '{HOME_LINK_TITLE}' => $lang_main_menu['home_link_title'],
        '{HOME_LINK_LNK}' => $lang_main_menu['home_link_lnk'],
Next, you will have to modify all language files you plan to use. Edit lang/yourlanguage.php, e.g. lang/english.php, find
Code: [Select]
$lang_main_menu = array(and add after it (in a new line)
Code: [Select]
  'home_link_title' => 'Go to the gallery start page',
  'home_link_lnk' => 'Gallery home',

Save the whole enchilada, upload the modified files to your webserver and test it.

GauGau
Logged

coopersita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Text home link tied to language
« Reply #2 on: August 08, 2004, 05:07:02 pm »

Thanks, I'll give it a try. I wish there were a manual with a llist of all template tags and such...
Logged

coopersita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Text home link tied to language
« Reply #3 on: August 08, 2004, 06:45:35 pm »

It worked like a charm.

I only wish there was a default language folder, so that I don't have to change all language files (in languages other than the ones I changed it doesn't show any link at all...). I think I'll just eras all other languages but the esencial ones for this site.

Thanks again
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Text home link tied to language
« Reply #4 on: August 09, 2004, 12:04:06 am »

you're encouraged to leave only those language files on your server you actually want to use. Remove all unused languages.

In cpg1.4, there will be a language fallback routine - if a translation doesn't exist in a special language, coppermine will default back to english and show the untranslated bit in english.

GauGau
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.