Running the string length checker

About this task

You run the string length checker to ensure that the translated strings do not exceed the field lengths of the tables.
Note: The Localized Strings Reconciler is enhanced to extract data from specific attributes on XMLs in CLOB columns in the database. These fields do not have explicit length restrictions. When you run the string length checker tool, the output file displays these fields as strings with missing length.

To run the string length checker, perform the following steps:

Procedure

  1. Create a folder named /Length.
  2. Copy the contents of <INSTALL_DIR>/repository/entity, including all subfolders, into /Length/entity.
  3. Copy the contents of the following subdirectories of <INSTALL_DIR>/repository/factorysetup/ into /Length/XMLS:
    1. <INSTALL_DIR>/repository/factorysetup/complete_installation/XMLS
    2. <INSTALL_DIR>/repository/factorysetup/sbc/XMLS
    3. <INSTALL_DIR>/repository/factorysetup/Add-in/XMLS
    4. <INSTALL_DIR>/repository/factorysetup/scecore_installation/XMLS
    5. All xml files under <INSTALL_DIR>/repository/factorysetup/Add-in/XMLS and its subdirectories.
    Note: The factorysetup directory is generated when the COPY_FCXML_TO_REPOSITORY property is set to True.
  4. Copy the <INSTALL_DIR>/repository/datatypes/datatypes.xml into /Length.
  5. Copy the following JAR files to the /Length/lib directory:
    • <INSTALL_DIR>/jar/platform_afc/<version>/platform_afc.jar, where <version> is the Sterling Application Platform version being consumed by the application.
    • <INSTALL_DIR>/jar/platform_baseutils.jar
    • <INSTALL_DIR>/jar/install_foundation.jar
    • <INSTALL_DIR>/jar/log4j/1_2_15/log4j-1.2.15.jar
    • <INSTALL_DIR>/jdk/jre/lib/endorsed/xalan.jar
    • <INSTALL_DIR>/jdk/jre/lib/endorsed/xercesImpl.jar
    • <INSTALL_DIR>/jdk/jre/lib/endorsed/xml-apis.jar
  6. Copy <INSTALL_DIR>/repository/factorysetup/complete_installation/XMLS/<language>_<country>/<baselanguage>_<basecountry>_<prefix>localizedstrings_<language>_<country>.properties to /Length
  7. Set CLASSPATH= /Length/lib/xml-apis.jar;/Length/lib/xalan.jar;/Length/lib/xercesImpl.jar;/Length/lib/platform_afc.jar;/Length/lib/platform_baseutils.jar;/Length/lib/install_foundation.jar;/Length/lib/log4j-1.2.15.jar
  8. Run the following Java™ command. This command runs the string length checker in GENERATE mode. In this mode, the output file contains a list of translatable literals and their maximum string lengths.
    call <JAVA_HOME>/bin/java 
    com.yantra.ycp.tools.localization.YCPLocalizedStringLengthTool -OUTPUT_FILE 
    /Length/LengthsFile.txt -MODE GENERATE -ENTITY_DIR /Length/entity -DTYPES_FILE 
    /Length/datatypes.xml -FC_DIR /Length/XMLS 
  9. Run the following Java command. This command runs the string length checker in CHECK mode. In this mode, the localizedstrings file (for instance en_US_ycplocalizedstrings_ja_JP.properties) is compared with the LengthsFile.txt file that is generated from running the string length checker in GENERATE mode. Running this tool in CHECK mode also creates MissingLength.txt, which contains the literals that are missing from LengthsFile.txt, and MissingTranslations.txt, which contains the literals missing from the localizedstrings file that was passed in the input.
    call <JAVA_HOME>/bin/java 
    com.yantra.ycp.tools.localization.YCPLocalizedStringLengthTool
    -OUTPUT_FILE inconsistencies.txt -MODE CHECK -LENGTHS_FILE 
    /Length/LengthsFile.txt -TRANSLATIONS_FILE /Length/
    <baselanguage>_<basecountry>_<prefix>localizedstrings
    _<language>_<country>.properties