wiki:synch_lang

Version 3 (modified by ticheler, 16 years ago) ( diff )

--

Synchronize language files

Roberto Giaccio wrote this small application for GeoNetwork that compares all localized files and checks for;

  • files available in main language but missing in localized directory
  • extra files in localized directory not present in main language directory
  • in addition, if a file is xml, both the main language and localized document are loaded, and the application checks for:
    • elements (root children) available in main language but missing in localized document
    • elements(root thildren) in localized document not present in main language document
  • if the file is xml and contains errors (like bad UTF, encoding) an error message is displayed.

The program is executed with the following commands:

cd GEONETWORK_WEBAPP_DIR (usually ./web/geonetwork) java -cp WEB-INF/lib/geonetwork.jar:WEB-INF/lib/jeeves.jar:WEB-INF/lib/jdom.jar org.fao.geonet.apps.!CheckLocalizedFiles loc/ en > output_file.txt

You can also run the application for other folders containing localized files. For instance part of InterMap or those that come with a metadata schema. Just change the loc/ part with a reference to the folder you want to compare. So for instance:

java -cp WEB-INF/lib/geonetwork.jar:WEB-INF/lib/jeeves.jar:WEB-INF/lib/jdom.jar org.fao.geonet.apps.CheckLocalizedFiles xml/schemas/iso19139/loc/ en > ~/localization_errors_19139.txt

Note: See TracWiki for help on using the wiki.