Editing Lang files via the ACP

Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here.
Forum rules
Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here. Feature requests are closed.
Vire
Registered User
Posts: 20
Joined: Tue Mar 15, 2005 3:54 pm

Editing Lang files via the ACP

Post by Vire »

Hey, it would be kickarse if you had to CHMOD777 the language files so that the admins could modify and thus customize the forum directly from the ACP instead of having to download, edit and upload again... What do you think?

Martin Blank
Registered User
Posts: 687
Joined: Sun May 11, 2003 11:17 am

Re: Editing Lang files via the ACP

Post by Martin Blank »

Big security problem there, because those files are PHP files, and when included can include code altered by others that opens up access to undesirables.
You can never go home again... but I guess you can shop there.

Vire
Registered User
Posts: 20
Joined: Tue Mar 15, 2005 3:54 pm

Re: Editing Lang files via the ACP

Post by Vire »

Ah. But the users don't KNOW that, do they?

Who am I kidding? My bad!!!

Oh wait, how bout making the lang file a .tpl ...?
Would that change anything?

APTX
Registered User
Posts: 680
Joined: Thu Apr 24, 2003 12:07 pm

Re: Editing Lang files via the ACP

Post by APTX »

It doesn't really matter what extention it has.
Don't give me my freedom out of pity!

Cap'n Refsmmat
Registered User
Posts: 219
Joined: Tue Jan 25, 2005 11:31 pm

Re: Editing Lang files via the ACP

Post by Cap'n Refsmmat »

This is already how it is.

Download a CVS and try it out.

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Editing Lang files via the ACP

Post by Acyd Burn »

No, we are staying far away from making core files world-writeable. Instead there is a storage system holding language pack changes temporary (for instant downloading and session-to-session editing) if someone is using the language pack panel.

Image

Cap'n Refsmmat
Registered User
Posts: 219
Joined: Tue Jan 25, 2005 11:31 pm

Re: Editing Lang files via the ACP

Post by Cap'n Refsmmat »

Oh, so I was a bit mistaken. But you still can edit them via the ACP...

Tullamore
Registered User
Posts: 112
Joined: Wed Mar 24, 2004 6:56 am

Re: Editing Lang files via the ACP

Post by Tullamore »

Yes just click on the language packs name on the Language Packs panel.
.

blobber
Registered User
Posts: 96
Joined: Wed Mar 16, 2005 6:28 pm

Re: Editing Lang files via the ACP

Post by blobber »

Acyd Burn wrote: No, we are staying far away from making core files world-writeable. Instead there is a storage system holding language pack changes temporary (for instant downloading and session-to-session editing) if someone is using the language pack panel.
The mentioned functionality itself would certainly come in pretty handy at times, also I think that editing CSS files from within the ACP might help in some situations - however I understand the security concerns about doing this with the current implementation, alternatively one could consider using a script to convert the lang file format:

Code: Select all

$lang['No_newer_topics'] = 'There are no newer topics in this forum';
$lang['No_older_topics'] = 'There are no older topics in this forum';
$lang['Topic_post_not_exist'] = 'The topic or post you requested does not exist';
$lang['No_posts_topic'] = 'No posts exist for this topic';
to a simple XML-based format such as:

Code: Select all

<lang_var name="No_newer_topics">There are no newer topics in this forum</lang>
<lang_var name="No_older_topics">There are no older topics in this forum</lang>
<lang_var name="Topic_post_not_exist">The topic or post you requested does not exist</lang>
<lang_var name="No_post_topic">No posts exist for this topic</lang>
Something as simple as:

Code: Select all

<?php

require_once('language/lang_english/lang_main.php');

$xmldata ='';

foreach ($lang as $key => $value)
{
	$xmldata .= "<lang name="$key" value="$value"/>\n";
}

echo $xmldata;

?>
Would probably be already sufficient.

It would then be pretty straight forward to write a function to read in the XML-file(s) and convert them back to the associative arrays that are being used everywhere in phpBB's source, so in the beginning one wouldn't even need to make any changes, apart from calling said function in the beginning of any of the included files in order to re-obtain the associative arrays.

So, converting the current set of lang files to XML-syntax and writing a wrapper on top of it would probably not take much longer than 10-15 Min. - afterwards, one could enjoy all the benefits of having dynamic set of lang files, that could be edited via the ACP or some other sort of frontend.

What do you think ?

BioALIEN
Registered User
Posts: 120
Joined: Tue Jan 25, 2005 3:46 pm
Location: London, UK

Re: Editing Lang files via the ACP

Post by BioALIEN »

Honestly, I think its a nice touch to make the langs admin editable.

On those special occasions while you're out and about.. just pop into an internet cafe.. and play with the langs on the fly... then back to enjoying life while people on the board (im not even sure what the hell they doing there on special occasions) read happily ever after. :mrgreen:
BioALIEN
█ Secure your name before someone else does: TheMillionDollarAdvert.com
█ Get your permanent listing from $10 USD. You too can own a piece of internet history.
The moment you master the art of programming is the moment you program the art itself! - BioALIEN

Locked