New features requests: coloring and directories parsing

3 views
Skip to first unread message

Yannick

unread,
Mar 31, 2009, 7:35:06 PM3/31/09
to phpLangEditor
Hi Seb,

I'm currently using phpLangEditor for a side-project called OpenC2C
(www.sf.net/projects/openc2c), based on the Akelos framework, with my
team. Because we are using it very intensively, I came across a bunch
of new features ideas that I'd like to share (you know I can probably
give a hand implementing them later on when I have some time).

Basically, I have a bunch of suggestions:

1. - coloring variables in the left column to show which ones are not
translated at all (the ones that appear when you select the filter)

2. - parsing the directories to find which files actually contain
untranslated variables for two given languages (reference and
translation)

3. - parsing the directories to fing which languages have untranslated
files (for example, English is the reference and you find Spanish has
three files missing)

4. - statistical gathering (allow for quick statistics about the files
in the different directories, percentage of translations, number of
variables, number of words, etc) in a copy-pasteable format

5. - automatic translations suggestions (using Google Translator for
example) (these could appear in the bottom of the translation area,
and offer a button that says: use this translation)


Most of these (apart from 1 and 5) would appear in a separate panel
(no place to put them in the current panel)

I also have noticed that, depending on the project, the structure of
files can be of two kinds:
- one main directory, 1 subdirectory for each language, one file for
each application area
- one main directory, 1 subdirectory for each application area, one
file for each language

Yannick

enca...@gmail.com

unread,
Apr 3, 2009, 3:20:40 AM4/3/09
to phpLangEditor
Hi Yannick,

Happy to hear another open source project use phpLangEditor.

I like the first suggestion, it's true that a hint like this in the
list is missing.

Point 5 is also something I already thought about and I guess it could
be useful (even more if translator can choose the service from which
he want suggestions).

I'm less confident in the 3 other points as parsing one file is
already a big deal using Javascript (so do I when a reference or
translation file is opened) Before allowing this I (or someone else)
should improve the current parsing method to :
1. allow fetching or PHP variable defined in any possible way (see end
of this message)
2. improve performances
3. preserve format
4. preserve comments
5. alternatively add optionnal comments from translator


The difficulty in parsing php file is the large number of
possibilities to declare variables (or constants)
Some examples :
a.
$var1 = 'text';
$var2 = 'text';

b.
$var['var1'] = 'text';
$var['var2'] = 'text';

c.
define('var1','text');
define('var2','text');

d.
$var = array(
'var1' => 'text',
'var2 => 'text'
);

e. (ini type)
var1 = text
var2 = text

etc...


And the various comments possibilities

a.
// comment

b.
/* comment */

c.
# comment

d. (ini type)
; comment

etc...

And the fact that there can be other code that lang vars in the file
(even if it shouldn't !) But some code to prevent direct inclusion
should at least be considered to exist in file.


If parsing is ok as I would like it to be we could imagine
implementing your point 2 to 4 ;-)


Regards,

Sébastien
Reply all
Reply to author
Forward
0 new messages