integrated the HTMLarea plugins into the eGW translation system

This commit is contained in:
Ralf Becker 2004-08-29 00:49:27 +00:00
parent 4a96e87d96
commit 4f7f232993
8 changed files with 599 additions and 0 deletions

View File

@ -0,0 +1,94 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-ContextMenu');
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
ContextMenu.I18N = {
// Items that appear in menu. Please note that an underscore (_)
// character in the translation (right column) will cause the following
// letter to become underlined and be shortcut for that menu option.
"Cut" : "<?php echo lang('Cut'); ?>",
"Copy" : "<?php echo lang('Copy'); ?>",
"Paste" : "<?php echo lang('Paste'); ?>",
"Image Properties" : "<?php echo lang('_Image Properties...'); ?>",
"Modify Link" : "<?php echo lang('_Modify Link...'); ?>",
"Check Link" : "<?php echo lang('Chec_k Link...'); ?>",
"Remove Link" : "<?php echo lang('_Remove Link...'); ?>",
"Cell Properties" : "<?php echo lang('C_ell Properties...'); ?>",
"Row Properties" : "<?php echo lang('Ro_w Properties...'); ?>",
"Insert Row Before" : "<?php echo lang('I_nsert Row Before'); ?>",
"Insert Row After" : "<?php echo lang('In_sert Row After'); ?>",
"Delete Row" : "<?php echo lang('_Delete Row'); ?>",
"Table Properties" : "<?php echo lang('_Table Properties...'); ?>",
"Insert Column Before" : "<?php echo lang('Insert _Column Before'); ?>",
"Insert Column After" : "<?php echo lang('Insert C_olumn After'); ?>",
"Delete Column" : "<?php echo lang('De_lete Column'); ?>",
"Justify Left" : "<?php echo lang('Justify Left'); ?>",
"Justify Center" : "<?php echo lang('Justify Center'); ?>",
"Justify Right" : "<?php echo lang('Justify Right'); ?>",
"Justify Full" : "<?php echo lang('Justify Full'); ?>",
"Make link" : "<?php echo lang('Make lin_k...'); ?>",
"Remove the" : "<?php echo lang('Remove the'); ?>",
"Element" : "<?php echo lang('Element...'); ?>",
// Other labels (tooltips and alert/confirm box messages)
"Please confirm that you want to remove this element:" : "<?php echo lang('Please confirm that you want to remove this element:'); ?>",
"Remove this node from the document" : "<?php echo lang('Remove this node from the document'); ?>",
"How did you get here? (Please report!)" : "<?php echo lang('How did you get here? (Please report!)'); ?>",
"Show the image properties dialog" : "<?php echo lang('Show the image properties dialog'); ?>",
"Modify URL" : "<?php echo lang('Modify URL'); ?>",
"Current URL is" : "<?php echo lang('Current URL is'); ?>",
"Opens this link in a new window" : "<?php echo lang('Opens this link in a new window'); ?>",
"Please confirm that you want to unlink this element." : "<?php echo lang('Please confirm that you want to unlink this element.'); ?>",
"Link points to:" : "<?php echo lang('Link points to:'); ?>",
"Unlink the current element" : "<?php echo lang('Unlink the current element'); ?>",
"Show the Table Cell Properties dialog" : "<?php echo lang('Show the Table Cell Properties dialog'); ?>",
"Show the Table Row Properties dialog" : "<?php echo lang('Show the Table Row Properties dialog'); ?>",
"Insert a new row before the current one" : "<?php echo lang('Insert a new row before the current one'); ?>",
"Insert a new row after the current one" : "<?php echo lang('Insert a new row after the current one'); ?>",
"Delete the current row" : "<?php echo lang('Delete the current row'); ?>",
"Show the Table Properties dialog" : "<?php echo lang('Show the Table Properties dialog'); ?>",
"Insert a new column before the current one" : "<?php echo lang('Insert a new column before the current one'); ?>",
"Insert a new column after the current one" : "<?php echo lang('Insert a new column after the current one'); ?>",
"Delete the current column" : "<?php echo lang('Delete the current column'); ?>",
"Create a link" : "<?php echo lang('Create a link'); ?>"
};

View File

