Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Language file  (Read 8968 times)

0 Members and 1 Guest are viewing this topic.

terrorhawk

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 61
Language file
« on: August 22, 2006, 05:44:38 pm »

Hi there.

i was working on my photo album again and i came up with a idea.
why doesnt the modpack uses his own Language file.

like if u select in the config to use a dutch Language then it load's stramm_dutch.php
this way its easyer to update the Language and to translate it.

Maby stramm already knows a way to do this if not i'm going to try it anyway and hopefuly it will be implanted.

Let me know what u think of this
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Language file
« Reply #1 on: August 22, 2006, 06:29:58 pm »

Would be possible but mean a lot of coding and recoding. Far easier is to use a diff viewer and update the existing lang files

terrorhawk

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 61
Re: Language file
« Reply #2 on: August 22, 2006, 09:04:57 pm »

well i think if we have this function (and yes its allot of work) then it would be easy for every user to translate it.
if u use a diff vieuwer it still is allot of work to make it all work. and if there is a update u have to start all over again with adding things intro you'r lang file.

But if nobody is waiting for this then its useless. but if allot of people are willing to translate this small file then its great for the modpack
Logged

terrorhawk

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 61
Re: Language file
« Reply #3 on: August 22, 2006, 09:28:24 pm »

Hey i allready found it.
its very easy to do

open init.inc.php

find:
Code: [Select]
// We load the chosen language file
require "lang/{$CONFIG['lang']}.php";

after add:
Code: [Select]
require "lang/stramm_{$CONFIG['lang']}.php";
Now the stramm lang file sould look like this:

stramm_dutch.php

Code: [Select]
$lang_gallery_admin_menu_stramm = array (
'admin_title' => 'Ga naar instellingen', //cpg1.4
'admin_lnk' => 'Instellingen', //cpg1.4

);
this is just a test stramm_dutch.php sow i can explane how it works.
The file works the same as a normal lang file but only i use a _stramm after a string

at the end of the file before the ?> i will merge the 2 array's together
like this:
Code: [Select]
$lang_gallery_admin_menu = array_merge($lang_gallery_admin_menu, $lang_gallery_admin_menu_stramm)

and thats all..
now it works :P
now i only have to make a default stramm_english.php as a fallback file if the stramm_dutch.php (or any other) is missing
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Language file
« Reply #4 on: August 23, 2006, 09:36:22 am »

nice... I've also modified coppemine 'core' language... so there's even more to do. Looking forward to your contribution :)

terrorhawk

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 61
Re: Language file
« Reply #5 on: August 23, 2006, 11:37:19 am »

First let me update to the latest modpack.
i still use a older version becouse i modded it :P

Btw. i'm going to release my News Page Addon for coppermine very soon. maby its also nice to build into the modpack with a on/off function.

but first thing first. Updating my version :P


Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Language file
« Reply #6 on: August 23, 2006, 02:39:21 pm »

[ot]
Most of the features in Stramm's modpack have made it into the core code of the devel branch (meaning: will be in cpg1.5.x), so I guess the language issues won't be hard to fix in possible future versions of the modpack.
However, we need to come up with a solution that handles i18n of plugins/mods/hacks/documentation in a thorough way (although this doesn't actually belong into this thread).

Joachim

P.S. To answer possible replies to this posting in advance: no, there's no scheduled release date for cpg1.5.x  ;)
[/ot]
Logged

terrorhawk

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 61
Re: Language file
« Reply #7 on: August 23, 2006, 04:38:38 pm »

Well i'm alsmost done with a first test version of the lang file.

i'm going to install a clean version on another server for the testing becouse my version is to far modded.
Logged

terrorhawk

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 61
Re: Language file
« Reply #8 on: August 23, 2006, 06:40:14 pm »

Ok first version is done.

The only thing that is not working YET is a fallback.
i havent testen the complete file to see if every word is working.
if someone wants to test it please be my guest :P

MAKE A BACKUP BEFORE U DO THIS !!

first of all edit init.inc.php

Find
Code: [Select]
// We load the chosen language file
require "lang/{$CONFIG['lang']}.php";

After Add:
Code: [Select]
if (file_exists('lang/stramm_' . $USER['lang'] . '.php')) {require "lang/stramm_{$CONFIG['lang']}.php";}
save and upload

Now upload the file stramm_english.php and the deflaut english.php that comes with coppermine to your /lang dir.
now if u want to translate it to lets say dutch just edit stramm_english.php to your needs and save it as stramm_dutch.php (be sure dutch.php is the original file that comes with coppermine).

Remember this is just a test version of stramm_english.php. The code needs to be cleaned up and needs more testing. USE AT YOUR OWN RISK !!

Grz
Th
Logged
Pages: [1]   Go Up
 

Page created in 0.262 seconds with 20 queries.