Automatisation of translation(edit the translation like wiki
Moderator: Forum Moderators
Automatisation of translation(edit the translation like wiki
Hi!
Im creating a page web, for automatisation the translation. I have filled with the utranslated strings(308).
The idea is was, is not just me, who is translating the hungarian translation file. So for make the life easy, I have written a small page around it.
Here is the URL:
http://khiraly.homeunix.org/cgi-bin/wesnoth.cgi
Is it not done for now, but Im working on to implement the edit function.
Im writing in perl, using the template system.
Is it anybody who is interessing on? (for own translation file)
Cheers,
Khiraly
Im creating a page web, for automatisation the translation. I have filled with the utranslated strings(308).
The idea is was, is not just me, who is translating the hungarian translation file. So for make the life easy, I have written a small page around it.
Here is the URL:
http://khiraly.homeunix.org/cgi-bin/wesnoth.cgi
Is it not done for now, but Im working on to implement the edit function.
Im writing in perl, using the template system.
Is it anybody who is interessing on? (for own translation file)
Cheers,
Khiraly
For now Im working on the basic functions(edit, export as .cfg)lala wrote:Idea's: if you could read-and-parse/save whatever lang.cfg file then it would be suitable for all languages to be edited on the web.
Also a sort on 'done' and 'still to do' would be handy
And I have created for my co-person who is helping with the translation.
But if the other translator find this site usefull, so I will make possibilities to upload, and implement the functions requested.
Other side, the fileformat is the following:
nameOfTHeOption|text in english|text an another language|
So isnt advanced, and I must working to convert the .cfg file format to my file format ...(For now isnt really automatised, I have converted with vim manually)
Best regards,
Khiraly
I think this would be quite helpful
Having an easy way to improve the translation will allow for more contributors. Could you create this page for more languages?
converting between
And back is a little more complicated, but still manageable:
Of course, this does not mitigate the problem of having the english texts spread through multiple data files.
converting between
and key="value" should be quite easy in Perl:nameOfTHeOption|text in english|text an another language|
Code: Select all
my @input=split("\|", join("", <>));
while (@input>2) {
my $name = shift @input;
my $en = shift @input;
my $tr = shift @input;
print qq($name="$tr"\n);
}
Code: Select all
sub readFileAtOnce {
open FILE, "< @_[0]";
my $file = join("", <FILE>);
close FILE;
return $file;
}
my $en = readFileAtOnce("english.cfg");
my $tr = readFileAtOnce($ARGV[0]);
my %en = ();
while ($en =~ /\s*([^=]*)=\"([^\"]*)\"/gm) {
$en{$1}=$2;
}
my %tr = ();
while ($tr =~ /\s*([^=]*)=\"([^\"]*)\"/gm) {
$tr{$1}=$2;
}
foreach (keys %en) {
unless ($tr{$_}) { $tr{$_} = "XXX NOT THERE XXX"; }
}
foreach (keys %tr) {
print "$_\|$en{$_}\|$tr{$_}\|\n";
}