@ -0,0 +1,53 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-FullPage');
// I18N for the FullPage plugin
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
FullPage.I18N = {
"Alternate style-sheet:": "<?php echo lang('Alternate style-sheet:'); ?>",
"Background color:": "<?php echo lang('Background color:'); ?>",
"Cancel": "<?php echo lang('Cancel'); ?>",
"DOCTYPE:": "<?php echo lang('DOCTYPE:'); ?>",
"Document properties": "<?php echo lang('Document properties'); ?>",
"Document title:": "<?php echo lang('Document title:'); ?>",
"OK": "<?php echo lang('OK'); ?>",
"Primary style-sheet:": "<?php echo lang('Primary style-sheet:'); ?>",
"Text color:": "<?php echo lang('Text color:'); ?>"
};

View File

@ -0,0 +1,46 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-HtmlTidy');
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Adam Wright, http://blog.hipikat.org/
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
HtmlTidy.I18N = {
"tidying" : "<?php echo lang('\n Tidying up the HTML source, please wait...'); ?>",
"HT-html-tidy" : "<?php echo lang('HTML Tidy'); ?>"
};

View File

@ -0,0 +1,51 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-ListType');
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
ListType.I18N = {
"Decimal" : "<?php echo lang('Decimal numbers'); ?>",
"Lower roman" : "<?php echo lang('Lower roman numbers'); ?>",
"Upper roman" : "<?php echo lang('Upper roman numbers'); ?>",
"Lower latin" : "<?php echo lang('Lower latin letters'); ?>",
"Upper latin" : "<?php echo lang('Upper latin letters'); ?>",
"Lower greek" : "<?php echo lang('Lower greek letters'); ?>",
"ListStyleTooltip" : "<?php echo lang('Choose list style type (for ordered lists)'); ?>"
};

View File

@ -0,0 +1,66 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker');
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
SpellChecker.I18N = {
"CONFIRM_LINK_CLICK" : "<?php echo lang('Please confirm that you want to open this link'); ?>",
"Cancel" : "<?php echo lang('Cancel'); ?>",
"Dictionary" : "<?php echo lang('Dictionary'); ?>",
"Finished list of mispelled words" : "<?php echo lang('Finished list of mispelled words'); ?>",
"I will open it in a new page." : "<?php echo lang('I will open it in a new page.'); ?>",
"Ignore all" : "<?php echo lang('Ignore all'); ?>",
"Ignore" : "<?php echo lang('Ignore'); ?>",
"NO_ERRORS" : "<?php echo lang('No mispelled words found with the selected dictionary.'); ?>",
"NO_ERRORS_CLOSING" : "<?php echo lang('Spell check complete, didn\'t find any mispelled words. Closing now...'); ?>",
"OK" : "<?php echo lang('OK'); ?>",
"Original word" : "<?php echo lang('Original word'); ?>",
"Please wait. Calling spell checker." : "<?php echo lang('Please wait. Calling spell checker.'); ?>",
"Please wait: changing dictionary to" : "<?php echo lang('Please wait: changing dictionary to'); ?>",
"QUIT_CONFIRMATION" : "<?php echo lang('This will drop changes and quit spell checker. Please confirm.'); ?>",
"Re-check" : "<?php echo lang('Re-check'); ?>",
"Replace all" : "<?php echo lang('Replace all'); ?>",
"Replace with" : "<?php echo lang('Replace with'); ?>",
"Replace" : "<?php echo lang('Replace'); ?>",
"Revert" : "<?php echo lang('Revert'); ?>",
"SC-spell-check" : "<?php echo lang('Spell-check'); ?>",
"Suggestions" : "<?php echo lang('Suggestions'); ?>",
"pliz weit ;-)" : "<?php echo lang('pliz weit ;-)'); ?>"
};

View File

