Skip to main content

Utils.Translate

class Utils.Translate extends %Library.RegisteredObject

Methods to help set up translation snapshot directory and to set up the eventual home of the translated files and associated image files. The translation process consists of two phases:

Method Inventory

Methods

classmethod OLDPhase2CopyImageDirs()
classmethod Phase1MakeSnapshot()
FOR PHASE 1 Use this method to set up the translation snapshot directory.

To use this method:

  1. Call this method:
     do ##class(Utils.Translate).Phase1MakeSnapshot()
    
  2. At the first prompt, enter the full name of the directory that contains the English source files. For example: c:\Perforce\learning\iris-doc\2023.1.x\doc\
  3. The method then displays the name of the directory it's going to create by default. For example: c:\Perforce\learning\iris-doc\2023.1.x\translate\. Either press ENTER to accept that or enter the full name of a different directory.
  4. If this directory already exists, things could be confusing, so make sure it does not yet exist. If it does, enter N and then rerun with a different name OR just delete the directory (including using P4 delete to delete from Perforce).
  5. To proceed, enter Y.

    The method then copies the directories, creating a new, somewhat more compact and differently named directory structure. The directories here are named differently to avoid confusing writers who might accidentally make edits in them.

  6. Use the Perforce client to add these files & check them in.
  7. Create & check in a relinfo file that corresponds to this new set of files. The name of the relinfo file should start with TRANSLATE. See existing files for reference.
  8. Notify the translators (or their intermediary, Nakahashi) that the files are ready. Tell them where to find the files in Perforce, and the name of the relinfo file to use to load & validate the files.
classmethod Phase2CopyImageDirs()
FOR PHASE 2 This method performs the second half of the work needed to set up the ja-jp subdirectories after the translated files have come back. The translated files are the Japanese versions of the files in the translate snapshot directory (see Phase1MakeSnapshot()) and thus must use the same image files contained in that directory. The purpose of Phase2CopyImageDirs() is to copy the image directories and all their contents from the translate snapshot directory to the appropriate parts of the ja-jp subdirectories. If the ja-jp subdirectories do not yet exist, this method creates them. NOTE: Don't run this until we have the translated files. Sometimes it is necessary to make a new snapshot for the translators, and there's no point in copying the image files into place until we know we need them.

To use this method:

  1. Call this method:
     do ##class(Utils.Translate).Phase2CopyImageDirs()
    
  2. At the first prompt, enter the full directory name of the translate snapshot directory. For example: c:\Perforce\learning\iris-doc\2023.1.x\translate\.
  3. At the second prompt, enter the full directory name of the new directory structure that contains (or will contain) the Japanese files. For example: c:\Perforce\learning\iris-doc\2023.1.x\ja-jp-doc\.
  4. The method then prompts to confirm that you want to continue. If the choices are correct, enter y or Y.
  5. Use the Perforce client to add the new files and check them in.
classmethod Phase2CopyTranslatedFiles()
FOR PHASE 2 This method performs the first half of the work needed to set up the ja-jp subdirectories after the translated files have come back. We receive the files in the form of a large ZIP file that contains the directory structure as defined in the translation snapshot directory, but lacking the image subdirectories.

To use this method:

  1. Uncompress the ZIP file to your hard drive and make a note of its location and contents. In particular, make note of the directory that contains the subdirectories cache-src, ensemble-src, healthcommon-src, and so on.
  2. Decide where to put the new files. For example: c:\Perforce\learning\iris-doc\2023.1.x\ja-jp-doc\, which is parallel to the doc directory that contains the English sources.
  3. (Note that the structure of the new directory will be the same except that instead of having en-us subdirectories, you'll have ja-jp directories. This enables the PDF generation code to know that these are Japanese files and need the Japanese font files.) You do not have to actually create the directory; the method will do that if needed.
  4. Call this method:
     do ##class(Utils.Translate).Phase2CopyTranslatedFiles()
    
  5. At the first prompt, enter the full directory name from step 1.
  6. At the second prompt, enter the full directory name from step 2.
  7. The method then prompts to confirm that you want to continue. If the choices are correct, enter y or Y.
  8. Use the Perforce client to add the new files and check them in.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab