Tool for translation

Have a translation or something? It goes here. This can mean modules, documentation, or CMSMS itself!
Post Reply
alby

Tool for translation

Post by alby »

This class check and display difference with other file language.

Print to screen:
  • diff of values between Current and Prev (version of default language to time of translation for to check eventualy modify item) default language
  • diff of keys (new item) between Current default language and translation Language file
Here you have an example to how implement the class for admin lang translation (example: it_IT):
(Note: 1. - 4. FOR NEW LANG TRANSLATION ONLY)


1. Copy LangCheck.php in

2. Make directory "it_IT" under admin/lang:  "./admin/lang/it_IT"

3. Copy "./admin/lang/en_US/admin.inc.php" in
"./admin/lang/it_IT/en_US.php"  AND
"./admin/lang/it_IT/admin.inc.php"

4. Create a file check_lang.php in :

Code: Select all

<?php
exit;
require 'LangCheck.php';
$obj = new langcheck();

// Default language reference (en_US)
$obj->default_new_lang = 'en_US';
// Language translation (in this example: it_IT)
$obj->language_lang = 'it_IT';

// Default language path file - Current
$obj->default_new_file = './admin/lang/'. $obj->default_new_lang .'/admin.inc.php';
// Default language path file - Prev (to time of Language file)
$obj->default_old_file = './admin/lang/'. $obj->language_lang .'/en_US.php';
// Language path file
$obj->language_file = './admin/lang/'. $obj->language_lang .'/admin.inc.php';

$obj->load();
$obj->display();
?>

5. Comment the second row:  //exit;

6. Go to: http:///check_lang.php

7. Uncomment the second row:  exit;

8. Edit in Language file for the new values in browser
(check -old->......<-new-)
(from Diff: Current and Prev default language file)

9. Edit in Language file for the new keys in browser
(From Diff: Current default language and Language file)

10. Substitute Prev default language file with Current default language:
copy "./admin/lang/en_US/admin.inc.php" in "./admin/lang/it_IT/en_US.php"

11. DONE


See check_lang.php in archive for admin+standard modules in CMSMS0.11b5.
Rename langcheck_for_translation.mpg in langcheck_for_translation.zip

Alby


[attachment deleted by admin]
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Tool for translation

Post by Ted »

There is actually a similar script in svn already.  It's found here.  I'm sure it's not as elegant as yours, but it seems to work.

Basically, it finds all of the lines in the English translation, and if it's not in any of the others, it's added.
alby

Re: Tool for translation

Post by alby »

Yes, it's similar.
But I wanted a tool that checked if something were changed in language items beyond the new lines.
For example, in CSSMenu $lang['help'] has changed from .11b3 to .11b4 and I had not seen it :-|

Alby
Last edited by alby on Thu Nov 17, 2005 5:34 pm, edited 1 time in total.
Post Reply

Return to “Translations”