@ -0,0 +1,118 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-TableOperations');
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http: //dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
TableOperations.I18N = {
"Align": "<?php echo lang('Align'); ?>",
"All four sides": "<?php echo lang('All four sides'); ?>",
"Background": "<?php echo lang('Background'); ?>",
"Baseline": "<?php echo lang('Baseline'); ?>",
"Border": "<?php echo lang('Border'); ?>",
"Borders": "<?php echo lang('Borders'); ?>",
"Bottom": "<?php echo lang('Bottom'); ?>",
"CSS Style": "<?php echo lang('Style [CSS]'); ?>",
"Caption": "<?php echo lang('Caption'); ?>",
"Cell Properties": "<?php echo lang('Cell Properties'); ?>",
"Center": "<?php echo lang('Center'); ?>",
"Char": "<?php echo lang('Char'); ?>",
"Collapsed borders": "<?php echo lang('Collapsed borders'); ?>",
"Color": "<?php echo lang('Color'); ?>",
"Description": "<?php echo lang('Description'); ?>",
"FG Color": "<?php echo lang('FG Color'); ?>",
"Float": "<?php echo lang('Float'); ?>",
"Frames": "<?php echo lang('Frames'); ?>",
"Height": "<?php echo lang('Height'); ?>",
"How many columns would you like to merge?": "<?php echo lang('How many columns would you like to merge?'); ?>",
"How many rows would you like to merge?": "<?php echo lang('How many rows would you like to merge?'); ?>",
"Image URL": "<?php echo lang('Image URL'); ?>",
"Justify": "<?php echo lang('Justify'); ?>",
"Layout": "<?php echo lang('Layout'); ?>",
"Left": "<?php echo lang('Left'); ?>",
"Margin": "<?php echo lang('Margin'); ?>",
"Middle": "<?php echo lang('Middle'); ?>",
"No rules": "<?php echo lang('No rules'); ?>",
"No sides": "<?php echo lang('No sides'); ?>",
"None": "<?php echo lang('None'); ?>",
"Padding": "<?php echo lang('Padding'); ?>",
"Please click into some cell": "<?php echo lang('Please click into some cell'); ?>",
"Right": "<?php echo lang('Right'); ?>",
"Row Properties": "<?php echo lang('Row Properties'); ?>",
"Rules will appear between all rows and columns": "<?php echo lang('Rules will appear between all rows and columns'); ?>",
"Rules will appear between columns only": "<?php echo lang('Rules will appear between columns only'); ?>",
"Rules will appear between rows only": "<?php echo lang('Rules will appear between rows only'); ?>",
"Rules": "<?php echo lang('Rules'); ?>",
"Spacing and padding": "<?php echo lang('Spacing and padding'); ?>",
"Spacing": "<?php echo lang('Spacing'); ?>",
"Summary": "<?php echo lang('Summary'); ?>",
"TO-cell-delete": "<?php echo lang('Delete cell'); ?>",
"TO-cell-insert-after": "<?php echo lang('Insert cell after'); ?>",
"TO-cell-insert-before": "<?php echo lang('Insert cell before'); ?>",
"TO-cell-merge": "<?php echo lang('Merge cells'); ?>",
"TO-cell-prop": "<?php echo lang('Cell properties'); ?>",
"TO-cell-split": "<?php echo lang('Split cell'); ?>",
"TO-col-delete": "<?php echo lang('Delete column'); ?>",
"TO-col-insert-after": "<?php echo lang('Insert column after'); ?>",
"TO-col-insert-before": "<?php echo lang('Insert column before'); ?>",
"TO-col-split": "<?php echo lang('Split column'); ?>",
"TO-row-delete": "<?php echo lang('Delete row'); ?>",
"TO-row-insert-above": "<?php echo lang('Insert row before'); ?>",
"TO-row-insert-under": "<?php echo lang('Insert row after'); ?>",
"TO-row-prop": "<?php echo lang('Row properties'); ?>",
"TO-row-split": "<?php echo lang('Split row'); ?>",
"TO-table-prop": "<?php echo lang('Table properties'); ?>",
"Table Properties": "<?php echo lang('Table Properties'); ?>",
"Text align": "<?php echo lang('Text align'); ?>",
"The bottom side only": "<?php echo lang('The bottom side only'); ?>",
"The left-hand side only": "<?php echo lang('The left-hand side only'); ?>",
"The right and left sides only": "<?php echo lang('The right and left sides only'); ?>",
"The right-hand side only": "<?php echo lang('The right-hand side only'); ?>",
"The top and bottom sides only": "<?php echo lang('The top and bottom sides only'); ?>",
"The top side only": "<?php echo lang('The top side only'); ?>",
"Top": "<?php echo lang('Top'); ?>",
"Unset color": "<?php echo lang('Unset color'); ?>",
"Vertical align": "<?php echo lang('Vertical align'); ?>",
"Width": "<?php echo lang('Width'); ?>",
"not-del-last-cell": "<?php echo lang('HTMLArea cowardly refuses to delete the last cell in row.'); ?>",
"not-del-last-col": "<?php echo lang('HTMLArea cowardly refuses to delete the last column in table.'); ?>",
"not-del-last-row": "<?php echo lang('HTMLArea cowardly refuses to delete the last row in table.'); ?>",
"percent": "<?php echo lang('percent'); ?>",
"pixels": "<?php echo lang('pixels'); ?>"
};

