Editing Lang files via the ACP
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.
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.
Editing Lang files via the ACP
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?
-
- Registered User
- Posts: 687
- Joined: Sun May 11, 2003 11:17 am
Re: Editing Lang files via the ACP
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.
Re: Editing Lang files via the ACP
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?
Who am I kidding? My bad!!!
Oh wait, how bout making the lang file a .tpl ...?
Would that change anything?
Re: Editing Lang files via the ACP
It doesn't really matter what extention it has.
Don't give me my freedom out of pity!
-
- Registered User
- Posts: 219
- Joined: Tue Jan 25, 2005 11:31 pm
Re: Editing Lang files via the ACP
This is already how it is.
Download a CVS and try it out.
Download a CVS and try it out.
Re: Editing Lang files via the ACP
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.
-
- Registered User
- Posts: 219
- Joined: Tue Jan 25, 2005 11:31 pm
Re: Editing Lang files via the ACP
Oh, so I was a bit mistaken. But you still can edit them via the ACP...
Re: Editing Lang files via the ACP
Yes just click on the language packs name on the Language Packs panel.
.
Re: Editing Lang files via the ACP
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: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.
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';
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>
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;
?>
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 ?
"If Jelsoft were to give away a pile of horse poo ... would you demand phpBB do likewise?", psoTFX being unusually diplomatic
thx,
blobber
thx,
blobber
Re: Editing Lang files via the ACP
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.
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.
█ 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
█ 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