Language file Language file
 

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

Main Menu

Language file

Started by terrorhawk, August 22, 2006, 05:44:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

terrorhawk

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

Stramm

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

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

terrorhawk

Hey i allready found it.
its very easy to do

open init.inc.php

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


after add:
require "lang/stramm_{$CONFIG['lang']}.php";

Now the stramm lang file sould look like this:

stramm_dutch.php

$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:
$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

Stramm

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

terrorhawk

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



Joachim Müller

[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]

terrorhawk

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.

terrorhawk

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// We load the chosen language file
require "lang/{$CONFIG['lang']}.php";


After Add:
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