View File

@ -0,0 +1,54 @@
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Modified by Ralf Becker <RalfBecker@outdoor-training.de> *
* This file is derived from htmlareas's lang/en.js file *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array(
'currentapp' => 'home', // can't be phpgwapi, nor htmlarea (no own directory)
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True,
'nocachecontrol' => True // allow cacheing
);
include('../../../../../../header.inc.php');
$GLOBALS['phpgw']->translation->add_app('htmlarea-SpellChecker');
// I18N for the FullPage plugin
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
?>
UploadImage.I18N = {
"Alternate style-sheet:": "<?php echo lang('Alternate style-sheet:'); ?>",
"Background color:": "<?php echo lang('Background color:'); ?>",
"Cancel": "<?php echo lang('Cancel'); ?>",
"DOCTYPE:": "<?php echo lang('DOCTYPE:'); ?>",
"Document properties": "<?php echo lang('Document properties'); ?>",
"Document title:": "<?php echo lang('Document title:'); ?>",
"OK": "<?php echo lang('OK'); ?>",
"Primary style-sheet:": "<?php echo lang('Primary style-sheet:'); ?>",
"Text color:": "<?php echo lang('Text color:'); ?>",
"Upload Image": "<?php echo lang('Upload Image'); ?>"
};

View File

@ -0,0 +1,117 @@
#!/usr/bin/php -q
<?php
/**************************************************************************\
* eGroupWare - API htmlarea translations (according to lang in user prefs) *
* http: //www.eGroupWare.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$plugin_dir = realpath(dirname(__FILE__));
$setup_dir = realpath(dirname(__FILE__).'/../../../setup');
function load_langfile($lang)
{
global $setup_dir;
$lang_file = $setup_dir.'/phpgw_'.$lang.'.lang';
$arr = array();
if (file_exists($lang_file))
{
foreach(file($lang_file) as $line)
{
@list($phrase,$app,$lang,$trans) = split("[\t\n\r]",$line);
$arr[$phrase] = array(
'app' => $app,
'trans' => $trans,
);
}
}
return $arr;
}
function save_langfile($lang,$arr)
{
$content = '';
ksort($arr);
foreach($arr as $phrase => $data)
{
$content .= "$phrase\t$data[app]\t$lang\t$data[trans]\n";
}
global $setup_dir;
$lang_file = $setup_dir.'/phpgw_'.$lang.'.lang';
if ($f = fopen($lang_file,'w'))
{
fwrite($f,$content);
}
fclose($f);
}
$d = opendir($plugin_dir);
while ($plugin = readdir($d))
{
if (!is_dir($plugin) || $plugin == 'CVS' || $plugin == 'CSS' || $plugin[0] == '.') continue;
if (!@file_exists($lang_file = $plugin_dir.'/'.$plugin.'/lang/en.js')) continue;
$lang_file = file_get_contents($lang_file);
if (!preg_match_all('/"([^"]+)"[ \t:]+"([^"]+)"/',$lang_file,$matches)) continue;
$token2en = array();
foreach($matches[1] as $n => $token)
{
$token2en[$token] = $matches[2][$n];
}
$l = opendir($plugin_dir.'/'.$plugin.'/lang');
while ($lang_file = readdir($l))
{
if (!preg_match('/.js$/',$lang_file)) continue;
$lang = substr($lang_file,0,2);
$lang_file = $plugin_dir.'/'.$plugin.'/lang/'.$lang_file;
echo "\nprocessing: $lang_file\n";
$lang_file = file_get_contents($lang_file);
if (preg_match_all('/"([^"]+)"[ \t:]+"([^"]+)"/',$lang_file,$matches))
{
$arr = load_langfile($lang);
$needs_save = false;
foreach($matches[1] as $n => $token)
{
if (!isset($token2en[$token])) continue;
$phrase = strtolower($token2en[$token]);
if (!$phrase) continue;
if (isset($arr[$phrase]))
{
if ($arr[$phrase]['app'] != 'common' && $arr[$phrase]['app'] != 'htmlarea-'.$plugin)
{
$arr[$phrase]['app'] = 'common';
}
continue;
}
$arr[$phrase] = array(
'app' => 'htmlarea-'.$plugin,
'trans' => $matches[2][$n],
);
echo "adding: $phrase = ".$matches[2][$n]."\n";
$needs_save = true;
}
if ($needs_save) save_langfile($lang,$arr);
}
}
}
closedir($d);